Skip to content

Conversation

@c2h5oh
Copy link
Contributor

@c2h5oh c2h5oh commented Dec 5, 2024

To get tracing across services one has to propagate tracing headers downstream.

This PR adds a middleware copies tracing headers into request context and provides a function to add those headers to any requests you are creating to other services without having to pass around the entire request - context is enough.

Comment on lines +19 to +21
if len(traceHeaders) == 0 {
traceHeaders = defaultTraceHeaders
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not put any defaults here but rather export the defaultTraceHeaders so from caller perspective it is clearer what is being done.

Copy link

@Pipello Pipello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comments for the documentation?

It would also be nice to add some unit tests

@VojtechVitek VojtechVitek self-requested a review December 15, 2024 22:18
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