Open rifler opened 11 months ago
Hello!
Current behaviour
builder1 := dashboard.New( "dashboard 1", dashboard.Row( "Prometheus", row.WithGraph( // some data ), ), ) builder2 := dashboard.New( "dashboard 2", dashboard.Row( "Prometheus", row.WithGraph( // some data ), ), ) fmt.Printf("%d\n", builder1.Internal().Rows[0].Panels[0].ID) // 1 fmt.Printf("%d\n", builder2.Internal().Rows[0].Panels[0].ID) // 2
Expected behaviour Numbering is independent:
builder1 := dashboard.New( "dashboard 1", dashboard.Row( "Prometheus", row.WithGraph( // some data ), ), ) builder2 := dashboard.New( "dashboard 2", dashboard.Row( "Prometheus", row.WithGraph( // some data ), ), ) fmt.Printf("%d\n", builder1.Internal().Rows[0].Panels[0].ID) // 1 fmt.Printf("%d\n", builder2.Internal().Rows[0].Panels[0].ID) // 1
As far as I understand problem is here - https://github.com/K-Phoen/sdk/blob/master/row.go#L33 Possible solution is to extend MarshalJSON/MarshalIndentJSON and mutate ids there, starting them from 1
MarshalJSON
MarshalIndentJSON
Does that cause any issue when publishing the dashboards to Grafana?
Hello!
Current behaviour
Expected behaviour Numbering is independent:
As far as I understand problem is here - https://github.com/K-Phoen/sdk/blob/master/row.go#L33 Possible solution is to extend
MarshalJSON
/MarshalIndentJSON
and mutate ids there, starting them from 1