Add `OnEnding` callback to allow processors to mutate spans on the end
OnEndingStatus: 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
Hi, @kaylareopelle . I would love to try adding this feature.
Thanks @pantuza! You're assigned 🎉
👋 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.