docs/sources/datasources/google-cloud-monitoring/annotations/index.md
Annotations overlay rich event information on top of graphs. You can use annotations to mark important events, deployments, or incidents on your dashboards.
Before you configure annotations, ensure you have the following:
Keep the following limitations in mind when using annotations:
To add an annotation query to a dashboard:
With the query editor for annotations, you can select a metric and filters to define which data points create annotations.
The Title and Text fields support templating and can use data returned from the query.
For example, the Title field could have the following text:
{{metric.type}} has value: {{metric.value}}
Example result: monitoring.googleapis.com/uptime_check/http_status has this value: 502
Use the following patterns in the Title and Text fields to display metric data in your annotations:
| Pattern format | Description | Example | Result |
|---|---|---|---|
{{metric.value}} | Value of the metric/point. | {{metric.value}} | 555 |
{{metric.type}} | Returns the full Metric Type. | {{metric.type}} | compute.googleapis.com/instance/cpu/utilization |
{{metric.name}} | Returns the metric name part. | {{metric.name}} | instance/cpu/utilization |
{{metric.service}} | Returns the service part. | {{metric.service}} | compute |
{{metric.label.xxx}} | Returns the metric label value. | {{metric.label.instance_name}} | grafana-1-prod |
{{resource.label.xxx}} | Returns the resource label value. | {{resource.label.zone}} | us-east1-b |
To create annotations for uptime check failures:
monitoring.googleapis.com/uptime_check/check_passed metric.check_passed = false.Uptime check failed: {{metric.label.check_id}}Region: {{resource.label.zone}}This creates an annotation marker on your graph each time an uptime check fails.