Flow insights
Six read-only views derived from the flows Paqtra already stores. They answer
questions the flow list cannot: is an SLO being burned right now, which edges
are failing and why, what a Hubble labelsContext would cost in Prometheus,
how to hand flows to an OpenTelemetry collector, what changed since a baseline, and which sources are probing many targets.
All of them read the flow store, honour namespace scoping and rate limits like
the other /api/v1/flows reads, and change nothing in the cluster. They do not
read Hubble, touch Cilium, or feed policy apply. Research and rationale:
RESEARCH.md.
A shared caveat: flows reach Paqtra by polling Hubble, so every ratio below is over the sampled flows, not every request. Each response says so.
Parameters shared by the flow-history views
| Parameter | Meaning |
|---|---|
from, to | RFC 3339 range, to exclusive. Default: the hour before now. At most 30 days. |
namespace | Either side is in this namespace. |
pod, port, verdict | As for /api/v1/flows/history. |
Every response carries range, coverage (how far back the store goes) and
capture (how flows were collected), the same as /api/v1/flows/history.
SLO burn rate
GET /api/v1/slo/targets/{id}/burn-rate, CLI paqtra flows burn-rate <id>,
MCP paqtra_slo_burn_rate.
The SLO list shows a status projected from the latest flow sample. Burn rate measures the error budget being spent over real windows of stored history. Burn rate is the error ratio (dropped / (forwarded + dropped)) divided by the error budget (1 - target). The tiers are the Google SRE Workbook's recommendation (chapter 5, table 5-8):
| Severity | Long window | Short window | Burn rate | Budget used at threshold (30 d SLO) |
|---|---|---|---|---|
| page | 1 h | 5 min | 14.4 | 2% |
| page | 6 h | 30 min | 6 | 5% |
| ticket | 3 d | 6 h | 1 | 10% |
budget_lasts_hours on each evaluated tier says how long a full, untouched
error budget would last at that tier's long-window burn rate (36 hours at 20x
for a 30-day SLO); it is null when nothing burns.
A tier fires only when both its windows exceed the threshold, so a recovered
incident stops alerting as soon as the short window is clean. status is
page, ticket, ok or insufficient_data.
Honesty rules:
- A window the stored history does not fully reach back over is not judged:
its tier is
insufficient_history. A fresh install cannot page on 3 days. - A window with fewer than 20 judged flows is
insufficient_data, notok. - Window edges snap to 5-minute buckets. Buckets dated in the future (clock skew) are ignored.
- Other verdicts (audit, traced, redirected) are not judged.
- It reports; it never applies policy or silences anything.
Service edges with golden signals
GET /api/v1/flows/history/edges?granularity=workload&max_edges=200, CLI
paqtra flows edges, MCP paqtra_flow_edges.
Who talks to whom, per edge (source, destination, protocol): flows, flows per
second, forwarded / dropped counts, drop ratio, the top three Cilium drop
reasons and the busiest ports; and per service the inbound and outbound drop
ratio. granularity is namespace, workload (default; the owner name
guessed from the pod name, so replicas of a Deployment, DaemonSet or
StatefulSet are one node) or pod.
Latency and saturation are not in L3/L4 flow records and are not guessed:
not_measured says so. A drop ratio is Cilium dropping flows, not an
application error over a forwarded connection.
Bounded by design, so a scan cannot blow up the answer:
- The store groups in SQL and returns at most 50,000 groups, busiest first;
truncated: truemeans quieter ones were left out and counts are lower bounds. - At most
max_edges(1 to 1000) edges and services are listed; the rest are added up infoldedso totals still reconcile. - Endpoints with no namespace or pod (world, host, kube-apiserver) become one
node,
external; their IPs are never node names. - Per edge only the top ports are listed, with
port_countshowing how many distinct ports were seen (a port scan is visible, not enumerated). - Labels are cut to 253 characters, control characters removed, protocol names reduced to a short alphanumeric label.
Hubble metric cardinality advisor
GET /api/v1/flows/history/cardinality?budget=20000, CLI paqtra flows cardinality, MCP paqtra_metric_cardinality.
Hubble's flow handler exposes hubble_flows_processed_total{protocol, type, subtype, verdict} and the drop handler hubble_drop_total{reason, protocol}; labelsContext adds source and destination labels
(Cilium metrics docs).
Each distinct combination is a Prometheus series. The advisor counts, from the
flows in the range, how many series each choice would have produced:
| Context | labelsContext |
|---|---|
| none | (empty) |
| namespace | source_namespace,destination_namespace |
| workload | source_namespace,source_workload,destination_namespace,destination_workload |
| pod | source_namespace,source_pod,destination_namespace,destination_pod |
Each context gets a risk (low under a quarter of the budget, ok, high
over budget, extreme over ten times), and recommended names the most
detailed context that fits. budget is the series you can afford for the two
handlers together (100 to 10,000,000, default 20,000).
Read the figures as follows:
- The
flowhandler also splits bytypeandsubtype, which flow records do not carry: its count is a lower bound. - IP contexts are not offered; they have at least as many series as pod contexts.
- Hubble removes series tied to a deleted pod a minute later, so live pod series follow the pods running now; the advisor's count covers every pod seen in the range and is an upper bound for that context.
- The advisor suggests; it does not change Cilium or Hubble configuration.
OpenTelemetry log export
GET /api/v1/flows/history/otlp?limit=1000, MCP paqtra_flows_otlp.
Returns { range, records, skipped_no_timestamp, limit, otlp } where otlp is
an OTLP/JSON logs document (resourceLogs with one resource per cluster:
service.name=paqtra, k8s.cluster.name). Each flow is one log record,
newest first, at most 1000:
| Attribute | From |
|---|---|
source.address, destination.address | flow IPs, only when they parse as IP addresses |
network.type | ipv4 or ipv6 from the source address |
destination.port | flow port, when non-zero |
network.transport | tcp or udp; other protocols are left to paqtra.protocol |
k8s.src.namespace, k8s.src.name, k8s.src.owner.name (and dst) | pod and namespace; owner name is the workload guess |
cilium.verdict, cilium.drop_reason | Cilium verdict and, for drops, its reason |
paqtra.protocol, paqtra.flow.id | raw protocol and flow id |
Dropped flows have severity WARN (13), the rest INFO (9). Flows without a
usable timestamp are skipped and counted. Paqtra sends nothing: feed the
document to a collector (for example with the otlpjson receiver) or POST it
to an OTLP/HTTP logs endpoint yourself. network.* and source.* /
destination.* follow OpenTelemetry semantic conventions; the k8s.src.* names
follow Grafana Beyla's network flow metric; cilium.* and paqtra.* are
Paqtra's own.
What changed between two windows
GET /api/v1/flows/history/diff, CLI paqtra flows diff, MCP
paqtra_flow_diff.
Compares the requested window with a baseline, edge by edge (source, destination, protocol), and reports:
new_edges: present now, absent in the baseline, with flows, drops and distinct port count.gone_edges: present in the baseline, absent now.drop_regressions: the drop ratio rose by at least 5 points (absolute) and there are at least 5 drops now. Edges that were already bad are not repeated.rate_changes: flows per second moved by 3x or more (either way), with at least 20 flows in both windows. Rates are per second, so windows of different length compare fairly.
The baseline is the window of the same length that ends where the requested
one starts. Give baseline_from and baseline_to together to pick another
one, for example the same hour last week; it must not overlap the requested
range. granularity (namespace, workload default, pod) works as for
edges, so a rolling deploy at workload level does not make every replica a new
edge. max_items (1 to 1000, default 100) caps each list; counts always has
the true totals and omitted how many are not listed.
Honesty rules, repeated in warnings when they apply:
- A baseline that starts before the oldest stored flow cannot show what was absent, so "new" edges may only be missing from history.
- When either window had more groups than the 50,000 read, the quietest edges were left out and new/gone edges near the bottom can be artefacts.
- The thresholds used are returned under
thresholds.
Fan-out and scan suspects
GET /api/v1/flows/history/fanout, CLI paqtra flows fanout, MCP
paqtra_flow_fanout.
Ranks sources by how many distinct destinations they reached, and how many
distinct ports on a single destination. A source is listed from min_targets
(default 20, 2 to 100,000) in either dimension, and is a suspect when
Cilium also dropped at least min_drop_ratio (default 0.3) of its judged
flows: probing targets you are not allowed to reach is mostly denied. Each
entry carries the evidence (reasons, widest_destination, a few
sample_destinations). granularity defaults to pod; limit caps the list
(1 to 1000, default 50).
It is a heuristic over sampled L3/L4 flows. A scraper or health checker with
healthy traffic is listed but not a suspect. Endpoints outside the cluster are
a single external node whose addresses are not kept, so external sources are
not measured. It notifies; it never blocks or applies policy.
Drops by cause
GET /api/v1/flows/history/drops, CLI paqtra flows drops, MCP paqtra_flow_drops.
Groups Cilium's drop reasons into a class and lists the edges behind each:
policy (a decision: policy denied, denylist, authentication required),
datapath_capacity (conntrack or NAT map insertion failures: the datapath ran
out of room and editing policy will not help), invalid_packet,
routing_or_service (unroutable IP, missing tunnel, backend not found, TTL) and
other / unspecified. classes gives the shares, reasons the ranked
reasons with their top three edges (max_reasons 1 to 200, default 20; the rest
is summed in omitted_reasons). The class is read from the reason text, so it
is a reading aid, not a verdict.
Top talkers
GET /api/v1/flows/history/top, CLI paqtra flows top, MCP paqtra_flow_top.
Three rankings over the window: sources, destinations and protocol/port, each
with flows, share of all flows and dropped share. Flow records carry no byte
counts, so this ranks flow count, not bandwidth. limit 1 to 100 (default 10);
other_flows sums what was not listed and distinct counts every name seen.
Policy audit readiness
GET /api/v1/flows/history/audit, CLI paqtra flows audit, MCP
paqtra_policy_audit.
With Cilium policy audit mode on, traffic a policy would drop is allowed and
reported with the AUDIT verdict. This lists those edges and ports worst first,
and which destination namespaces would be hit, so default deny can be rolled
out by reading what it would break. The verdict filter is fixed to AUDIT
whatever is passed. An empty result means audit mode is off, or nothing would
be denied; the reply says to check policyAuditMode before reading it as
safe. Nothing is changed: draft the allow rules with the policy builder and
simulator. max_items 1 to 1000 (default 50).
Drop spikes
GET /api/v1/flows/history/spikes, CLI paqtra flows spikes, MCP
paqtra_drop_spikes.
Finds episodes where dropped flows per time bucket sit well above the window's
own typical level: threshold = median + sensitivity x 1.4826 x MAD (1 to 20,
default 3), never below min_drops (default 10). Adjacent spiking buckets are
one episode with start, end, drops and peak; an episode list is capped at 50
(episodes_total has the count). Fewer than 8 buckets is insufficient_data.
bucket_secs as for the timeline. A window that is mostly spike has no quiet
baseline to compare with. Notifies only.
CLI
paqtra flows edges --namespace prod --granularity workload --max-edges 30
paqtra flows cardinality --budget 50000 --from 2026-11-20T00:00:00Z
paqtra flows burn-rate slo-1a2b3c4d
paqtra flows diff --namespace prod --granularity workload
paqtra flows diff --baseline-from 2026-11-17T09:00:00Z --baseline-to 2026-11-17T10:00:00Z
paqtra flows fanout --min-targets 15 --min-drop-ratio 0.5
paqtra flows drops --namespace prod
paqtra flows top --granularity namespace --limit 5
paqtra flows audit --namespace prod
paqtra flows spikes --bucket-secs 300 --sensitivity 4
paqtra flows edges -o json # the API reply
--api / PAQTRA_API_URL and --api-token / PAQTRA_API_TOKEN select the
API, as for paqtra metrics.