Amazon Timestream annotations
Annotations allow you to overlay event information on graphs, providing context for metric changes. The Amazon Timestream data source supports annotation queries that pull event data directly from your Timestream tables.
For general information about annotations in Grafana, refer to Annotate visualizations.
Before you begin
- Configure the Amazon Timestream data source.
- Verify that your Timestream table contains event data with a timestamp column.
Create an annotation query
To add a Timestream annotation to a dashboard:
- Click Dashboard settings (gear icon).
- Click Annotations.
- Click Add annotation query.
- Select your Amazon Timestream data source.
- Enter a SQL query that returns the required columns.
- Click Apply.
Required columns
Your annotation query must return at least a time column. Grafana automatically maps the following column names to annotation properties.
Annotation query examples
The following examples demonstrate common annotation query patterns. Annotation queries support the same macros and template variables as regular queries.
Mark point-in-time events
The following query retrieves deployment events and displays them as point annotations:
SELECT
time,
measure_value::varchar AS text
FROM $__database.deployment_events
WHERE $__timeFilter
AND measure_name = 'deployment'
ORDER BY time ASCCategorize annotations with tags
Add a tags column to categorize annotations and filter them in the dashboard:
SELECT
time,
measure_value::varchar AS text,
environment AS tags
FROM $__database.deployment_events
WHERE $__timeFilter
AND measure_name = 'deployment'
ORDER BY time ASCMark time ranges
Use timeEnd to create range annotations that highlight a span of time, such as a maintenance window:
SELECT
time,
timeEnd,
measure_value::varchar AS text
FROM $__database.maintenance_windows
WHERE $__timeFilter
AND measure_name = 'maintenance'
ORDER BY time ASC

