Skip to content

Add support for tracing in PubSub for non-cloud events for PubSub providers which support headers #7918

Description

@passuied

In what area(s)?

/area runtime

Describe the feature

Dapr PubSub currently doesn't support tracing for PubSub unless the message uses the CloudEvent standard.
This is not ideal for legacy events or even when using a Schema Registry as CloudEvents are not supported.

PubSub providers (e.g. Kafka) typically include headers that can be leveraged to store tracing headers. Headers get exposed as metadata in Dapr. It would therefore be possible to leverage headers for tracing moving forward for this purpose.
The proposed change would include 2 areas:

  • When consuming a message and upon publishing it to an HTTP/gRPC endpoint:
    • If RawPayload = true, we can search for the presence of traceparent in the metadata and run the same logic that currently happens in CloudEvents
  • When publishing a message, if tracing is enabled and RawPayload = true and traceparent is NOT in metadata, it can automatically be added to the metadata, making it available in the headers of the published message.
    • Please note that if a traceparent header is already present in the metadata, it would already be saved as a header, so this part is unchanged.
    • In the case of a CloudEvent, that traceparent metadata would be injected to the cloud event.

Release Note

RELEASE NOTE: ADD support for tracing in PubSub for non-cloud events for PubSub providers which support headers.

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