Google BigQuery annotations
Annotations let you mark points in time on your graphs with rich events from BigQuery data. Use annotations to correlate metrics with events like deployments, incidents, or other significant occurrences stored in BigQuery.
Before you begin
Before using annotations:
Create an annotation query
To add BigQuery annotations to a dashboard:
- Open the dashboard where you want to add annotations.
- Click Dashboard settings (gear icon).
- Click Annotations in the left menu.
- Click Add annotation query.
- Enter a Name for the annotation (for example,
Deployments). - Select your Google BigQuery data source.
- Write your annotation query.
- Click Apply to save.
Annotation query format
Annotation queries must return specific columns that Grafana uses to render the annotations.
Required columns
Optional columns
Annotation query examples
The following examples demonstrate common annotation patterns.
Simple event annotations
Mark deployment events on your graphs:
SELECT
deploy_time AS time,
version AS title,
CONCAT('Deployed by ', deployed_by) AS text
FROM `project.dataset.deployments`
WHERE $__timeFilter(deploy_time)
ORDER BY deploy_timeRegion annotations
Show time ranges (like maintenance windows or incidents) as shaded regions:
SELECT
start_time AS time,
end_time AS timeEnd,
incident_title AS title,
description AS text,
severity AS tags
FROM `project.dataset.incidents`
WHERE $__timeFilter(start_time)
ORDER BY start_timeAnnotations with tags
Add tags to filter annotations by category:
SELECT
event_time AS time,
event_name AS title,
details AS text,
event_type AS tags
FROM `project.dataset.events`
WHERE $__timeFilter(event_time)
ORDER BY event_timeYou can then filter annotations by tag using the annotation toggle in the dashboard.
Annotations from multiple sources
Combine different event types using UNION ALL:
SELECT
deploy_time AS time,
CAST(NULL AS TIMESTAMP) AS timeEnd,
CONCAT('Deploy: ', version) AS title,
deployed_by AS text,
'deployment' AS tags
FROM `project.dataset.deployments`
WHERE $__timeFilter(deploy_time)
UNION ALL
SELECT
start_time AS time,
end_time AS timeEnd,
incident_title AS title,
description AS text,
'incident' AS tags
FROM `project.dataset.incidents`
WHERE $__timeFilter(start_time)
ORDER BY timeFilter annotations
After adding annotation queries, you can show or hide them:
- Click the Annotations toggle at the top of the dashboard.
- Select or deselect specific annotation queries.
- If your annotations have tags, filter by tag name.
Best practices
Follow these recommendations for effective annotations:
- Use meaningful titles: Keep titles short but descriptive for quick identification.
- Add context in text: Include relevant details in the text field for more information on hover.
- Use tags consistently: Establish a tagging convention (for example,
deploy,incident,maintenance) across your queries. - Filter by time range: Always include
$__timeFilterto limit results to the dashboard time range. - Limit results: For tables with many events, add a
LIMITclause or additional filters to improve performance.



