SpanCustomizationHook is a common way for instrumentations to expose extension points
where users can add custom behavior to a span based on info object passed to the hook at different times of the span lifecycle.
This is an advanced feature, commonly used to add additional or non-spec-compliant attributes to the span,
capture payloads, modify the span in some way, or carry some other side effect.
The hook is registered with the instrumentation specific config by implementing an handler function with this signature,
and if the hook is present, it will be called with the span and the event information
when the event is emitted.
When and under what conditions the hook is called and what data is passed
in the info argument, is specific to each instrumentation and life-cycle event
and should be documented where it is used.
Instrumentation may define multiple hooks, for different spans, or different span life-cycle events.
SpanCustomizationHook is a common way for instrumentations to expose extension points where users can add custom behavior to a span based on info object passed to the hook at different times of the span lifecycle. This is an advanced feature, commonly used to add additional or non-spec-compliant attributes to the span, capture payloads, modify the span in some way, or carry some other side effect.
The hook is registered with the instrumentation specific config by implementing an handler function with this signature, and if the hook is present, it will be called with the span and the event information when the event is emitted.
When and under what conditions the hook is called and what data is passed in the info argument, is specific to each instrumentation and life-cycle event and should be documented where it is used.
Instrumentation may define multiple hooks, for different spans, or different span life-cycle events.