Connect Grafana
Use Chronix as a Prometheus or Flight SQL data source in Grafana, import the bundled dashboards, and add annotations and alerts.
On this page
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"
![Grafana Explore with the Chronix data source selected, running avg_over_time(pv_power_w[15m]) and drawing two days of solar output](https://hupe1980.github.io/chronix/img/grafana-explore.webp)
chronixd --demo: a PromQL query answered by Chronix itself, no Prometheus in between.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 ms
For a heatmap panel, query the classic view and set Format to
Heatmap — Grafana reads the le labels as it always has:
http_latency_bucket
PromQL 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])A panel says "No data"
Open the panel's query inspector: when the query is probably misspelt, the
response's warnings name the metric or label that was meant. To see which
matcher emptied the result, run the query against /api/v1/query with
explain_empty=true:
curl -G localhost:8086/api/v1/query --data-urlencode 'explain_empty=true' --data-urlencode 'query=http_requests_total{job="api", code=~"5.."}'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
Six Grafana dashboards ship in dashboards/ and inside the binary (chronixd --export-dashboards DIR):
| Dashboard | File | Description |
|---|---|---|
| Cluster Overview | cluster-overview.json | Node health, Raft state, replication lag — for the frozen cluster tier only |
| 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 the chronixd-cluster binary; chronixd does not
emit cluster metrics.
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.

/metrics.
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: true
Copy the dashboard JSON files. Each dashboard has a Data source selector; it starts on the default Prometheus data source, so pick the one that scrapes Chronix's /metrics, or open the dashboard with ?var-datasource=<uid>:
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:13.3.1
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/stream
Configure 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/stream
Use the Grafana Live feature or a streaming panel plugin to display real-time writes as they happen.
Edit this page on GitHub · Updated