You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dashboards manifestion works without error when any of the files in the watchList are modified.
Actual Behavior
Users might want to create reusable lib. As such they will start grizzly and watch several path. This is similar to what is documented here https://grafana.github.io/grizzly/server/, this is also what is done in [grafonnet examples(https://github.com/grafana/grafonnet/tree/main/examples/redMethod). Depending on what you are work on, user could edit either the dashboard itself or the underlying reusable lib.
However when grizzly detect a change in the underlying lib the manifestion fails
➜ reproducer docker compose up
[+] Running 2/0
✔ Container grafana Created 0.0s
✔ Container grizzly Recreated 0.1s
Attaching to grafana, grizzly
grafana | logger=plugins.registration t=2025-01-10T13:22:54.913338607Z level=error msg="Could not register plugin" pluginId=xychart error="plugin xychart is already registered"
grafana | logger=plugins.initialization t=2025-01-10T13:22:54.913475793Z level=error msg="Could not initialize plugin" pluginId=xychart error="plugin xychart is already registered"
grizzly | level=info msg="[watcher] Watching for changes"
grizzly | Listening on http://localhost:8080/
grizzly | level=error msg="[watcher] Error: parse error in '/mnt/dashboards/examples/redMethod/lib/redDashboard/main.libsonnet': RUNTIME ERROR: couldn't manifest function as JSON\n\tField \"addApplication\"\t\n\tDuring manifestation\t\n"
grizzly | level=warning msg="[watcher] error: parse error in '/mnt/dashboards/examples/redMethod/lib/redDashboard/main.libsonnet': RUNTIME ERROR: couldn't manifest function as JSON\n\tField \"addApplication\"\t\n\tDuring manifestation\t\n"
grizzly | level=error msg="[watcher] Error: parse error in '/mnt/dashboards/examples/redMethod/lib/redDashboard/main.libsonnet': RUNTIME ERROR: couldn't manifest function as JSON\n\tField \"addApplication\"\t\n\tDuring manifestation\t\n"
grizzly | level=warning msg="[watcher] error: parse error in '/mnt/dashboards/examples/redMethod/lib/redDashboard/main.libsonnet': RUNTIME ERROR: couldn't manifest function as JSON\n\tField \"addApplication\"\t\n\tDuring manifestation\t\n"
In this case, user could workaround the error by restarting grizzly at each change but it is cumbersome and make the watch feature less useful.
You are attempting to run the Grafonnet examples, particularly the redMethod one, but you are using the library main.libsonnet as the entry point. That library is designed to be used by other jsonnet code, not to be run directly. Instead, you should call the examples/redMethod/main.libsonnet file. This one should load everything correctly.
I'm a bit confused as I specifically call grizzly with /mnt/dashboards/examples/redMethod/main.libsonnet which is different than /mnt/dashboards/examples/redMethod/lib/redDashboard/main.libsonnet (the underlying lib).
I could have been more explicit in the introduction.
When I run serve -w examples/redMethod/main.libsonnet it works as expected and the dashboard is reloaded each time I modify examples/redMethod/main.libsonnet
When I run serve -w examples/redMethod/main.libsonnet /mnt/dashboards/examples/redMethod it works as expected only when I modify examples/redMethod/main.libsonnet, when I modify anything under examples/redMethod/lib I have the error above.
If this is not a bug, what is the best way to structure your dashboards and lib while keeping the watch features that does not throw an error like couldn't manifest function as JSON
Grizzly Version
0.6.1
Expected Behavior
Dashboards manifestion works without error when any of the files in the watchList are modified.
Actual Behavior
Users might want to create reusable lib. As such they will start grizzly and watch several path. This is similar to what is documented here https://grafana.github.io/grizzly/server/, this is also what is done in [grafonnet examples(https://github.com/grafana/grafonnet/tree/main/examples/redMethod). Depending on what you are work on, user could edit either the dashboard itself or the underlying reusable lib.
However when grizzly detect a change in the underlying lib the manifestion fails
In this case, user could workaround the error by restarting grizzly at each change but it is cumbersome and make the watch feature less useful.
Steps to Reproduce
The text was updated successfully, but these errors were encountered: