grafana / grok

Grafana Object Development Kit
Apache License 2.0
50 stars 1 forks source link

Add simple schema registry #7

Closed malcolmholmes closed 1 year ago

malcolmholmes commented 1 year ago

Grafana schemas have their own versioning system, independent of Grafana itself. This versioning system is typically $MAJOR.$MINOR, with the addition of x which means "experimental".

When rendering libraries based upon these schema, end users will be concerned about Grafana versions. So we need a mapping between. This PR is a first pass at solving that.

If Grok's go generate is called with a GRAFANA_VERSION envvar set, the new "registry jennies" will kick in, rendering two files (core and composable) for that specific Grafana version. They basically say "this version of Grafana uses these schema version for these kinds".

This mapping can then be used by downstream libraries (or Grok itself) to render code for various languages.

malcolmholmes commented 1 year ago

This was intended for jsonnet support - but we've moved the boundaries, so this PR is now redundant (ideas will survive though!)