Skip to content

Conversation

majanjua-amzn
Copy link

@majanjua-amzn majanjua-amzn commented Oct 16, 2025

Fixes: N/A
Design discussion issue: open-telemetry/opentelemetry-specification#4024

Changes

Changes based loosely on the same changes made to opentelemetry-java: open-telemetry/opentelemetry-java#6367

This change creates a new ExtendedBaseProcessor that allows users to implement onEnding functionality to their processor, as per the spec: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#onending

Specific changes:

  • Changed CompositeProcessor to be extended from the new ExtendedBaseProcessor to support processors that have OnEnding
  • Created new ExtendedBaseProcessor as the place where this functionality is added, so as to not break any current experience of extending the normal BaseProcessor
  • Updated TestActivityProcessor to extend the new OnEnding method while being agnostic to it for tests that don't need it
  • Updated unit tests to verify the running order of the span lifecycle is correct and includes the OnEnding invocation

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@majanjua-amzn majanjua-amzn requested a review from a team as a code owner October 16, 2025 22:42
@github-actions github-actions bot added the pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package label Oct 16, 2025
@majanjua-amzn majanjua-amzn force-pushed the main branch 3 times, most recently from 3253503 to 85231aa Compare October 20, 2025 20:46
This change creates a new ExtendedBaseProcessor that allows users
to implement onEnding functionality to their processor, as per
the spec: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#onending
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.71%. Comparing base (cb8d9e9) to head (e108c44).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/OpenTelemetry/ExtendedBaseProcessor.cs 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #6617   +/-   ##
=======================================
  Coverage   86.70%   86.71%           
=======================================
  Files         258      259    +1     
  Lines       11955    11970   +15     
=======================================
+ Hits        10366    10380   +14     
- Misses       1589     1590    +1     
Flag Coverage Δ
unittests-Project-Experimental 86.66% <93.33%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
src/OpenTelemetry/CompositeProcessor.cs 95.83% <100.00%> (+0.24%) ⬆️
src/OpenTelemetry/Trace/TracerProviderSdk.cs 99.38% <100.00%> (+0.01%) ⬆️
src/OpenTelemetry/ExtendedBaseProcessor.cs 0.00% <0.00%> (ø)

@Kielek
Copy link
Member

Kielek commented Oct 21, 2025

This feature is still in development phase. It means that we cannot include it into stable releases for this package.
We have possibility to make it happen for unstable versions.

You can make full search for OTEL1000 in this repository. In this way you can find an example how to implement conditional compilation + required documentation.
OTEL1005 is the first available code at the moment.

Another thing for consideration: double check if it is not breaking change on binary level when you are introducing new class to the inheritance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants