feat(observability): exemplars for supervisor latency metrics

Offen
#5,890 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
18/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
rust
Bereich
observability

Rechercherichtung

This is a design proposal gated on upstream work: the pinned opentelemetry_sdk 0.33.1 exports empty exemplar lists for explicit-bucket histograms, tracked in OpenTelemetry Rust #3369. Start by reading #5364 and the supervisor metrics branch that already exports the policy-evaluation, request-inspection and upstream-connect histograms over OTLP, then watch the upstream PR that adds exemplar collection. Done means OTLP exemplars whose value matches the recorded duration and whose trace ID matches the sampled supervisor span, plus the metrics docs showing how to follow an exemplar to its trace. Because the dependency is unreleased, a newcomer cannot complete it today.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

state:triage-needed
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
Vorherrschende Sprache
Rust
Sterne
21.5k
Forks
2.1k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus NVIDIA/OpenShell

Alle Issues in NVIDIA/OpenShell

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.