Enterprise Grafana Cloud
Last reviewed: August 18, 2026

Snowflake annotations

Annotations in Grafana allow you to overlay event data on your graphs, making it easier to correlate metrics with specific events such as query failures, warehouse scaling, or data loading operations. For an overview of annotations, refer to Annotate visualizations.

Before you begin

  • Ensure you have configured the Snowflake data source.
  • Your dashboard must already be saved before creating annotations.
  • Annotations only work with the following visualization types: time series, state timeline, and candlestick.

Annotation query format

Your annotation query must return at least a time column. Optional columns include:

ColumnDescription
timeRequired. The timestamp for the annotation.
timeEndOptional. End time for region annotations (creates a highlighted range).
titleOptional. Short text displayed on the annotation marker.
textOptional. Detailed description shown in the tooltip.
tagsOptional. Comma-separated tags for filtering annotations.

To limit results to the dashboard time range, use the $__timeFilter macro in your WHERE clause. For more information, refer to Macros.

Create an annotation

To create an annotation query:

  1. Open your dashboard and click Dashboard settings (gear icon).
  2. Select Annotations in the left menu.
  3. Click Add annotation query.
  4. Select your Snowflake data source.
  5. Enter your SQL query.
  6. Click Save dashboard.

Annotation examples

The following examples show common annotation patterns for Snowflake. They use the $__timeFilter macro to limit results to the dashboard time range.

Note

These examples query the SNOWFLAKE.ACCOUNT_USAGE schema. Access to these views requires the ACCOUNTADMIN role, or a role that has been granted the IMPORTED PRIVILEGES privilege on the SNOWFLAKE database. For more information, refer to Enabling the SNOWFLAKE database usage for other roles.

Track failed queries

Show when queries have failed to help correlate with performance issues:

SQL
SELECT 
  start_time AS time,
  CONCAT('Query Failed: ', query_type) AS title,
  CONCAT('Error: ', error_message, '\nWarehouse: ', warehouse_name, 
    '\nUser: ', user_name) AS text,
  'query-failure,error' AS tags
FROM snowflake.account_usage.query_history
WHERE $__timeFilter(start_time)
  AND execution_status = 'FAIL'
ORDER BY start_time

Track warehouse scaling events

Monitor when warehouses scale up or down:

SQL
SELECT 
  timestamp AS time,
  CONCAT('Warehouse: ', warehouse_name) AS title,
  CONCAT('Event: ', event_name, 
    '\nCluster number: ', cluster_number) AS text,
  CONCAT('warehouse,', warehouse_name) AS tags
FROM snowflake.account_usage.warehouse_events_history
WHERE $__timeFilter(timestamp)
  AND event_name IN ('RESIZE_WAREHOUSE', 'RESUME_WAREHOUSE', 'SUSPEND_WAREHOUSE', 'SPINUP_CLUSTER', 'SPINDOWN_CLUSTER')
ORDER BY timestamp

Track data loading operations

Annotate when data loads complete or fail:

SQL
SELECT 
  last_load_time AS time,
  CONCAT('Load: ', table_name) AS title,
  CONCAT('Status: ', status, '\nRows loaded: ', row_count, 
    '\nFile: ', file_name) AS text,
  CASE 
    WHEN status = 'LOADED' THEN 'load-success'
    WHEN status = 'LOAD_FAILED' THEN 'load-failed,error'
    ELSE 'load-partial'
  END AS tags
FROM snowflake.account_usage.load_history
WHERE $__timeFilter(last_load_time)
ORDER BY last_load_time

Track user login events

Monitor authentication events for security visibility:

SQL
SELECT 
  event_timestamp AS time,
  CONCAT('Login: ', user_name) AS title,
  CONCAT('Client: ', client_ip, '\nAuth method: ', first_authentication_factor,
    '\nStatus: ', is_success) AS text,
  CASE 
    WHEN is_success = 'YES' THEN 'login-success'
    ELSE 'login-failed,security'
  END AS tags
FROM snowflake.account_usage.login_history
WHERE $__timeFilter(event_timestamp)
ORDER BY event_timestamp

Track task executions

Monitor scheduled task completions and failures:

SQL
SELECT 
  scheduled_time AS time,
  query_start_time AS timeEnd,
  CONCAT('Task: ', name) AS title,
  CONCAT('Database: ', database_name, '.', schema_name, 
    '\nState: ', state, '\nDuration: ', 
    DATEDIFF('second', query_start_time, completed_time), 's') AS text,
  CASE 
    WHEN state = 'SUCCEEDED' THEN 'task-success'
    WHEN state = 'FAILED' THEN 'task-failed,error'
    ELSE 'task-skipped'
  END AS tags
FROM snowflake.account_usage.task_history
WHERE $__timeFilter(scheduled_time)
ORDER BY scheduled_time

Annotation display

After you configure the annotation query, annotations appear as:

  • Vertical lines on your time series, candlestick, or state timeline panels
  • At the timestamp specified in your query
  • With hover tooltips showing the title and detailed text
  • Filterable by tags (such as query-failure or warehouse)

Next steps