Skip to main content

Metrics spec

For the Operator view, see Observability.

ERun's runtime pod exposes a Prometheus-format metrics endpoint. The full schema — endpoint, every metric name, every label, every type — is below. Application services declared in .erun/config.yaml use their own framework's metrics conventions; ERun has no opinion on those.

Endpoint

PropertyValue
Listenererun-devops container, port 9100.
Path/metrics.
FormatPrometheus text exposition format, v0.0.4.
AuthenticationNone (loopback-only by default; cross-namespace ingress denied by the runtime chart's NetworkPolicy).
Scrape cadenceSet by the caller (Prometheus). The runtime pod does not enforce a minimum.

A typical Prometheus scrape configuration:

- job_name: erun-runtime-pod
kubernetes_sd_configs:
- role: pod
namespaces:
names: [] # all namespaces
relabel_configs:
- source_labels: [__meta_kubernetes_pod_container_name]
regex: erun-devops
action: keep
- source_labels: [__meta_kubernetes_namespace]
target_label: namespace
- source_labels: [__meta_kubernetes_pod_name]
target_label: pod

Metrics

Every series is labelled with the env's tenant + environment, derived from ERUN_TENANT and ERUN_ENVIRONMENT at process start. Additional per-metric labels are listed below.

erun_idle_eligibility

PropertyValue
Typegauge
Labelstenant, environment
Range0 (env not eligible for idle-stop) or 1 (eligible).
SourceRecomputed on every idle-monitor tick (see Idle policy).
Reset onProcess restart.

erun_terminal_input_seconds_since_last

PropertyValue
Typegauge
Labelstenant, environment
Unitseconds.
SourceWall-clock now − last_terminal_input. Updated on every idle-monitor tick.
Initial value0 immediately after pod start (no terminal-input event observed).

erun_traffic_window_bytes

PropertyValue
Typegauge
Labelstenant, environment
Unitbytes.
SourceThe current rolling-60-second window's byte count, observed at the SSH + MCP sockets.
Window definitionTumbling 60-second window: each scrape returns the window the env is currently inside.

erun_mcp_calls_total

PropertyValue
Typecounter
Labelstenant, environment, tool, result
tool valuesThe string passed as tools/call.name — one of idle, doctor, list, version, logs, build, push, deploy, release, open, init, delete, raw.
result valuessuccess, error, dry_run.
Reset onProcess restart. (Counters are monotonic within a process.)

erun_audit_events_total

PropertyValue
Typecounter
Labelstenant, environment, action, actor_kind, result
action valuesThe dotted action verb from the audit log: erun.<command>, mcp.<tool>, api.<resource>.<verb>. See Audit log format · Action verbs.
actor_kind valuesoperator, agent.
result valuessuccess, error, dry_run.

Cardinality envelope

The label sets above are bounded:

LabelsCardinality bound
tenant × environmentOne per running env.
tool≤ 20 (the MCP-registered tool set).
result3 (success, error, dry_run).
actionBounded by the registered CLI command, MCP tool, and API endpoint counts (≤ ~60 today).
actor_kind2 (operator, agent).

A single-env Prometheus deployment emits ≤ ~400 series from this pod.

Conformance

The runtime pod's metrics emitter conforms to:

  • Prometheus text exposition format v0.0.4.
  • OpenMetrics 1.0 is not declared (no # TYPE lines beyond gauge/counter; no # UNIT lines).
  • _total suffix convention is used on counters.

Application-service metrics

The metrics above describe the runtime pod only. Application services declared in .erun/config.yaml use whatever metrics convention their framework ships with (Go prometheus/client_golang, Node prom-client, Java Micrometer, etc.). ERun's helm chart conventions do not standardise this; consult the cluster's Prometheus configuration for how application pods are scraped.

See also