feat: Implement UrlInfo trait for URL handling in HTTP instrumentation#189
Open
lbeschastny wants to merge 2 commits intomainfrom
Open
feat: Implement UrlInfo trait for URL handling in HTTP instrumentation#189lbeschastny wants to merge 2 commits intomainfrom
lbeschastny wants to merge 2 commits intomainfrom
Conversation
Travispersson
approved these changes
Apr 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors reqwest HTTP client instrumentation to decouple URL attribute extraction behind a new UrlInfo trait, enabling flexible URL handling while keeping span creation logic centralized.
Changes:
- Introduces a
UrlInfotrait to provide URL components (full URL, path, host, scheme, port, query) as span attribute values. - Updates
HttpClientSpanBuilder::from_partsto accept&impl UrlInfoand builds attributes via a small helper to reduce repetitive conditional pushes. - Implements
UrlInfoforurl::Urlin the reqwest instrumentation module.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/instrumentations/http/reqwest.rs |
Implements UrlInfo for url::Url so reqwest requests can supply URL components to span building. |
src/instrumentations/http/client.rs |
Adds UrlInfo + as_attribute helper and refactors span attribute construction to use the trait. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.