Example of annotation ? #93
-
Hi, I would like to add annotations to my dashboard and was wondering if you help me with an example for creating the annotation object and how it should be passed into dashboard ? Also can I create a new annotation object using |
Beta Was this translation helpful? Give feedback.
Answered by
Duologic
Aug 18, 2023
Replies: 1 comment
-
The annotations part of grafonnet has not received a lot of attention yet. I just had a quick look at how to do this with the current code but it not very user-friendly yet. local grafonnet = import 'github.com/grafana/grafonnet/gen/grafonnet-latest/main.libsonnet';
local annotation = g.dashboard.annotation;
your_dashboard
+ g.dashboard.withAnnotations([
annotation.datasource.withType('prometheus')
+ annotation.datasource.withUid('default')
+ annotation.withName('A vector annotation')
+ {
// adding these here as the upstream schema does not implement them yet, so there is not function for it
expr: 'vector(1)',
enabled: true,
},
]) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Duologic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The annotations part of grafonnet has not received a lot of attention yet. I just had a quick look at how to do this with the current code but it not very user-friendly yet.