Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Monitoring

Goal

Connect Prometheus and Grafana to AngaraBase metrics and get a working dashboard for ops/triage monitoring.

Prerequisites

  • Running angarabase-server (see Quickstart)
  • Access to the AngaraBase metrics listener (ANGARABASE_METRICS_ADDR)
  • Running Prometheus instance
  • Running Grafana instance

Step 1: enable the metrics endpoint

Set the listener address in the config file:

[ops]
metrics_addr = "127.0.0.1:9898"

Or use the environment variable override (takes precedence over config):

export ANGARABASE_METRICS_ADDR=127.0.0.1:9898
angarabase-server --config /etc/angarabase/angarabase.conf

Verify the endpoint responds:

curl -sS http://127.0.0.1:9898/metrics | rg '^angarabase_' -m 5
curl -sS http://127.0.0.1:9898/health/live
curl -sS http://127.0.0.1:9898/health/ready
curl -sS http://127.0.0.1:9898/health/startup

See Configuration — Ops knobs for the full [ops] section reference.

OpenTelemetry tracing

AngaraBase also exposes opt-in OTel-style span export for query lifecycle triage.

Minimal setup example:

export ANGARABASE_OTEL_ENABLED=1
export ANGARABASE_OTEL_EXPORTER=file
export ANGARABASE_OTEL_ENDPOINT=artifacts/otel/spans.jsonl
export ANGARABASE_OTEL_SAMPLE_RATE_PPM=1000000

Spans are emitted for bounded stage names (accept, auth, session, parse, plan, execute, storage_io, commit/rollback) and are intended for diagnostics evidence, not for raw SQL capture.

Step 2: configure the Prometheus scrape

Add a job to prometheus.yml:

scrape_configs:
 - job_name: angarabase
 scrape_interval: 15s
 metrics_path: /metrics
 static_configs:
 - targets: ["127.0.0.1:9898"]

Restart Prometheus and verify in the UI (/targets) that the angarabase target is UP.

Step 3: add the Prometheus data source in Grafana

  1. Open the Grafana UI.
  2. Navigate to Connections → Data sources.
  3. Add Prometheus.
  4. Set the URL to your Prometheus instance (e.g., http://127.0.0.1:9090).
  5. Click Save & test and confirm the connection succeeds.

Step 4: import the AngaraBase dashboard

  1. Go to Dashboards → New → Import.
  2. Upload the file tools/observability/grafana/angarabase-overview-v2.json.
  3. Select the Prometheus data source added in the previous step.
  4. Save the dashboard.

Alternative — download the JSON directly from the server:

curl -fsS http://127.0.0.1:9898/grafana/angarabase-overview.json -o angarabase-overview.json

Then import angarabase-overview.json in Grafana.

Expected result

After import, the dashboard should display the following panels:

PanelKey metric(s)
QPSangarabase_queries_total
Query latency p50/p95/p99histogram buckets
Slow query countangarabase_slow_query_total
Active connectionsgauge
TPS / commit latencyangarabase_commits_total
Lock contentionlock wait counters
Buffer pool pressureangarabase_buffer_pool_hit_total, angarabase_buffer_pool_miss_total
BRIN range efficiencyangara_brin_range_efficiency
Mutation policy rejectionsangara_table_no_delete_rejected_*, angara_table_mutation_epoch
WAL lag / fsync latencyWAL counters
IO latency / checkpoint / GC pressureIO counters

If panels are empty, see Troubleshooting below.

Troubleshooting

No data in panels

  • Check http://<prometheus>/targets: the angarabase target must be UP.
  • Ensure ANGARABASE_METRICS_ADDR matches the targets value in Prometheus.
  • Verify metrics use the angarabase_ prefix:
curl -sS http://127.0.0.1:9898/metrics | rg '^angarabase_' -m 20

Data source test fails in Grafana

  • Verify the data source URL and network reachability from Grafana to Prometheus.
  • For Docker/K8s use the service DNS/hostname (not 127.0.0.1) when Grafana and Prometheus run in different containers.

Readiness probe is not ready

  • GET /health/ready returns a reason in JSON — this is the primary triage signal.
  • Collect a diagnostics bundle and attach summary.json:
tools/diagnostics_bundle/run.sh \
 --root artifacts/diagnostics/<incident-id> \
 --config <path> \
 --metrics-url http://<metrics-host>/metrics
  • Dashboard JSON: tools/observability/grafana/angarabase-overview-v2.json
  • Dashboard JSON from server: GET /grafana/angarabase-overview.json (on ANGARABASE_METRICS_ADDR / [ops].metrics_addr)
  • Dashboard import guide: tools/observability/README.md
  • Operator runbook (metrics + probes): Troubleshooting guide
  • Metrics checklist (contract): Observability metrics checklist
  • Configuration reference: Configuration
  • Support flow: Support