Repository navigation
[OpenTelemetry] Release suppression for unrecorded activities - #7966
Conversation
Release the `SuppressInstrumentationScope` reference count when any activity stops, not only activities that are recorded. Assisted-by: Claude Code (Claude Opus 5.5) <noreply@anthropic.com> Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-25IQGHJF.
Add PR number. Assisted-by: Claude Code (Claude Opus 5.5) <noreply@anthropic.com> Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-25IQGHJF.
Pull request dashboard statusMerged · refreshed 2026-10-16 18:44 UTC Status above doesn't look right?
|
There was a problem hiding this comment.
🟢 Approval recommended
Both callback paths are updated consistently, with targeted regression coverage and no identified blocking issues.
0 open findings
What changed in this PR
Fixes persistent instrumentation suppression after unrecorded activities stop in the tracing SDK.
Changes:
- Updates suppression counts regardless of recording status in both callback paths.
- Adds regression tests for unrecorded activities and nested suppression.
- Documents the fix in the SDK changelog.
[!NOTE]
This review was generated with GitHub Copilot.
| File | Description |
|---|---|
| test/OpenTelemetry.Tests/Trace/TracerProviderSdkTests.cs | Adds suppression regression tests and simplifies an assertion. |
| src/OpenTelemetry/Trace/TracerProviderSdk.cs | Balances suppression counts for unrecorded activities. |
| src/OpenTelemetry/CHANGELOG.md | Documents the suppression fix. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7966 +/- ##
=======================================
Coverage 92.39% 92.39%
=======================================
Files 365 365
Lines 21185 21180 -5
=======================================
- Hits 19573 19570 -3
+ Misses 1612 1610 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-25IQGHJF.
Changes
Fix a
SuppressInstrumentationScope.Enter()reference count never being released when theActivityit was entered for is not recorded.The
ActivityStarted/ActivityStoppedcallbacks installed byTracerProviderSdkreturned early whenActivity.IsAllDataRequestedwasfalse, before callingSuppressInstrumentationScope.DecrementIfTriggered(), which is the only place the count taken byEnter()is released. With the defaultParentBased(AlwaysOn)sampler, an unsampled remote parent produces an unrecorded activity. Code that calledEnter()for that activity left its execution context suppressed permanently, so all later spans and logs in that context were dropped.The reference count is now updated when every activity starts and stops, and
IsAllDataRequestedonly decides whether the processor is notified. This is applied to both the legacy and non-legacy callbacks.Merge requirement checklist
CHANGELOG.mdfile(s) updated for non-trivial changesChanges in public API reviewed (if applicable)Note
The changes in this PR and its description were generated with Claude Code (Claude Opus 5.5).
Footnotes
Yes, I can answer maintainer questions about the content of this PR without using AI. ↩