Skip to content
Opod

Operate

Metrics, events, alerts, logs and traces

What the control plane and the leaders publish. Prometheus series, the event stream, the bundled dashboards and rules, built-in alerts and rules, log shipping and traces.

In short

opod publishes Prometheus metrics, a live event stream, its own alerts, log records and request traces. It installs no Prometheus, Grafana or collector: you point the tools you already run at it. The control plane serves /metrics on port 8080; every leader serves its serving metrics on port 8081. The chart carries two Grafana dashboards and a rule file you can turn on with one value each.

When you need it

  • You want opod's metrics and alerts in your existing Prometheus and Grafana.
  • You need a pager to ring when an endpoint errors, slows down or runs out of worker slots.
  • You want every change and lifecycle step as a stream, for a chat bot or your own tooling.
  • You ship the control plane's records and its audit stream to Splunk or an OpenTelemetry collector.
  • You trace a slow request through the leader and the engine.

Do it

To scrape both levels with a Prometheus that runs in the cluster:

  1. Scrape the control plane

    The Service carries prometheus.io/scrape: "true" and prometheus.io/port: "8080". A Prometheus that honours those annotations needs nothing more. Otherwise add a static target opodcp.opod.svc:8080.

  2. Scrape every leader

    Add the opod-leaders job from Metrics below to your Prometheus configuration. It keeps pods that carry opod.io/front and scrapes their port 8081.

  3. Load the rules and dashboards

    helm upgrade opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp --reset-then-reuse-values \
      --set observability.prometheusRules.enabled=true \
      --set observability.grafanaDashboards.enabled=true

    This is new in 0.3.0.

  4. Send alerts to your pager

    Save OPODCP_NOTIFY_URLS on the Connectors page, then send a test:

    export H="Authorization: Bearer $(kubectl -n opodcp get secret opodcp-admin -o jsonpath='{.data.token}' | base64 -d)"
    curl -s -H "$H" -X POST https://cp.example.com/api/v1/connectors/notifier/test

Check it worked

kubectl -n opodcp port-forward svc/opodcp 8080:8080 &
curl -s http://127.0.0.1:8080/metrics | grep -E '^opodcp_(controller_runs_total|cell_gpus|alerts_open)' | head

A good answer shows opodcp_controller_runs_total{controller="reconciler"} N and its neighbours, opodcp_cell_gpus with your GPU count, and opodcp_alerts_open per severity. In Prometheus, up{job="opod-leaders"} is 1 for every leader. The notifier test answers {"sent": true, "sinks": […]}.

If it fails

SymptomCauseFix
The opod-leaders targets read context deadline exceededleader isolation blocks the scrapename your Prometheus in networkPolicy.leaderIsolation.from
A panel of a labelled counter is emptythe counter has no series until its first eventnothing to fix; it appears with the first event
opodcp_usage_sink_lag_rows is NaNno usage sink is connectedconnect one; see Usage
The notifier test answers 409 E-NO-NOTIFIERno alert sink is savedsave OPODCP_NOTIFY_URLS
The notifier test answers "sent": falsea sink refused one halfread that sink's entry in sinks; the doctor's notifier row counts failures
curl …/events closes after a minutea proxy cuts long responsesallow long-lived responses on /events; the stream sends : ping every 15 s
The traces doctor row is redOPODCP_TRACES_SAMPLE_RATIO is not a number from 0 to 1save a value such as 0.1

What opod publishes

opod exposes metrics, events, logs and spans and ships the files to read them. It installs no Prometheus, Grafana or collector. Every metric label is an endpoint, a worker, a model or a class, never a key, user or team. Items marked † are new in 0.3.0.

Metrics

The control plane: GET /metrics on its Service, port 8080. The route takes no credential. The Service carries prometheus.io/scrape and prometheus.io/port. The control plane's own families are opodcp_*; the Go runtime and process collectors (go_*, process_*) are there too.

SeriesTypeWhat it is
opodcp_http_requests_total{route,code}counterAPI requests by route pattern and status, 401/403/429 included
opodcp_http_request_duration_seconds{route}histogramAPI latency by route pattern; buckets from 2 ms to 10 s
opodcp_plan_judgements_total{result}counterplans judged; result is ok, an E-… code or uncoded
opodcp_ledger_conflicts_totalcounteradmission writes retried because the ledger moved
opodcp_usage_sink_connectedgauge1 when a usage sink is configured, 0 when usage only buffers
opodcp_usage_sink_lag_rows, opodcp_usage_sink_lag_secondsgaugerows the sink has not taken, and the oldest one's age; NaN with no sink
opodcp_meter_pods_seen_total, opodcp_meter_pods_sized_totalcounterpods the occupancy meter looked at, and those it could size
opodcp_meter_pods_skipped_total{reason}counterpods that accrued nothing; reason is no-observed-status, no-observed-plan, not-running, no-node or no-measurable-share
opodcp_controller_runs_total{controller}, opodcp_controller_errors_total{controller}countereach control loop's runs, and runs that failed or panicked
opodcp_controller_last_run_timestamp_seconds{controller}, opodcp_controller_last_duration_seconds{controller}gaugewhen each loop last ran, and how long it took
opodcp_alerts_open{severity}gaugeopen alerts by severity
opodcp_notify_failures_total{adapter}counteralert deliveries that failed, by notifier adapter
opodcp_cell_gpus, opodcp_licence_max_gpusgaugeallocatable GPUs in the cell, and the licence ceiling
opodcp_licence_fleet_over †gauge1 while the fleet control plane reports the cells of this key over it
opodcp_kv_tier_hit_tokens, _query_tokens, _loaded_bytes, _stored_bytes, _used_percent, _alloc_failures † {endpoint,node}gaugeeach worker's host KV tier: tokens served and looked up, bytes loaded and stored, fill (0–100), and stores refused for room, since its engine started

Each leader and front door: /metrics on the probe port 8081 (plain HTTP, always on). Families opod_*: opod_request_duration_seconds, opod_time_to_first_token_seconds, opod_requests_total, the opod_admission_* family and more. Serving SLOs are written against these. A leader from core v0.4.0 also exposes its usage push queue on /metrics † (opod_usage_queue_records, opod_usage_queue_bytes, opod_usage_sent_total, opod_usage_export_errors_total, opod_usage_dropped_total{reason}); alert on increase(opod_usage_dropped_total[10m]) > 0, which means usage records are being lost. See core Metrics.

scrape_configs:
  - job_name: opod-leaders
    kubernetes_sd_configs: [{ role: pod, namespaces: { names: [opod] } }]
    relabel_configs:
      - { source_labels: [__meta_kubernetes_pod_label_opod_io_front], regex: '.+', action: keep }
      - { source_labels: [__meta_kubernetes_pod_ip], target_label: __address__, replacement: '$1:8081' }
      - { source_labels: [__meta_kubernetes_pod_label_opod_io_front], target_label: endpoint }
      - { source_labels: [__meta_kubernetes_pod_label_opod_io_role], target_label: role }
      - { source_labels: [__meta_kubernetes_pod_name], target_label: pod }

With leader isolation on, name your Prometheus in networkPolicy.leaderIsolation.from, or the scrape stops.

To push instead of scrape, save OTEL_EXPORTER_OTLP_ENDPOINT on the Connectors page (OTLP/HTTP every 30 s). Headers go in OTEL_EXPORTER_OTLP_HEADERS (k=v,k=v) through extraEnv. The doctor's metrics row counts pushes sent and failed.

Dashboards and Prometheus rules †

The chart carries two Grafana dashboards (opod · serving and opod · control plane) and a rule file. Render them as ConfigMaps:

helm upgrade opodcp … --reset-then-reuse-values \
  --set observability.grafanaDashboards.enabled=true --set observability.prometheusRules.enabled=true

Grafana's dashboard sidecar finds them by the label grafana_dashboard: "1" (observability.grafanaDashboards.label, .labelValue). Or extract the files with helm pull … --untar (files/dashboards/, files/prometheus-rules.yaml). The 0.2.1 chart carries neither.

RuleSeverityFires when
OpodEndpointErrorswarningmore than 5 % of an endpoint's requests end in error for 10 minutes
OpodSlowFirstTokenwarningan endpoint's p95 time to first token is above 5 s for 15 minutes
OpodSheddingwarningan endpoint sheds requests of a class for 10 minutes
OpodNoWorkerSlotscriticalan endpoint has no worker slot for 5 minutes
OpodControlPlaneLoopErrorswarninga control loop keeps failing for 15 minutes
OpodControlPlaneLoopStoppedcriticala control loop has not run for 15 minutes
OpodUsageSinkLaggingwarningthe usage sink is more than 30 minutes behind, for 10 minutes

Also worth a rule: opodcp_usage_sink_connected == 0 for an hour (usage only buffering; do not use absent(), the gauge always exists), and rate(opodcp_meter_pods_sized_total[30m]) == 0 and rate(opodcp_meter_pods_seen_total[30m]) > 0 (GPU-seconds not recorded). A labelled counter has no series until its first event, so an empty panel means none yet.

Events

Every change and lifecycle step is an event on the control plane's bus. The console reads them live; you can too.

TICKET=$(curl -s -H "$H" -X POST https://cp.example.com/api/v1/stream-ticket | jq -r .ticket)
curl -N "https://cp.example.com/events?ticket=$TICKET"

GET /events is a Server-Sent Events stream (viewer). A browser cannot send a header there, so it takes a single-use ticket from POST /api/v1/stream-ticket as ?ticket=. Each message is id: <seq>, event: <type> and data: the event as JSON: { "seq", "ts", "type", "subject", "data" }. subject is usually the endpoint, node, run or job id. A reconnect with Last-Event-ID (or ?since=<seq>) replays up to 1,000 missed events from the journal first. A comment : ping arrives every 15 s. With more than one replica, connect the events port to NATS, or a stream on one replica misses what another publishes. GET /api/v1/events/recent returns the last 200 events the control plane pulled from its leaders.

The same events also ship to the logs connector as the events stream.

AreaTypes
Endpointsendpoint.created, endpoint.updated, endpoint.deleted, endpoint.recreated †, status.changed, plan.applied, plan.deprecated-flag, policy.updated, endpoint.advisory, endpoint.adapters, endpoint.slo, endpoint.remote_key, endpoint.cert-renewed, endpoint.leader-moved, endpoint.pod-event †, endpoint.worker-restarted †, endpoint.worker-identity-revoked, endpoint.template-drift, endpoint.template-rolled, gang.gave-up †, fabric.policy, image.unsigned, image.unverified
Runs and rolloutsrun.started †, run.step †, run.step-progress †, run.finished †, run.cancel-requested †, rollout.canary, rollout.canary-weight, rollout.canary-verdict, rollout.canary-unjudged, rollout.canary-promoted, rollout.canary-aborted, rollout.eval, rollout.signature-hold †, rollout.signature-accepted †, rollout.signature-rejected †, rollout.woke
Scalingautoscale.granted, autoscale.scaled, autoscale.slept, autoscale.woke
Machinesnode.cordoned, node.drained, node.evacuated, node.removed, node.sharing-changed †, gpu.reset †, cache.pruned, kvtier.swept †, pod.forced †, pod.remnant †, pod.remnant-resolved †, remnant.found †, remnant.resolved †
Modelsmodel.created, model.deleted, model.version, model.version-rollback, model.warm-started, model.approval-policy †, cell.hub-token
Keys, users and teamskey.created, key.revoked, auth.login, auth.login_failed, auth.updated, auth.user_deleted, auth.token_created †, auth.token_revoked †, user.created, team.quotas.changed
Alertsalert.fired, alert.resolved, alert.acked, alert.rules_changed
Connectors, usage and dataconnector.saved †, connector.verified †, connector.changed †, secrets.synced †, usage.captured, usage.cursor_reset, usage.sink_skipped, fleet.events, backup.taken, backup.restored, audit.rebased, audit.retention_changed
Licencelicence.updated, licence.burst-started, licence.burst-ended, licence.fleet-over †, licence.fleet-under †
Cell doordoor.auto-routes †
Jobsjob.submitted, job.placed, job.running, job.preempted, job.deleted, and job.<state> for queued, placing, running, preempted, succeeded, failed, cancelled
Batchesbatch.created, batch.file.uploaded, batch.in_progress, batch.cancelling, and batch.<status> for completed, failed, expired, cancelled

In 0.2.1 a rollout publishes rollout.started, rollout.step, rollout.step-progress and rollout.finished; 0.3.0 publishes run.* for every kind of run instead.

Alerts inside the control plane

The control plane raises its own alerts and keeps them in the database with fire, resolve and acknowledge. One alert is open per kind and object. A condition alert resolves after three healthy observations in a row (about 45 s). A sticky alert resolves only on acknowledge, or when its subject is deleted. Each alert carries a title, a detail and a remedy. The bell in the console's top bar lists open ones.

KindSeverityRaised when
endpoint.degradedseriousan endpoint is degraded
endpoint.engine-unhealthywarninga worker's pod runs while its engine crash-loops or stopped
endpoint.worker-slowwarningthe endpoint's leader ranks a worker down because it answers slower than its siblings (routing.slowFactor); resolves about 45 s after the leader stops listing it. Arrives in the release after 0.3.6
endpoint.images-unverifiedwarning, stickythe endpoint runs images whose signature was not verified
endpoint.foreign-objectswarningworkloads in the namespace belong to no endpoint in this store
plan.node-missingseriousa plan is pinned to a node that left the cluster
rollout.failedserious, stickya rollout failed
gang.gave-up †seriousa gang could not form after three tries and is parked
autoscale.no-capacitywarningthe next worker cannot be placed
autoscale.scaler-unhealthywarningKEDA owns the endpoint and its ScaledObject is absent or not ready
autoscale.grant-below-floorwarningthe ledger granted fewer worker slots than the plan's floor
worker.memory-near-limit †warninga worker with a KV tier uses most of its memory limit
node.notreadywarninga node is NotReady
node.cache-lowwarninga node's model cache is nearly full
node.remnant †seriouspods of ours left the API without proof their processes ended; the node is cordoned
gpu.unhealthyseriousthe probe read a card as faulted (uncorrected ECC, hardware slowdown)
gpu.held-outside †warninga card's memory is in use and nothing of ours holds it
usage.no-sinkwarningno usage sink, and the buffer has grown past what an outage explains; after 0.3.6 it also fires, naming the reason, when a saved sink did not open
usage.sink-holdingseriousthe sink is behind and rows are kept past the retention window
connector.failing †warninga connected port has failed its doctor check for a while
connector.sealed †warninga port's stored credentials were sealed with another install key
rule.<id>the rule'sone of your alert rules breached
curl -s -H "$H" "https://cp.example.com/api/v1/alerts?state=open"
curl -s -H "$H" -X POST https://cp.example.com/api/v1/alerts/<id>/ack

In the release after 0.3.6, opodcp alerts ls --open prints the same list as a table, and --json gives each alert's detail and remedy. See the CLI reference.

Alert rules of your own: PUT /api/v1/alert-rules (admin, the whole list, If-Match honoured) with up to 64 rules. GET /api/v1/alert-rules reads them.

MetricWhat it measures
endpoint.error_rate_pcterrors ÷ requests × 100 over the window
endpoint.p95_latency_msp95 request latency over the window
node.vram_headroom_gbthe most free VRAM on any one GPU of the node
node.offline_minutesminutes since the node stopped being Ready
key.expiry_daysdays until an active endpoint key expires
endpoint.cert_expiry_daysdays until the endpoint's embedded certificate expires (negative = expired)
gpu.ecc_uncorrecteduncorrected ECC errors a card reported since boot
usage.sink_lag_minutesthe age of the oldest row the sink has not taken; no sink gives no reading
node.nic_down_countthe release after 0.3.6: NICs on the node with link down
node.nic_drop_per_minthe release after 0.3.6: the worst NIC's received plus sent drops per minute
node.peer_loss_pctthe release after 0.3.6: the worst packet loss from the node's probe to any peer. A peer that is down (its own probe sent no fresh round) is left out, so one NotReady machine does not make every other machine fire
fabric.proof_gbps_below_floorthe release after 0.3.6: how far the newest fabric proof of a node set is below the bandwidth floor, in GB/s
worker.heartbeat_age_secondsthe release after 0.3.6: the oldest worker heartbeat of an endpoint; the router stops dispatching to a worker past 30 s. Scope by endpoint name
[{ "id": "chat-errors", "name": "chat error rate", "metric": "endpoint.error_rate_pct", "op": "gt", "threshold": 2,
   "scope": "chat", "severity": "serious", "windowMinutes": 15, "enabled": true }]

id is lowercase letters, digits, ., _ and - (1–64 characters). op is gt or lt; threshold is 0 or more. windowMinutes applies to the two endpoint rates only (default 15, at most 1,440). scope is an endpoint or node name; empty means every object. severity is warning (the default), serious or critical. Each breach is an alert of kind rule.<id>, fired once per object and healed after three healthy observations.

Delivery. Deliver alerts to your pager with the notifier connector: OPODCP_NOTIFY_URLS, a comma-separated list of https://… (a webhook that receives {event, alert} JSON), alertmanager+https://… (Alertmanager v2), slack+https://… (a Slack incoming webhook) and pagerduty://<routing key> (Events API v2, trigger, acknowledge, resolve). The list is stored sealed. POST /api/v1/connectors/notifier/test (admin) sends one alert marked TEST to every sink and answers per sink; with no sink it answers 409 E-NO-NOTIFIER. Delivery is bounded at 10 s and never blocks the control plane. See Connectors.

Logs

The control plane writes JSON records to stdout. The logs connector also ships three streams, chosen by OPODCP_LOGS_STREAMS (default all three):

StreamWhatSplunk sourcetype
cpthe control plane's own log recordsopodcp:cp
auditactions somebody took, with the actoropodcp:audit
eventslifecycle events nobody took: rollout steps, autoscaling, alertsopodcp:events

Choose the adapter with OPODCP_LOGS_ADAPTER on the Connectors page:

OPODCP_LOGS_ADAPTERSettings
stdout (default)none
otlpOPODCP_LOGS_URL=http://otel-collector:4318; optional OPODCP_LOGS_TOKEN (sent as a bearer) and OPODCP_LOGS_HEADERS (k=v,k=v). Every leader also gets the URL as OPOD_OTLP_LOGS_ENDPOINT for its own records
splunk-hecOPODCP_LOGS_URL=https://splunk.example.com:8088, OPODCP_LOGS_TOKEN (the HEC token). Leaders get no log URL under this adapter

The token is stored sealed. Shipping never blocks: the queue holds 4,096 records and flushes every 2 s, each export call has 5 s, and a failed batch is counted and dropped, not retried. The doctor's logs row counts sent, failed and dropped. Engine and pod stdout are your log agent's job: collect /var/log/pods/opod_*/*/*.log. Useful pod labels for routing: opod.io/endpoint, opod.io/endpoint-id, opod.io/role, opod.io/job, app.kubernetes.io/name=opodcp.

Traces

Save OPODCP_TRACES_URL (an OTLP/HTTP collector) on the Connectors page, and optionally OPODCP_TRACES_SAMPLE_RATIO (0 to 1; empty traces every request, and a request its caller sampled is always kept). Every leader then exports its request spans there as OPOD_OTLP_ENDPOINT, and every worker pod gets OTEL_SERVICE_NAME=<engine> so the engine's own spans are named. The control plane sends no spans itself; the doctor's traces row says whether the collector answers a dial. A leader picks the setting up at its next rollout.

Last updated · Source: content/docs/control-plane-operate/observability.mdx · View as Markdown