How do I convert my libsonnet files into jsonnet files and then plot them in Grafana?
I am using the repo: grafonnet-lib.
Here I want to execute the libsonnet files in grafonnet, but when I execute a file, for example: dashboard.libsonnet
, in vscode
I get this: { }
FYI: I am using a Windows 10 machine
What should I do in order to execute a libsonnet file and see something in Grafana?
Also, where are the libsonnet libraries and how do I work with them? I think I dont have to install any libraries, right?
Don't execute the libsonnet itself, it's a library. Import and call the grafonnet functions from a separate jsonnet file. For grafonnet, there are tons of examples.
Straight from the grafana/grafonnet-lib/examples page... (hint: this goes in a separate
.jsonnet
file, not in grafana.libsonnet)Look into
jb
(jsonnet builder) for managing the libsonnet called by in jsonnet.