Skip to content

fix(sdk): guard Span::setAttributes() against mutation after end()#1999

Merged
bobstrecansky merged 1 commit into
open-telemetry:mainfrom
jorgsowa:fix/span-set-attributes-after-end
Jul 6, 2026
Merged

fix(sdk): guard Span::setAttributes() against mutation after end()#1999
bobstrecansky merged 1 commit into
open-telemetry:mainfrom
jorgsowa:fix/span-set-attributes-after-end

Conversation

@jorgsowa

@jorgsowa jorgsowa commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

setAttribute() already no-ops once a span has ended, but setAttributes() lacked the same hasEnded guard, letting attributes leak in after end() in violation of the OTel spec.

setAttribute() already no-ops once a span has ended, but setAttributes()
lacked the same hasEnded guard, letting attributes leak in after end()
in violation of the OTel spec.
@jorgsowa
jorgsowa requested a review from a team as a code owner July 1, 2026 19:49
@ChrisLightfootWild
ChrisLightfootWild requested a review from a team July 1, 2026 22:24
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.08%. Comparing base (6cb4156) to head (74d56cc).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1999      +/-   ##
============================================
+ Coverage     68.02%   68.08%   +0.06%     
- Complexity     3075     3077       +2     
============================================
  Files           459      459              
  Lines          9017     9022       +5     
============================================
+ Hits           6134     6143       +9     
+ Misses         2883     2879       -4     
Flag Coverage Δ
8.1 67.80% <100.00%> (+0.07%) ⬆️
8.2 67.92% <100.00%> (+0.01%) ⬆️
8.3 67.91% <100.00%> (-0.01%) ⬇️
8.4 67.96% <100.00%> (-0.03%) ⬇️
8.5 67.97% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/SDK/Trace/Span.php 93.78% <100.00%> (+0.07%) ⬆️

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6cb4156...74d56cc. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisLightfootWild
ChrisLightfootWild requested review from a team and removed request for a team July 1, 2026 22:27
@bobstrecansky
bobstrecansky merged commit d174962 into open-telemetry:main Jul 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants