Skip to content

Metrics

Metrics is the performance and health view for a project: how many requests it served, how many errored, how fast it responded, and how much bandwidth it moved. Metrics are captured server-side by the PandaStack gateway — there is no client SDK to install and no code change to your app.

  • Every request that reaches a project is logged by the gateway / Kong / proxy into ClickHouse (the pandastack.request_events table). Your application does nothing.
  • Metrics are per-project. Before any ClickHouse query runs, the project is resolved and ownership-checked in Postgres, and the ClickHouse query is filtered by the resolved project name — so you can only ever read metrics for projects your organization owns.
  • Metrics fail open. If ClickHouse is not configured or is unreachable, every endpoint returns an empty shape with enabled: false rather than throwing. Treat enabled: false as “no data source”, not “zero traffic”.

Every metrics query takes a range, each with a matching bucket width for time-series data:

rangeWindowBucket width
1h1 hourPer-minute
24h24 hours10-minute
7d7 daysHourly
30d30 days6-hour

The default range is 24h.

The metrics summary reports headline numbers for the selected range:

FieldMeaning
requestsTotal requests served.
errorsRequests with status ≥ 500.
error_rateError percentage (0–100).
latency_ms.p50 / p95 / p99Latency percentiles (computed with quantileTDigest over latency_ms).
latency_ms.avgAverage latency (ms).
bandwidth_bytesTotal bytes out (sum of bytes_out).
unique_visitorsDistinct visitors (uniqExact over visitor_hash).
rpsRequests per second.
enabledfalse when ClickHouse is unavailable.

The time-series endpoint returns one point per bucket for the range. Values are densified onto a fixed grid so charts render cleanly:

  • Counts (requests, errors, bytes_out) zero-fill empty buckets, so the area chart draws down to the baseline.
  • p95 latency null-fills empty buckets, so the line bridges gaps instead of dropping to zero.

Each MetricsPoint has a bucket timestamp t plus requests, errors, p95, and bytes_out (each nullable).

The breakdown endpoint slices traffic for the range:

BreakdownFields
Top pathspath, requests, and per-path p95 latency.
Status codesstatus, requests.
Top countriescountry, requests.

The projects list shows a small 24-hour request sparkline per project. These are produced by a single batched, hourly ClickHouse query across all of the organization’s projects at once — each sparkline reports a 24h request total plus per-hour requests and errors points.

Metrics answers “how is this service performing?”. Analytics answers “who is visiting?”. Both read from the same ClickHouse event log, captured the same server-side way, but they surface different dimensions and have different gating. If you want visitor geography, referrers, browsers, and devices, see Analytics.