grafana/docs/sources/developers/plugins/add-support-for-annotations.md
Christopher Moyer a568d421f8
Docs: Setup refactor (#49739)
* builds out refactored setup topics

* Automatically fix some relrefs with mv-manager

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Use refs for tutorials content which is outside of this repository

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Manually fix complicated relrefs

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* consolidates team sync and db encryption topics

* Fix relrefs

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* updates setup index file

* Convert TOML to YAML

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add current alias for new alerting content

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Add current aliases to new setup-grafana and configure-security pages

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Update docs/sources/setup-grafana/configure-grafana/_index.md

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* moves saml docs, updates order in TOC

* Manually fix relrefs

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* added usage insights topics, adjusted weights

* corrected relrefs

* Fix relrefs broken in rebase

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2022-06-02 11:57:22 -05:00

1.4 KiB

aliases title
/docs/grafana/latest/developers/plugins/add-support-for-annotations/
Add support for annotations

Add support for annotations

This guide explains how to add support for [annotations]({{< relref "../../dashboards/annotations/" >}}) to an existing data source plugin.

This guide assumes that you're already familiar with how to [Build a data source plugin]({{< ref "/tutorials/build-a-data-source-plugin/" >}}).

Note: Annotation support for React plugins was released in Grafana 7.2. To support earlier versions, refer to the Add support for annotation for Grafana 7.1.

Add annotations support to your data source

To enable annotation support for your data source, add the following two lines of code. Grafana uses your default query editor for editing annotation queries.

  1. Add "annotations": true to the [plugin.json]({{< relref "metadata/" >}}) file to let Grafana know that your plugin supports annotations.

    plugin.json

    {
      "annotations": true
    }
    
  2. In datasource.ts, override the annotations property from DataSourceApi (or DataSourceWithBackend for backend data sources). For the default behavior, you can set annotations to an empty object.

    datasource.ts

    annotations: {
    }