Grafana annotations
Logbook can write events to Grafana dashboards as annotations, and read annotations back as events. Both directions are set up per connection, in the connection's side panel.
Connections
Open Settings → Connections. Under Grafana connections:
-
A Capture connection is set up for your company. It reaches Grafana through Capture.
-
Add connection adds a direct Grafana connection with a Display name, a Base URL (must start with
https://) and an API key (a Grafana service-account token). When you edit one, enter the API key again.
-
Enabled switches a connection on or off. A disabled connection pauses both directions.
Select the pencil on a connection's row to open its side panel. The Export section holds the dashboard links that push events to Grafana, the Import section holds the rules that turn annotations into events.


Setting up links and rules needs Connections: Manage; you do not need Event types: Manage for that. You can only link event types you have write access to.
Push events to Grafana
Logbook2.1.0+ Pushing is set up on the connection, not on the event type. The Grafana annotations switch and Annotation fields that used to be on an event type's General tab are gone; each dashboard link now carries its own.
A link sends the events of one event type to one dashboard. To add one:
- Open the connection's side panel and, in the Export section, add a link.
- Choose the Event type and the Dashboard. On the Capture connection you pick the dashboard from your company's Capture dashboards; on a direct connection Logbook looks up its title in Grafana. A Panel name is optional.
- Optionally pick the Annotation fields. Each selected field becomes one line of the annotation, in the order you select them. Select none and the annotation shows the event type name only. A new link starts with Event type name, Asset and Reported by ticked.

New, changed and deleted events of the type update their annotations on every link that is switched on. Deleting a link stops new annotations; annotations already on the dashboard stay. Events imported from Grafana are never pushed back.

Switch a link off
Each link has its own switch, which saves at once. A switched-off link is frozen: it creates, updates and deletes nothing on its dashboard, even when an event is edited, redacted or deleted in Logbook.
- Annotations of events that were deleted while the link was off are removed as soon as you switch it on again.
- Edits are not caught up. An event edited (for example redacted) while the link was off keeps its old annotation text until the event is edited again or deleted.
Edit a link
You can change a link's event type, dashboard, panel name, fields and switch, but not its connection. When you change the event type, the fields start from the new type's defaults. Annotations pushed before the change stay on the old dashboard until their event is deleted. If the link was switched off, annotations of events deleted in the meantime are removed from the old dashboard by Logbook's next clean-up.
A link whose event type was deleted stays in the list so you can delete it.
Existing links and their event type's fields are carried over to the new links. Event types that had Grafana annotations switched off become switched-off links, so their events stay frozen until you switch the link on.
Import annotations from Grafana
Logbook2.1.0+ Both kinds of connection import through import rules, set up in the Import section of the connection's side panel. Logbook checks Grafana on a fixed interval and creates an event for every new annotation that matches a rule.
An annotation shows up in Logbook within the next sweep (every 5 minutes by default), not the moment you save it in Grafana. It can take longer when many annotations arrive at once or when Grafana is slow or cannot be reached; Logbook then catches up on a later check.
Switch import on
- On the Capture connection, Import annotations starts off. Switch it on in the connections list. Importing then reads back up to the lookback period (30 days by default) of matching annotations.
- On a direct connection Import annotations starts on.
Rules can be set up while import is off, but they are only previewed once it is on. Switching it off or pausing the connection stops all reading; events that were already imported stay.
Import rules
A rule has a name and optional tags; on the Capture connection it also names a dashboard. On a direct connection a rule may name only tags, and then reads the whole Grafana organisation.
- A rule needs a dashboard on the Capture connection, because the Grafana organisation behind it may be shared with other companies. Pick it from the list of Capture's dashboards; a dashboard Capture does not list yet cannot be chosen.
- An annotation that matches no enabled rule is not imported.
- When several rules match, the first one wins. Drag a rule by its handle to change the order; a new rule goes last.
- A connection can have at most 20 enabled rules.
- A rule cannot require the tag
Logbook(exact case): Logbook uses it to mark annotations it wrote itself, which are never imported. - A disabled rule imports nothing. Deleting a rule stops the import; the events stay but are no longer kept in sync with Grafana, and recreating the rule does not take them back.

The preview below the rules shows what the next import would do with the latest annotations in the lookback period, and why an annotation is skipped. It reads from Grafana, so it needs Connections: Manage.
The event type of a rule
Each rule logs its annotations as its own event type. Logbook creates it the first time an annotation matches, named after the rule, with these fields:
| Field | Content |
|---|---|
| Text | The annotation text |
| Tags | The annotation's tags, comma-separated |
| Dashboard UID | The dashboard it sits on |
| Dashboard title | The dashboard's title |
| Panel id | The panel it belongs to |
| Annotation id | The annotation's id in Grafana |
You can rename and recolour the type and add your own fields. Imported events are reported by Grafana annotation, and are always points in time or, for a region annotation, a span that is kept as it is. If the rule's event type is disabled, only that rule pauses.

Keeping events in sync
- Editing an annotation in Grafana updates its event: text, tags and time.
- Deleting an annotation in Grafana deletes its event, once Logbook has confirmed that it is gone.
- When an annotation stops matching its rule (its tags or dashboard changed, or the rule was deleted), the event stays but is no longer updated or deleted.
- An event you delete in Logbook is not created again.
Interval and lookback
Under Advanced in the side panel:
- Sweep interval: how often the connection is read. 5 minutes by default, between 1 and 1,440.
- Lookback: how many days back each read looks. 30 days by default, between 1 and 365. Raising it imports older annotations; lowering it never removes events.
Faster import on a direct connection
A direct connection can set up a webhook in Grafana so changes arrive without waiting for the interval. The Advanced section shows its status and lets you disable it or retry removal. It needs Grafana 9.5 or newer and a service account that may write alerting provisioning; without it import keeps running on the sweep interval.
Ask operators to add the tag of your rule to every Grafana annotation that belongs in the logbook before you switch import on.