joanlopez / grafonnet-example

Example repository with a Grafana dashboard defined with Grafonnet and deployed with Grizzly
https://github.com/joanlopez/grafonnet-example
3 stars 1 forks source link

Example uses deprecated Grizzly functionality #1

Closed mikaello closed 7 months ago

mikaello commented 8 months ago

Thanks for your example!

Just wanted to raise the issue that the example is using deprecated syntax for defining the dashboards:

https://github.com/joanlopez/grafonnet-example/blob/c68320c140bd20e9e590a549c22649ec5138ed44/dashboards.libsonnet#L2-L4

Ref Grizzly documentation regarding Hidden Elements:

NOTE: This functionality is deprecated. It was necessary to support the formats within Monitoring Mixins. However, using explicit resources provides a cleaner and language agnostic way to describe resources and their metadata. If you have existing libaries that use hidden elements, it isn't too hard to write small functions to wrap these into resources.

I think your example dashboard instead should be something like this:

local grr = import 'github.com/grafana/jsonnet-libs/grizzly/grizzly.libsonnet';

{
  dashboards: [
    grr.dashboard.new('example', (import 'example.jsonnet')),
  ],
}
joanlopez commented 8 months ago

Hey @mikaello,

Thanks for reporting it! Would you mind opening a PR? Thanks!

mikaello commented 8 months ago

Sure: https://github.com/joanlopez/grafonnet-example/pull/2

joanlopez commented 7 months ago

Closed by #2, thanks so much @mikaello! 🙏🏻 🙏🏻