Skip to content

Kafka consumer doesn't use context from ConsumerRecord Headers #3397

Open
@gbiv

Description

@gbiv

I'm using Alpakka in a scala service to subscribe to topics.
I'm seeing that the ConsumerRecords that are being processed in my Flow have the correct header values for x-datadog-trace-id and x-datadog-parent-id however values for mdc.dd.span_id and mdc.dd.trace_id are completely different than those in the headers for the same call.
Screen Shot 2022-02-16 at 1 09 15 PM

This causes any calls to other services, via grpc for example, to appear as new traces rather than continuations of the originating trace.
I've tried extracting the header values and then setting appropriate values as Metadata on my grpc client calls but I haven't found sufficient information/API to tie things together properly.

I've just updated to 0.95.0 and am seeing the same behavior. It does sound similar to the behavior described in this reported issue but I'm using scala and Alpakka so I'm reporting it separately.
Is this the expected behavior, ie that a new trace is created for a kafka.conusme operation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions