feat: add httpx2 instrumentation - #2706
Conversation
Closes elastic#2696 Mirror httpx/httpcore instrumentation for httpx2/httpcore2 with sync/async Client.send spans, distributed tracing header injection, tests, docs, and CI (Python 3.10+).
|
❌ Author of the following commits did not sign a Contributor Agreement: Please, read and sign the above mentioned agreement if you want to contribute to this project |
🤖 GitHub commentsJust comment with:
|
|
CLA check is still failing on my side even after re-signing the Contributor Agreement with GitHub user HosseinNejatiJavaremi and email hosseinnejati14@gmail.com (same email as my merged PR #2682). Happy to re-sign or provide any extra info if needed. Thanks for the review. |
|
@HosseinNejatiJavaremi as I said already please wait for feedback on the issue before opening PRs. |
|
@xrmx Thanks for the feedback. I waited ~3 weeks on #2696 before opening the PR — httpx2 adoption is picking up and I wanted to help move it forward. Happy to close the PR and follow your process on the issue. If the supported path is now OpenTelemetry / EDOT for Python, I’d prefer to migrate there rather than invest more in this repo. If apm-agent-python is still the right place for httpx2, I’m happy to contribute — just need clarity on direction. Thanks. |
Yeah, OpenTelemetry is the way forward and latest upstream release already supports httpx2 instrumentation. Next EDOT release rebased on top of that will also supports that. My suggestion is that if you can migrate please do since more work on newer instrumentations will go into OpenTelemetry |
Summary
httpx2.Client.sendandhttpx2.AsyncClient.sendfor external HTTP spanshttpcore2for distributed tracing header propagationCloses #2696
Test plan
pytest -m httpx2 tests/instrumentation/httpx2_tests.py tests/instrumentation/asyncio_tests/httpx2_tests.py(18 passed)Made with Cursor