-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add generated jsonnet library #1770
Conversation
5b63ef6
to
60f151d
Compare
@Duologic - Can you help me understand how/when to make this sync with actual types? I also wonder how we do this jsonnet thing for other plugins (core, enterprise and other community plugins)? |
That's a good question. This initial PR simply syncs the schema with the types on the same branch, I'd suggest we match the schema sync that way along with the versions so it aligns with the release cadence. For core plugins, this is currently happening through grafana/grok (using the CUE schemas) but we're looking in getting such JSON Schemas directly in the grafana/grafana repo from Typescript. For other plugins, they could follow a similar path as this plugin, I'd say that this PR could serve as a pilot to generate jsonnet libraries near the plugin itself. The code in the At this point I'd suggest doing this for other plugins on a per-request basis as we don't want to introduce unnecessary work and code to maintain. |
Would y'all be less opposed to only having to generate and maintain the JSON schema? Then we can move the library itself into Grafonnet while keeping up with the releases of this plugin. |
Hi @Duologic - sorry for the delay. It slipped through. I will check this with team internally and get back to you. |
BTW, I am in favour of having only the generated files inside this repo and an option to generate the files ourselves. ( By keeping the generator outside ) |
The actual generator is not in here, that's the CRDsonnet package, the generator directory here holds the specific code for generating this library. |
I've put this into a separate repo: https://github.com/grafana/grafana-zabbix-libsonnet/ |
Fixes grafana/grafonnet#149
In the Grafonnet community some folks asked for support on the Zabbix plugin. I'm taking the liberty to propose adding this to the repo but feel free to point me in another direction.
This PR generates a library from the Typescript type
ZabbixMetricsQuery
, I'm boldly assuming that this is the type representing the JSON that is visible in the Dashboard JSON. Note that anything injsonnet/zabbix-query-libsonnet/
is generated by the Makefile targets.