-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
area: sdkThis issue or pull request relates to an SDKThis issue or pull request relates to an SDKarea: telemetry-hooksImprovements or bugs to telemetry hooksImprovements or bugs to telemetry hookstype: featNew featureNew feature
Description
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
TraceEnricherHookhook 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
Metadata
Metadata
Assignees
Labels
area: sdkThis issue or pull request relates to an SDKThis issue or pull request relates to an SDKarea: telemetry-hooksImprovements or bugs to telemetry hooksImprovements or bugs to telemetry hookstype: featNew featureNew feature