TestData annotations
The TestData data source can generate simulated annotation events. Use it to test how dashboards and panels render annotation markers and overlays without connecting to an external source. The generated events are created in the browser and aren't persisted.
Before you begin
- Configure the TestData data source.
- Familiarize yourself with annotations in Grafana.
Add an annotation query
To add a dashboard annotation query that uses TestData:
TestData distributes the generated events evenly across the current dashboard time range. Each event includes sample text with a link and the tags text and server.
Use the Annotations scenario in a panel
You can also generate annotation data as a panel query using the Annotations scenario. This scenario returns data on the annotations data topic, so Grafana renders the events as markers overlaid on the panel rather than plotting them as a series.
Because the Annotations scenario doesn't return a visible series on its own, add a second query that returns data to give the markers something to overlay:
- Add or edit a panel and select the TestData data source.
- On the first query, choose a scenario that returns a series, such as Random Walk, from the Scenario drop-down.
- Add a second query, then choose the Annotations scenario from its Scenario drop-down.
- Set the Count field on the Annotations query to the number of events you want to generate. Default:
10. - Click Run queries.
Grafana plots the series from the first query and overlays the annotation markers on top. If you run the Annotations scenario by itself, the query returns annotation events but the panel doesn't display a visible series.
For a reference of all TestData scenarios, refer to the TestData query editor.
Example: Overlay annotations on a time series panel
This example creates a time series panel with simulated data, then adds a TestData annotation query so you can verify how the panel renders annotation markers.
Grafana draws five vertical annotation markers evenly across the time range on the time series panel. Hover over a marker to see the sample text and tags. Adjust the Count field to change how many markers appear.
{{< admonition type="tip" >}}
To test how a panel handles crowded overlays, increase the Count field to a high value, such as 100. This produces many closely spaced markers, which is useful for checking marker rendering and tooltip behavior at high density.
{{< /admonition >}}
Limitations
- Events are synthetic. TestData generates fixed sample text and tags. You can't customize the event content.
- Events aren't persisted. The data source builds events in the browser each time the query runs. TestData doesn't store annotations or query an external source.
- Not evaluated by the alerting engine. The Annotations scenario runs in the browser, so it can't be used with Grafana Alerting or in any context that requires server-side evaluation.
谢谢你的反馈!