Skip to main content

Observability

Shared observability instrumentation standard (Track H1). Defines the two unauthenticated, tailnet-scoped exposition endpoints every service serves (GET /metrics Prometheus text; GET /health liveness), the Fix-157 label-cardinality/PII policy that is a MANDATORY SDK default, the structured-log JSON schema, and the OTLP tracing env contract. ZERO new store — emits to the existing substrate one-pane (Prometheus/VictoriaMetrics · Alloy→Loki · Tempo/OTLP · GlitchTip). Full policy: standard.md.

  • Group: Governance & platform
  • Contract: contracts/observability/v1/openapi.yaml
  • Public access: none — internal-only capability. It is NOT exposed on the public API gateway (https://api.vagarylabs.com); it is reachable only inside the fleet (container/tailnet) by first-party callers. There is no customer-facing endpoint to call.

Endpoints

MethodPathSummary
GET/metricsPrometheus text-exposition of this service's registry (BFT fail-open — never 5xx)
GET/healthLiveness probe (Uptime-Kuma + container healthcheck target)

Schemas

Health

FieldTypeDescription
statusstringliveness marker
servicestringthis service's canonical name

LabelPolicy

The Fix-157 / D24 label-cardinality + PII-redaction policy — a MANDATORY default of the SDK. A raw per-user identifier is NEVER a label; correlate via an 8-char SHA256 prefix; keep <100 unique values per label; the route label is normalized (IDs/tokens/emails → placeholders). See standard.md.

FieldTypeDescription
forbidden_raw_labelsarrayidentifiers that MUST NOT appear raw as a metric label
hashed_label_suffixstringan 8-char SHA256 prefix label carries this suffix (e.g. api_key_id_hash)
route_normalizationbooleanthe route label collapses UUIDs/ObjectIds/emails/tokens/numeric+alnum ids to :id/:token/:email
max_series_per_labelintegertarget steady-state cardinality cap per label
tenant_labelstringI6 product-tier tenant label — bounded + PII-safe; used ONLY where per-org series are bounded

StructuredLogEntry

the canonical JSON log line shape (Alloy→Loki parses); sensitive fields are redacted

FieldTypeDescription
tsstring
levelstring
servicestring
msgstring
trace_idstringactive OTel trace_id (32-char hex) when a span is active
span_idstring
organization_idstringI6 tenant
extraobjectstructured context (sensitive keys redacted)

AlertRule

alert-rules-as-data — the shape converges; the ALERT_RULES content stays product-local

FieldTypeDescription
namestring
expressionstringPromQL that fires when truthy
severitystring
for_durationstringPrometheus duration (e.g. 5m)
annotationsobject
labelsobject

Generated by scripts/gen-capability-docs.py from contracts/observability/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page.