This is documentation for the next version of Grafana. For the latest stable release, go to the latest version.
Add support for annotations
You can add support to your plugin for annotations that will insert information into Grafana alerts. This guide explains how to add support for annotations to a data source plugin.
Support annotations in your data source plugin
To enable annotations, simply add two lines of code to your plugin. Grafana uses your default query editor for editing annotation queries.
Add
"annotations": true
to the plugin.json file to let Grafana know that your plugin supports annotations.In
plugin.json
:{ "annotations": true }
In
datasource.ts
, override theannotations
property fromDataSourceApi
(orDataSourceWithBackend
for backend data sources). For the default behavior, setannotations
to an empty object.In
datasource.ts
:annotations: { }