# Add support for annotation queries

[View as Markdown](https://grafana.com/developers/plugin-tools/how-to-guides/data-source-plugins/add-support-for-annotation-queries)

You can add support to your plugin for annotation queries that will insert information into Grafana alerts. This guide explains how to add support for [annotation queries](https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/) to a data source plugin.

## Support annotation queries in your data source plugin[​](#support-annotation-queries-in-your-data-source-plugin "Direct link to Support annotation queries 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.

1. Add `"annotations": true` to the [plugin.json](https://grafana.com/developers/plugin-tools/reference/plugin-json.md) file to let Grafana know that your plugin supports annotations.

   src/plugin.json

   ```json
   {
     "annotations": true
   }

   ```

2. In `datasource.ts`, override the `annotations` property from `DataSourceApi` (or `DataSourceWithBackend` for backend data sources). For the default behavior, set `annotations` to an empty object.

   src/datasource.ts

   ```ts
   annotations: {
   }

   ```
