---
title: "ClickStack SQL Charting and Alerting"
description: "ClickStack now supports charts and alerts defined by arbitrary ClickHouse SQL, going beyond what predefined query builders can express."
url: "https://swe.quest/articles/clickstack-sql-charting-and-alerting-065ba971d00da162"
canonical: "https://clickhouse.com/blog/clickstack-sql-charting-and-alerting"
source: "ClickHouse"
published: "2026-05-13"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 9
tags: ["observability","sql","analytics"]
---

# ClickStack SQL Charting and Alerting

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-05-13, 9 min read, Announcement. Original: [https://clickhouse.com/blog/clickstack-sql-charting-and-alerting](https://clickhouse.com/blog/clickstack-sql-charting-and-alerting)

## Summary

ClickStack now supports charts and alerts defined by arbitrary ClickHouse SQL, going beyond what predefined query builders can express. Query parameters such as {startDateMilliseconds:Int64} and macros such as $\_\_filters and $\_\_sourceTable keep SQL charts responsive to dashboard time ranges and filters, and they mirror the ClickHouse Grafana plugin so existing queries port with little change. Worked examples use window functions to compute rolling p95 latency baselines with 3-sigma bounds, and an alert query that returns 1 when error counts exceed a 30-interval rolling mean by two standard deviations. Result columns map to timestamp, series and grouping roles by type, and alerts evaluate the final numeric column per bucket and group.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [SQL](https://swe.quest/tags/sql.md) (Languages)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)

## Prerequisites

- SQL window functions ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- observability metrics and traces ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))

## Keywords

ClickStack, ClickHouse, Grafana, PagerDuty, Incident.io

## Related posts

- [What's new in ClickStack - Aug ’26](https://swe.quest/articles/what-s-new-in-clickstack-aug-26-6426e76d49852a0f.md): ClickHouse · 2026-09-16 · Medium · 16 min read · Observability, Analytics & OLAP, LLMs
  ClickStack v2.34–v2.38 centers on dashboards: dashboard variables are now GA, letting a filter's selection be substituted into raw SQL, builder fields, Lucene and PromQL, with macros like $\_\_filter and $\_\_conditionalAll to handle empty selections and chained dropdowns.
- [What's new in ClickStack. October '25.](https://swe.quest/articles/what-s-new-in-clickstack-october-25-4616c6cec69bb526.md): ClickHouse · 2025-11-06 · Medium · 7 min read · Observability, Analytics & OLAP, Performance engineering
  ClickStack's October 2025 release brings alerting to ClickHouse Cloud, with Slack, PagerDuty and webhook integrations and both search-based and chart-based alerts.
- [What's new in ClickStack - September and October '26](https://swe.quest/articles/what-s-new-in-clickstack-september-and-october-26-a21e3a80f34a3dc9.md): ClickHouse · 2026-11-03 · Medium · 18 min read · Observability, Analytics & OLAP
  ClickStack v2.39 through v2.42 add ad hoc dashboard filters with click-to-filter from tiles, single-select and required filters, saved relative time ranges, and dashboard variables in markdown tiles.
- [What's new in ClickStack - May 2026](https://swe.quest/articles/what-s-new-in-clickstack-may-2026-9dca7663001ee0ca.md): ClickHouse · 2026-06-23 · Easy · 12 min read · Observability, Analytics & OLAP, AI agents
  ClickStack's May 2026 update focuses on making dashboards useful during investigations.
- [What's new in ClickStack - April 2026](https://swe.quest/articles/what-s-new-in-clickstack-april-2026-8ecf13fb74019726.md): ClickHouse · 2026-05-19 · Medium · 13 min read · Observability, Analytics & OLAP, SQL, Performance engineering
  ClickStack's April 2026 release adds alerts driven by arbitrary ClickHouse SQL, so rolling baselines and standard-deviation anomaly checks can be written with window functions and fire when the query returns 1.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
