Requirements
Currently, the TraceEnricherHook hook creates a span event on the active span. This is in line with the OpenTelemetry semantic convention. However, in some cases, it's preferred to have a span instead of a span event. The hook should take an optional configuration that allows users to opt into a span instead of a span event. The default behavior should remain a span event but this would provide additional flexibility without minimal maintenance effort.
Proposal
- Add an option to the
TraceEnricherHook hook that allows users to choose between span events or spans. It must default to span events if unspecified.
- If spans are selected:
- a span is started in the before hook and passed via hook data.
- the span is fetched from hook data, attributes are added, and the span is closed
- If span events are selected:
- a span is NOT created in the before hook
- a span event is added to the current span
Requirements
Currently, the
TraceEnricherHookhook creates a span event on the active span. This is in line with the OpenTelemetry semantic convention. However, in some cases, it's preferred to have a span instead of a span event. The hook should take an optional configuration that allows users to opt into a span instead of a span event. The default behavior should remain a span event but this would provide additional flexibility without minimal maintenance effort.Proposal
TraceEnricherHookhook that allows users to choose between span events or spans. It must default to span events if unspecified.