Grafana Integration
Point Grafana at Chronix as a Prometheus data source, import the bundled dashboards, and query with PromQL or Flight SQL.
Chronix integrates natively with Grafana through multiple data source types. This guide covers setup, dashboard provisioning, and best practices.
Data Source Options
| Data Source | Protocol | Best For |
|---|---|---|
| Prometheus | HTTP (PromQL) | Real-time metrics, alerting |
| Flight SQL | gRPC (Arrow) | High-throughput analytics, large result sets |
| Infinity | HTTP REST | Custom JSON queries, admin views |
1. Prometheus Data Source (Recommended)
Chronix serves the Prometheus HTTP API at the paths a Prometheus client derives from a base URL, so the data source needs nothing but the server's address.
Add Data Source
- Navigate to Grafana → Connections → Data Sources → Add data source
- Select Prometheus
- Configure:
| Field | Value |
|---|---|
| URL | http://chronix.example.com:8086 |
| Access | Server (default) |
| Scrape interval | 15s |
- Click Save & Test — should show "Data source is working"
Custom Headers (Authentication)
If Chronix authentication is enabled:
- Under Custom HTTP Headers, add:
- Header:
Authorization - Value:
Bearer <your-api-key>
- Header:
For multi-tenant deployments, also add:
- Header:
X-Namespace - Value:
<namespace>
Metric names
A Chronix measurement holds several fields; a PromQL metric holds one value. The metric name is <measurement>_<field> — except that a field named value gives the measurement name alone, which is how Prometheus remote write and OTLP store a sample, so scraped metrics keep their names.
So cpu,host=a usage=42,load=0.7 is queried as cpu_usage and cpu_load, not as cpu. Adding a field to a measurement never renames the metrics already there.
The metric browser lists every stored metric. The one exception is a histogram's classic names — foo_bucket, foo_count, foo_sum — which answer when typed but are not listed, so that {__name__=~".+"} cannot return the same observations three times over.
Histogram panels
A native histogram is one metric, not a family, so a percentile needs no rate() over a bucket series:
histogram_quantile(0.99, http_latency) # native
histogram_avg(http_latency)
histogram_fraction(0, 0.25, http_latency) # share under 250 msFor a heatmap panel, query the classic view and set Format to Heatmap — Grafana reads the le labels as it always has:
http_latency_bucketPromQL Examples
# CPU usage rate per host
rate(cpu_usage{host=~"server-.*"}[5m])
# 95th percentile query latency
histogram_quantile(0.95, rate(query_duration_seconds_bucket[5m]))
# Active series count
chronix_series_count
# ingestion rate
rate(chronix_points_written_total[1m])2. Flight SQL Data Source
For analytical queries returning large Arrow tables.
Prerequisites
Install the Grafana Flight SQL plugin:
grafana-cli plugins install grafana-flightsql-datasourceConfiguration
| Field | Value |
|---|---|
| Host | chronix.example.com:8817 |
| Secure | false (or true with TLS) |
| Auth Type | none / token |
SQL Examples
-- Top 10 hosts by CPU usage in the last hour
SELECT host, AVG(usage) AS avg_usage
FROM cpu
WHERE _time > now() - INTERVAL '1 hour'
GROUP BY host
ORDER BY avg_usage DESC
LIMIT 10;
-- Rows per measurement in the last hour
SELECT COUNT(*) AS rows
FROM cpu
WHERE _time > now() - INTERVAL '1 hour';3. Pre-Built Dashboards
Chronix ships with 6 production-ready Grafana dashboards in the dashboards/ directory:
| Dashboard | File | Description |
|---|---|---|
| Cluster Overview | cluster-overview.json | Node health, Raft state, replication lag |
| Ingestion | ingestion.json | Write throughput, batch sizes, WAL depth |
| Query Performance | query-performance.json | Query and write latency percentiles, throughput, plan- and scan-cache hit ratios, segment pruning |
| Storage | storage.json | Segment counts, compaction stats, disk usage |
| Analytics | analytics.json | Forecasting models, anomaly detections |
| Signals | signals.json | Signal triggers, alert firings |
These dashboards read Chronix's own metrics, so they need a Prometheus server scraping http://<host>:8086/metrics — not the Chronix data source from section 1, which serves the series you wrote. Use both in one Grafana: section 1's data source for your data, a second one for these.
Cluster Overview needs a --features cluster build, which the default build excludes.
A metric that has never been recorded is absent from a scrape, so Grafana draws "No data". Write-path counters read 0 from startup; feature-gated panels — object-store tiering, signal channels, analytics latencies — stay empty until that feature is configured and used.
Manual Import
- Navigate to Grafana → Dashboards → Import
- Upload the JSON file from
dashboards/ - Select your Chronix Prometheus data source
- Click Import
Provisioning (Automated)
For automated deployments, use Grafana provisioning:
/etc/grafana/provisioning/datasources/chronix.yaml:
apiVersion: 1
datasources:
- name: Chronix
type: prometheus
access: proxy
url: http://chronix:8086
isDefault: true
jsonData:
httpMethod: POST
timeInterval: "15s"/etc/grafana/provisioning/dashboards/chronix.yaml:
apiVersion: 1
providers:
- name: chronix
type: file
disableDeletion: false
updateIntervalSeconds: 60
options:
path: /var/lib/grafana/dashboards/chronix
foldersFromFilesStructure: trueCopy the dashboard JSON files:
cp dashboards/*.json /var/lib/grafana/dashboards/chronix/Docker Compose Example
services:
chronix:
image: chronix:latest
ports:
- "8086:8086" # HTTP + Prometheus
- "8087:8087" # gRPC
- "8817:8817" # Flight SQL
grafana:
image: grafana/grafana:11
ports:
- "3000:3000"
volumes:
- ./dashboards:/var/lib/grafana/dashboards/chronix:ro
- ./grafana/provisioning:/etc/grafana/provisioning:ro
environment:
GF_SECURITY_ADMIN_PASSWORD: admin4. Annotations
Chronix supports Grafana annotations for overlaying events on time-series panels.
REST Endpoint
GET /api/v1/annotations?from=<start_ns>&to=<end_ns>&measurement=<name>SSE Stream
For live annotations:
GET /api/v1/annotations/streamConfigure in Grafana using the Annotations panel settings.
5. Alerting
Use Grafana Alerting with the Prometheus data source:
- Create an Alert Rule using PromQL
- Set the data source to your Chronix Prometheus source
- Configure notification channels (Slack, PagerDuty, etc.)
Example alert: CPU usage above 90% for 5 minutes
avg by (host) (rate(cpu_usage[5m])) > 0.906. CDC Live Dashboard (SSE)
Chronix supports Server-Sent Events for real-time change data capture:
GET /api/v1/cdc/streamUse the Grafana Live feature or a streaming panel plugin to display real-time writes as they happen.