Skip to content

httpx: fix httpcore instrumentation handling of default port#2669

Merged
xrmx merged 1 commit into
elastic:mainfrom
xrmx:fix-issue-2667
Jun 4, 2026
Merged

httpx: fix httpcore instrumentation handling of default port#2669
xrmx merged 1 commit into
elastic:mainfrom
xrmx:fix-issue-2667

Conversation

@xrmx
Copy link
Copy Markdown
Member

@xrmx xrmx commented Jun 3, 2026

What does this pull request do?

Fix both sync and async instrumentation handling of the default port. If the port is set by the client it would be None so we should treat it as the default one.

The async instrumentation also contained a typo when building the url.

This has gone unnoticed since the tests using httpx will create DroppedSpans for httpcore spans.

Related issues

Closes #2667

@xrmx xrmx requested a review from a team as a code owner June 3, 2026 16:12
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@xrmx xrmx force-pushed the fix-issue-2667 branch 2 times, most recently from b2420c6 to a759069 Compare June 3, 2026 16:26
Fix both sync and async instrumentation handling of the default port.
If the port is set by the client it would be None so we should treat
it as the default one.

The async instrumentation also contained a typo when building the url.

This has gone unnoticed since the tests using httpx will create
DroppedSpans for httpcore spans.
@xrmx xrmx force-pushed the fix-issue-2667 branch from a759069 to 917cb72 Compare June 3, 2026 16:31
@xrmx xrmx merged commit 2950f84 into elastic:main Jun 4, 2026
99 checks passed
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.

httpcore async instrumentation builds malformed URL and crashes urllib when parent httpx span is dropped

2 participants