feat(scope): Add process runtime attributes to span context#6564
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
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.