This page is for the main branch. It can describe changes that are not in a release. Open the v0.1.2 documentation

Operations reference

Source: docs/operations-reference.md · Edit on GitHub

This page lists what the operator sees when Querdian runs: the result of each limit, the metrics and the spans. For the settings, read operations.md first.

In short:

  • Most limits make the request fail. The table gives the status and the reason for each limit.
  • Each request increments querdian_requests_total with a decision and a reason.
  • Each response has an X-Trace-Id header. Use it to find the spans of the request.

Limits and what happens when they trip#

The configurable limits are in operations.md.

LimitValueTrips whenClient seesdecision / reason
limits.maxPolicyTerms16the simplified policy of the user has more terms403 forbiddendeny / policy_too_complex
policy input (fixed)4096 terms, 32768 matchers, 1 MiB of matcher text, a fixed budget of simplification steps, a weight of 32768 after the simplificationthe matched rules of the request are larger before the simplification, the simplification needs more steps, or the simplified policy is larger403 forbiddendeny / policy_too_complex
limits.maxRequestRegexWeightweight 131072the request regex weight (see operations.md; policy weight: policy-guide.md) is larger403 forbiddendeny / query_too_complex
client regex bytes (fixed)8 KiB for each regex, 32 KiB for all regexes of a querya client regex is longer403 forbiddendeny / query_too_complex
limits.maxQueryRegexWeightweight 32768the regexes of a PromQL or LogQL query (all match[] values together) are larger403 forbiddendeny / query_too_complex
policy size (fixed)see policy-guide.mda policy has too many rules, matchers or subjects, or too long stringsthe CRD rejects it; a stored object grants nothingstatus reason PolicyTooLarge
limits.maxFanout16the plan needs more upstream requests (terms for a fan-out; it also guards a plan without requests)403 forbiddendeny / query_too_complex
limits.maxMergeBytes64 MiBthe buffered bodies of the fan-out are larger; also the trace-by-ID filter body and the Tempo search body502, errorType merge_too_large (fan-out) or upstreamerror / upstream_error
limits.maxInflightMergeBytes64 MiBthe buffered fan-out bodies of all concurrent requests of the replica are larger (the oldest fan-out that still reads waits instead)503 unavailable with Retry-Aftererror / merge_budget_exhausted
limits.upstreamTimeout5mthe proxied request runs longer502 upstream (or a truncated stream if the headers were sent)error / upstream_error
selector copies (fixed)2048PromQL or-lift: selectors x terms403 forbiddendeny / query_too_complex
match[] expansion (fixed)256Prometheus metadata: user selectors x terms403 forbiddendeny / query_too_complex
form body (fixed)1 MiBthe POST body is larger400 bad_datadeny / bad_request
labels/series response filter (fixed)16 MiBthe Prometheus labels/series body when Querdian filters denied labels502error / upstream_error
tail frame (fixed)4 MiBa single upstream tail framethe tail closes with an errorn/a (after upgrade)
tail dedupe memory (fixed)10 000 entriesQuerdian forgets the oldest entries; then duplicates are possiblen/an/a
parser nesting (fixed)100 levelsLogQL or TraceQL nesting is deeper400 bad_datadeny / parse_error

If a branch of a fan-out fails upstream, the whole request fails with 502, also when only one branch fails. The message has the upstream status and the first 256 bytes of its error body. If the policy of the caller redacts labels, Querdian withholds the body (see the threat model).

Metrics#

Served on the management port. The label endpoint is the route template (for example /api/v1/label/:name/values), never the raw path. Unknown paths use unknown.

MetricTypeLabelsNotes
querdian_requests_totalcounterbackend, endpoint, decision, reasondecision is allow, deny or error. The reasons are in troubleshooting.md.
querdian_request_duration_secondshistogram (native and classic, exemplars)backend, endpoint, decisionExemplar trace_id for sampled requests. Scrape with exemplar support (OpenMetrics).
querdian_upstream_requests_totalcounterbackend, codecode is the HTTP status, or error for transport failures. One increment for each upstream request, so a fan-out counts more than one.
querdian_upstream_duration_secondshistogram (native and classic, exemplars)backendTime until the response headers.
querdian_rewrite_duration_secondshistogramlanguage (promql, logql, traceql), strategyOnly when a query was rewritten.
querdian_policy_termshistogrambackendDNF terms for each resolved request (0 for unrestricted).
querdian_auth_failures_totalcounterreasonmissing_token, invalid_token, expired, audience, issuer, missing_username.
querdian_snapshot_generationgaugeCounts the rebuilds of this replica. Do not compare it across replicas.
querdian_snapshot_rebuilds_totalcounterresultok or error.
querdian_policiesgaugekind, readyPolicies by kind and compile result. kind is ClusterAccessPolicy, AccessPolicy, and with the multicluster block also SpokePolicy. Each replica exports it.
querdian_cluster_policy_age_secondsgaugeclusterMulti-cluster: time since the last valid policy sync of a spoke (+Inf before the first).
querdian_cluster_policy_expiredgaugeclusterMulti-cluster: 1 if the policies of a spoke are expired or suspended, else 0.

Querdian also exports the Go and process collectors.

Spans#

Span tree of one proxied request. For the tracing configuration and the privacy flags, see operations.md.

SpanAttributes
server span HTTP <method> <route template>http.route, querdian.decision (allow, deny, error), querdian.decision.reason, querdian.policies (policy names), merge attributes merge.kind (loki_streams, string_set, sum_counts), merge.items_in, merge.items_out, merge.deduped, merge.truncated (log streams), merge.approximate (sums); status error when decision is error
authn.verifystatus error when the authentication failed
policy.resolvesnapshot.generation, policies.matched, dnf.terms, dnf.unrestricted, dnf.disjoint, tenants.count
enforce.rewritequery.language, strategy (inject, or_lift, fanout, match_expand, passthrough), query.bytes_in, query.bytes_out
upstream (client span, one for each upstream request)standard HTTP client attributes; url.full has the scheme, host and path only, without the query string (see the privacy flags)
snapshot.rebuild (root span, controller)querdian.trigger (startup, event), snapshot.generation, policies.total, policies.invalid, compile.duration_ms

Type to search the documentation for main.