Plugins doc review chunk 2 (#67691)
* Doc style edit for 7 topics
Signed-off-by: Joe Perez <joseph.perez@grafana.com>
* Proofread topics
Signed-off-by: Joe Perez <joseph.perez@grafana.com>
* Prettier
Signed-off-by: Joe Perez <joseph.perez@grafana.com>
* Doc fix
Signed-off-by: Joe Perez <joseph.perez@grafana.com>
* Update docs/sources/developers/plugins/add-query-editor-help.md
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
* Doc fixes
Signed-off-by: Joe Perez <joseph.perez@grafana.com>
* Changes from doc review
Signed-off-by: Joe Perez <joseph.perez@grafana.com>
* Incorporate review feedback
Signed-off-by: Joe Perez <joseph.perez@grafana.com>
* More fixes
Signed-off-by: Joe Perez <joseph.perez@grafana.com>
* More doc fixes
Signed-off-by: Joe Perez <joseph.perez@grafana.com>
---------
Signed-off-by: Joe Perez <joseph.perez@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
(cherry picked from commit 49a18bc8e2)
Co-authored-by: Joseph Perez <45749060+josmperez@users.noreply.github.com>
1.0 KiB
title
| title |
|---|
| Add support for annotations |
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]({{< relref "../../dashboards/build-dashboards/annotate-visualizations/#querying-other-data-sources " >}}) 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": trueto the [plugin.json]({{< relref "metadata/" >}}) file to let Grafana know that your plugin supports annotations.In
plugin.json:{ "annotations": true } -
In
datasource.ts, override theannotationsproperty fromDataSourceApi(orDataSourceWithBackendfor backend data sources). For the default behavior, setannotationsto an empty object.In
datasource.ts:annotations: { }