Skip to content

Dashboard: Annotations No Longer Work When Toggled Off By Default #110265

@Evesy

Description

@Evesy

What happened?

When a dashboard is created with an annotation toggled off (Saved via leaving 'Enabled' unselected in the annotation settings)

The annotation can be toggled on, but no annotation query is issued, so the annotations never render.

If you then edit the dashboard via the UI, even when the annotation is toggled on, the Enabled field is not selected.

What did you expect to happen?

It should be possible to save a dashboard with an annotation toggled off, and still have it function when the user opts to toggle it on after loading a dashboard

Did this work before?

Works as intened on 12.0.1

How do we reproduce it?

  1. Creat a dashboard with a random panel
  2. Add an annotation that should always display (i.e. a prometheus datasource with expression vector(1)
  3. Save the dashboard with the annotation Enabled left unticked.
  4. Toggle the annotation in the dashboard on/off, annotation is never rendered
  5. Edit the annotation settings, selecting Enabled and returning to the dashboard
  6. Toggle the annotation in the dashboard on/off, annotation will now be renderec (and you can see the requests in network tools)

It seems the state of whether the annotation is enabled i.e. "When enabled the annotation query is issued every dashboard refresh", and whether it is default toggled are being conflated; so when you save the dashboard with the toggle off, you're also permanent disabling the query ever being issued.
The behaviour of this in previous versions was different

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: 12.1.0
OS: Ubuntu 22.04.5 LTS (Grafana published docker Ubuntu image)
Browser: Google Chrome 139.0.7258.139

Grafana platform?

Kubernetes

Datasource(s)?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🗂️ Needs Triage / Escalation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions