Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Kafka consumers include trace_id in log context #121

Merged
merged 3 commits into from
Oct 2, 2023
Merged

Conversation

pbrisbin
Copy link
Member

@pbrisbin pbrisbin commented Oct 2, 2023

Centralize adding TraceId to the logging context

34671b2

This commit adds some functions to OpenTelemetry for working with the
current trace-id as converted to Datadog's format and for the purposes
of setting the log context. It's then re-used in the Middleware from
which it was extracted.

This will allow us to do the same thing in other persistent-process
runners, such as Kafka consumers, just like we do in APIs through the
middleware.

Wrap runConsumer in withTraceIdContext

98da8d6

This will ensure consumer logs all contain the current trace_id.

Version bump

This commit adds some functions to OpenTelemetry for working with the
current trace-id as converted to Datadog's format and for the purposes
of setting the log context. It's then re-used in the Middleware from
which it was extracted.

This will allow us to do the same thing in other persistent-process
runners, such as Kafka consumers, just like we do in APIs through the
middleware.
This will ensure consumer logs all contain the current `trace_id`.
@pbrisbin pbrisbin changed the title pb/trace id Ensure Kafka consumers include trace_id in log context Oct 2, 2023
@pbrisbin pbrisbin requested a review from z0isch October 2, 2023 20:24
@pbrisbin pbrisbin marked this pull request as ready for review October 2, 2023 20:24
@pbrisbin pbrisbin merged commit 5b689a4 into main Oct 2, 2023
8 checks passed
@pbrisbin pbrisbin deleted the pb/trace-id branch October 2, 2023 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants