Skip to content

feat: Implement UrlInfo trait for URL handling in HTTP instrumentation#189

Open
lbeschastny wants to merge 2 commits intomainfrom
feature/url-info
Open

feat: Implement UrlInfo trait for URL handling in HTTP instrumentation#189
lbeschastny wants to merge 2 commits intomainfrom
feature/url-info

Conversation

@lbeschastny
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 UrlInfo trait to provide URL components (full URL, path, host, scheme, port, query) as span attribute values.
  • Updates HttpClientSpanBuilder::from_parts to accept &impl UrlInfo and builds attributes via a small helper to reduce repetitive conditional pushes.
  • Implements UrlInfo for url::Url in 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.

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.

3 participants