open-telemetry / open-telemetry/opentelemetry-ruby
Add `OnEnding` callback to allow processors to mutate spans on the end
@pantuza is already working on this.
Since Aug 28, 2024.
- Dominant language
- Ruby
- Stars
- 606
- Forks
- 301
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 42
Description
OnEnding
Status: Development
OnEndingis called during the span End() operation, after the end timestamp has been set. The Span object is still mutable (i.e.,SetAttribute,AddLink,AddEventcan be called) whileOnEndingis called. This method MUST be called synchronously within theSpan.End()API, therefore it should not block or throw an exception. If multipleSpanProcessorsare registered, theirOnEndingcallbacks 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 invokingOnEndingof the firstSpanProcessor. From that point on, modifications are only allowed synchronously from within the invokedOnEndingcallbacks. All registeredSpanProcessorOnEndingcallbacks are executed before anySpanProcessor'sOnEndcallback 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: https://github.com/open-telemetry/opentelemetry-specification/pull/4024
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.