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

feat(tonic): pass trace_fn the request rather than just the headers #634

Merged
merged 1 commit into from
May 12, 2021

Conversation

davidpdrsn
Copy link
Member

Previously Server::trace_fn would receive &HeaderMap which meant you
couldn't add things like the URI to the span.

With this change it now receives &http::Request<()>. It doesn't
receive the body since that requires an additional generic parameter
which spreads to a lot of places. There also isn't much you can do with
the body of a borrowed http::Request anyways so its probably fine.

Fixes #630

Previously `Server::trace_fn` would receive `&HeaderMap` which meant you
couldn't add things like the URI to the span.

With this change it now receives `&http::Request<()>`. It doesn't
receive the body since that requires an additional generic parameter
which spreads to a lot of places. There also isn't much you can do with
the body of a borrowed `http::Request` anyways so its probably fine.
@davidpdrsn davidpdrsn added this to the 0.5 milestone May 11, 2021
@davidpdrsn davidpdrsn merged commit 7862a22 into master May 12, 2021
@davidpdrsn davidpdrsn deleted the david/trace-fn-receive-request branch May 12, 2021 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server::trace_fn should receive full request, not just headers
2 participants