Skip to content

feat(scope): Add process runtime attributes to span context#6564

Merged
ericapisani merged 8 commits into
masterfrom
py-2401-migrate-stdlib-event-processor
Jun 18, 2026
Merged

feat(scope): Add process runtime attributes to span context#6564
ericapisani merged 8 commits into
masterfrom
py-2401-migrate-stdlib-event-processor

update some of the tests

bb23e2b
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: code-review completed Jun 16, 2026 in 0s

2 issues

code-review: Found 2 issues (1 medium, 1 low)

Medium

process.runtime.description only set on segment as side effect of event capture, not unconditionally like the other runtime attributes - `sentry_sdk/integrations/stdlib.py:58-66`

Mutating a span attribute inside add_global_event_processor means process.runtime.description is only stamped on the segment when at least one non-span event (error, log, etc.) is captured during the trace. Traces that complete without any captured events will be missing this attribute, while process.runtime.name and process.runtime.version are always present via scope.set_global_attributes(). Consider adding process.runtime.description to set_global_attributes() in scope.py alongside the other two runtime attributes instead.

Low

process.runtime.description attribute has no test coverage - `tests/tracing/test_span_streaming.py:1723-1734`

The PR adds process.runtime.description (via stdlib.py line 65) but no test anywhere verifies it is set — not here and not elsewhere in the test suite.


⏱ 2m 41s · 368.1k in / 16.4k out · $0.65

Annotations

Check warning on line 66 in sentry_sdk/integrations/stdlib.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: code-review

process.runtime.description only set on segment as side effect of event capture, not unconditionally like the other runtime attributes

Mutating a span attribute inside `add_global_event_processor` means `process.runtime.description` is only stamped on the segment when at least one non-span event (error, log, etc.) is captured during the trace. Traces that complete without any captured events will be missing this attribute, while `process.runtime.name` and `process.runtime.version` are always present via `scope.set_global_attributes()`. Consider adding `process.runtime.description` to `set_global_attributes()` in `scope.py` alongside the other two runtime attributes instead.