Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
extensions middleware and request extensions #56
extensions middleware and request extensions #56
Changes from 6 commits
11a23fe
89f8da9
5cc716a
f239759
0626167
17cdfe0
001715a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can already be done with existing middleware via
Request::headers_mut
, maybe we should use a more motivating example that's harder to do with theRequest
struct?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can probably elaborate more - this is a client wide setting. Imagine you have a client that has many endpoints but all use the same auth settings, then those can be define in a RequestInitialiser on the top level connection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this example couldn't the
LogName
have been baked intoLoggingMiddleware
. Or if the latter was a shared thing, a wrapper middleware used. I'm not seeing the motivating case for the new abstractions from this example very clearly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I thought I added the extra example. The case is where you might have a client wide extension, and then you can have a per-request configuration too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this is something I want to supplement #54 because I'm not keen on breaking the current
SpanBackend
trait to add&self
just yet, but it does have access to the extensions.The desired configuration by the author was to have client wide configuration of the span name, but I think a request specific span name might be more desirable in some situations. So this is the best of both worlds for configuration