Skip to content

Commit 470ce8b

Browse files
pimlockclaude
andcommitted
docs(observability): document configuration delivery metrics
Describe the push-mode configuration delivery metrics and the interceptor provider-profile source refresh metrics, including their label values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent b132c1a commit 470ce8b

1 file changed

Lines changed: 43 additions & 2 deletions

File tree

‎docs/observability/gateway-metrics.mdx‎

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ curl -s http://localhost:9090/metrics | grep '^openshell_server_supervisor_sessi
138138

139139
## Histograms and Summaries
140140

141-
The multi-replica latency metrics are Prometheus histograms with `_bucket`,
142-
`_sum`, and `_count` series and buckets from 1 millisecond to 15 seconds, so
141+
The multi-replica latency metrics and the configuration build duration are
142+
Prometheus histograms with `_bucket`, `_sum`, and `_count` series and buckets
143+
from 1 millisecond to 15 seconds, so
143144
`histogram_quantile` can aggregate them across replicas. The older
144145
`*_duration_seconds` metrics and the interceptor latency metric are summaries
145146
with `quantile` labels that each replica computes on its own. Do not average
@@ -231,6 +232,44 @@ The gateway also records every API request and its background database check:
231232
| `openshell_server_readiness_database_healthy` | Gauge | None | `1` when the last background database check succeeded, otherwise `0`. |
232233
| `openshell_server_readiness_database_probe_duration_seconds` | Summary | `outcome` | Duration of the background database check. `outcome` is `success`, `db_error`, or `timeout`. |
233234

235+
## Configuration Delivery Metrics
236+
237+
With `config_delivery_mode = "push"`, the gateway builds each supervisor's
238+
configuration and sends it over the supervisor session. These metrics stay
239+
empty in poll mode, where `GetSandboxConfig` and
240+
`GetSandboxProviderEnvironment` in the request metrics carry the same work.
241+
242+
| Metric | Type | Labels | Description |
243+
|---|---|---|---|
244+
| `openshell_supervisor_config_builds_total` | Counter | `component`, `lane`, `outcome` | Configuration builds for sessions on this replica. |
245+
| `openshell_supervisor_config_build_duration_seconds` | Histogram | `component`, `outcome` | Time to build one component, including store reads and credential resolution. |
246+
| `openshell_supervisor_config_queue_wait_seconds` | Summary | `lane` | Time from a session needing a rebuild to its build starting. |
247+
| `openshell_supervisor_config_dirty_sessions` | Gauge | None | Sessions with a rebuild pending. |
248+
| `openshell_supervisor_config_waiting_sessions` | Gauge | None | Sessions waiting for a build slot. |
249+
| `openshell_supervisor_config_deliveries_total` | Counter | `component`, `outcome` | What happened to each built snapshot. |
250+
| `openshell_supervisor_config_apply_results_total` | Counter | `component`, `outcome` | Apply results that supervisors reported. |
251+
| `openshell_supervisor_config_bootstrap_total` | Counter | `outcome` | Session bootstraps: `built` or `build_failed`. |
252+
| `openshell_supervisor_config_bootstrap_revision_mismatches_total` | Counter | None | Bootstrap builds retried because the two components came from different revisions. |
253+
| `openshell_supervisor_config_peer_notifications_total` | Counter | `outcome` | Notifications sent to the replica that owns a sandbox's session. |
254+
255+
The labels take these values:
256+
257+
- `component` is `sandbox_config` or `provider_environment`. On
258+
`apply_results_total` it is the protocol name, such as
259+
`CONFIG_COMPONENT_SANDBOX_CONFIG`, and `outcome` is a `ConfigApplyOutcome`
260+
name, such as `CONFIG_APPLY_OUTCOME_APPLIED`.
261+
- `lane` is `sandbox` for a change to one sandbox, or `fanout` for a change
262+
that reaches many sandboxes, including the 30-second reconcile of each
263+
session. A quarter of the build slots are reserved for the `sandbox` lane.
264+
- On builds, `outcome` is `ok`, `failed`, or `timeout`. A failed build retries
265+
with a per-session backoff from 1 to 30 seconds.
266+
- On deliveries, `outcome` is `queued`, `replaced` (a newer snapshot replaced
267+
an unsent one), `coalesced` (held until the supervisor acknowledges its
268+
previous update), `unchanged`, `no_active_session`, `unsupported_session`,
269+
`payload_too_large`, `owner_moved`, or `owner_lookup_failed`.
270+
- On peer notifications, `outcome` is `accepted`, `stale_owner`,
271+
`unsupported_peer`, `peer_error`, or `timeout`.
272+
234273
## Gateway Interceptor Metrics
235274

236275
Gateways with [gateway interceptors](/extensibility/gateway-interceptors)
@@ -244,6 +283,8 @@ record their evaluations:
244283
| `openshell_gateway_interceptor_fail_open_total` | Counter | None | Interceptor failures that let the request continue. |
245284
| `openshell_gateway_interceptor_fail_closed_total` | Counter | None | Interceptor failures that rejected the request. |
246285
| `openshell_gateway_interceptor_post_commit_observation_failures_total` | Counter | `stage` | Failed post-commit observations. `stage` is `response_body` or `evaluation`. |
286+
| `openshell_server_provider_profile_source_refreshes_total` | Counter | `outcome` | Refreshes of interceptor provider-profile snapshots. `outcome` is `ok` or `failed`. |
287+
| `openshell_server_provider_profile_source_snapshot_age_seconds` | Gauge | None | Age of the oldest cached provider-profile snapshot after the last refresh. Reads fail closed past three refresh intervals. |
247288

248289
## OCSF Log Metrics
249290

0 commit comments

Comments
 (0)