Database guides

Prometheus

Updated 2026-08-01 · 3 min read

PromQL in a real editor, with a range-query directive that turns any expression into a chart.

AddisDB queries Prometheus over its HTTP API. An expression runs as an instant query by default; add a range directive and it becomes a range query, returning a matrix of timestamped points that lands straight on the chart.

Who it is for

Prometheus is the standard for infrastructure and application metrics in the Kubernetes world. It scrapes targets on an interval, stores time-series locally, and gives you PromQL — a query language built specifically for rates, aggregations and alerting over metrics.

A series is a metric name plus a set of labels, and every distinct label combination is its own series. That is the whole cost model: adding a label with unbounded values — a user id, a request id — multiplies the series count and is the classic way to bring a Prometheus server down.

You are here because your services expose metrics and Prometheus collects them, and you want to explore those metrics somewhere other than a Grafana panel.

Set up access

  1. Note your Prometheus server URL — the default port is 9090.
  2. In Kubernetes, port-forward to reach it locally: kubectl port-forward svc/prometheus 9090:9090.
  3. If Prometheus is behind a reverse proxy with basic auth, have those credentials ready.
  4. Confirm it responds: curl http://localhost:9090/api/v1/query?query=up.
# Reach an in-cluster Prometheus from your laptop
kubectl port-forward -n monitoring svc/prometheus-operated 9090:9090

Connect from AddisDB

  1. New Connection → Prometheus under Timeseries. Port prefills to 9090.
  2. Enter the host. Leave username and password blank unless a proxy in front of Prometheus requires them.
  3. Test, then Save.

Instant and range queries

Append @range with a duration — and optionally a step — to run a range query ending now. That is what produces a line you can actually read.

# Instant: the current value
up{job="api"}

# Range: the last hour at 30-second resolution
rate(http_requests_total[5m]) @range 1h 30s

Two rules cover most PromQL mistakes. Counters must be wrapped in rate() or increase() before they mean anything — the raw value only ever goes up and resets on restart. And the window inside the brackets should be at least four times your scrape interval, or a rate can be computed from too few samples to be meaningful.

# Error ratio per service, over five-minute windows
sum by (service) (rate(http_requests_total{status=~"5.."}[5m]))
  /
sum by (service) (rate(http_requests_total[5m])) @range 6h 1m

histogram_quantile over a _bucket series is how latency percentiles are computed; averaging a histogram gives you a number that is not any percentile at all.

What AddisDB gives you

  • Metric names listed in the sidebar so you can discover what the server actually holds.
  • Series labels flattened into columns, with a timestamp and a numeric value — the shape the Chart view picks up as a time series automatically.
  • A connection that is read-only by construction: PromQL has no write or DDL path, so nothing can be changed through it.
  • Query tabs and history, so a PromQL expression you worked out once is still there next month.
  • ⌘K search across every connection, Prometheus included.
A PromQL range query rendered as a line chart in AddisDB.