Support setting span status from tracing span fields

Aperta
#1,398 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@sentry-junior ci sta già lavorando.

Dal 3/11/2026.

  • #1399 di @sentry-junior — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start with sentry-tracing/src/lib.rs and sentry-tracing/src/layer/span.rs, then read how sentry.op is handled at span creation and when fields are recorded. Check the existing span status APIs and tests before choosing the sentry.status value convention. Done means the field updates the Sentry span status both at creation and when recorded later, with tests covering both paths.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Feature Rust Spans

Code that is instrumented only with the tracing crate can't set the status of the Sentry span created by sentry-tracing, unless it takes a direct dependency on sentry.

  • tracing has no built-in span status concept. A span has only a name, a target, a level and fields. #[instrument(err)] emits an error event, but the span itself isn't marked.
  • sentry-tracing treats only three span fields specially: sentry.name, sentry.op and sentry.trace (sentry-tracing/src/lib.rs, sentry-tracing/src/layer/span.rs). Every other field becomes span data, and the layer never calls set_status on the span.
  • The only workaround is to call sentry::configure_scope(|s| s.get_span()) while the tracing span is entered and then call set_status. This needs the sentry dependency, which defeats the point of instrumenting through tracing alone.
  • Prior art: tracing-opentelemetry reserves the otel.status_code and otel.status_description fields for this (docs). sentry-opentelemetry already maps OTel span status onto Sentry spans.

Proposal (from the discussion): add a field convention, e.g. sentry.status, that maps onto the Sentry span status. Like sentry.op, it would be honored both when the span is created and when the field is recorded later.

Raised by Jan Michael Auer.

via @szokeasaurusrex.

--

View Session [Sentry]

Lingua principale
Rust
Stelle
754
Fork
192
Merge medio
2g 20h
PR unite (30g)
21

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di getsentry/sentry-rust

Tutte le issue di getsentry/sentry-rust

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.