Skip to content

[bug] Parent context not set in kafka consume and process message async helper #3995

@padzikm

Description

@padzikm

Component

OpenTelemetry.Instrumentation.ConfluentKafka

Package Version

all version 1.15.*

Runtime Version

.net10

Description

Activity created for handling kafka message doesn't keep context passed from kafka message. Reason - parent context is set to default instead of extracted context from propagation context - https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/src/OpenTelemetry.Instrumentation.ConfluentKafka/OpenTelemetryConsumeResultExtensions.cs#L143

Steps to Reproduce

Instrumented kafka consumer and using ConsumeAndProcessMessageAsync helper method to consume message - https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/src/OpenTelemetry.Instrumentation.ConfluentKafka/OpenTelemetryConsumeResultExtensions.cs#L73

Expected Result

Created activity should have trace id the same as passed in traceparent kafka message header

Actual Result

Created activity has different trace id than passed in traceparent kafka message header

Additional Context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions