Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OnEnding callback to allow processors to mutate spans on the end #1695

Open
kaylareopelle opened this issue Aug 28, 2024 · 3 comments
Open
Assignees
Labels

Comments

@kaylareopelle
Copy link
Contributor

OnEnding
Status: Development

OnEnding is called during the span End() operation, after the end timestamp has been set. The Span object is still mutable (i.e., SetAttribute, AddLink, AddEvent can be called) while OnEnding is called. This method MUST be called synchronously within the Span.End() API, therefore it should not block or throw an exception. If multiple SpanProcessors are registered, their OnEnding callbacks are invoked in the order they have been registered. The SDK MUST guarantee that the span can no longer be modified by any other thread before invoking OnEnding of the first SpanProcessor. From that point on, modifications are only allowed synchronously from within the invoked OnEnding callbacks. All registered SpanProcessor OnEnding callbacks are executed before any SpanProcessor's OnEnd callback is invoked.

Parameters:

span - a read/write span object for the span which is about to be ended.
Returns: Void

Spec: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#onending
PR describing the Spec: open-telemetry/opentelemetry-specification#4024

@pantuza
Copy link
Contributor

pantuza commented Aug 28, 2024

Hi, @kaylareopelle . I would love to try adding this feature.

@kaylareopelle
Copy link
Contributor Author

Thanks @pantuza! You're assigned 🎉

Copy link
Contributor

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

@github-actions github-actions bot added the stale label Sep 28, 2024
@kaylareopelle kaylareopelle added keep and removed stale labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants