Support setting span status from tracing span fields

Đang mở
#1,398 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@sentry-junior đang làm issue này rồi.

Từ ngày 3/11/2026.

  • #1399 của @sentry-junior — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
58/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
backend, observability

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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]

Ngôn ngữ chính
Rust
Star
754
Fork
192
Merge trung bình
2 ngày 20 giờ
Pull request đã merge (30 ngày)
21

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/sentry-rust

Tất cả issue của getsentry/sentry-rust

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.