Repository navigation
Description
User Story
I operate OpenShell gateways and sandboxes. When a supervisor latency alert fires, I want to open a trace for an operation in the affected histogram bucket so I can see where it spent time.
Problem Statement
The supervisor latency histograms show how long policy evaluation, request inspection, and upstream connections take. Operators need a way to get from a histogram observation to the supervisor trace for that operation. This feature is a follow-up to #5364, due to upstream lack-of-support for exemplars at the time.
Impact / Why This Matters
Today, operators investigating slow sandbox egress must open their trace backend, filter supervisor traces by the affected supervisor and time window, and inspect individual spans to find a span with the duration they're looking for. That search delays incident triage and can turn up no matching trace when only a subset of requests is sampled.
Proposed Design
Export exemplars for the policy evaluation, request inspection, and upstream connect histograms, using the upstream feature in opentelemetry_sdk once it's released. A latency observation recorded while a sampled supervisor span is active is eligible to become an exemplar carrying that trace ID.
Acceptance Criteria
- Each of the three supervisor latency histograms can export an OTLP exemplar whose value matches the recorded duration and whose trace ID matches the sampled supervisor span.
- Observations without an active sampled supervisor span still contribute to histogram counts and sums and produce no exemplar.
- Trace IDs are carried only in exemplars, keeping metric series cardinality independent of trace volume.
- The supervisor metrics docs show how to configure metrics and traces and follow an exemplar to its trace in a compatible backend.
Alternatives Considered
- Generate histograms and exemplars from spans in the collector. This can link a histogram to a trace, but it moves the burden to the collector and a user must set this up by themselves.
- Collect exemplars in OpenShell. OpenShell could retain a bounded set of latency observations with sampled supervisor trace IDs and attach them to the matching histogram points during OTLP export. This could ship before opentelemetry_sdk adds support. OpenShell would own sample selection, bucket matching, and keeping exemplars aligned with each export interval. It's a logic that's not coherent to OpenShell and might create a drift from upstream that would require future undoing.
Agent Investigation
The supervisor metrics branch exports all three latency histograms over OTLP. The pinned OpenTelemetry Rust SDK (0.33.1) exports empty exemplar lists for explicit-bucket histograms. Upstream is tracking exemplar collection. OpenTelemetry Rust #3369
Checklist
- I've reviewed existing issues and the published docs
- This is a design proposal, not a "please build this" request
Activity