feat(traceloop-sdk): add HTTPX instrumentation support#4351
Conversation
Adds Instruments.HTTPCLIENT to enable httpx client tracing via opentelemetry-instrumentation-httpx. This implements feature request from issue traceloop#2283. Changes: - Add HTTPCLIENT = 'httpclient' to Instruments enum - Add init_httpclient_instrumentor() function - Add httpx instrumentation init in _initialize_instrument() - Add opentelemetry-instrumentation-httpx as a dependency Closes traceloop#2283
|
Abhiram seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds HTTPX client instrumentation support to the traceloop-sdk. A new ChangesHTTPX Instrumentation Support
Estimated code review effort: 1 (Trivial) | ~5 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant init_instrumentations
participant init_httpclient_instrumentor
participant HTTPXClientInstrumentor
Caller->>init_instrumentations: Instruments.HTTPCLIENT
init_instrumentations->>init_httpclient_instrumentor: call
init_httpclient_instrumentor->>HTTPXClientInstrumentor: instrument()
HTTPXClientInstrumentor-->>init_httpclient_instrumentor: success/failure
init_httpclient_instrumentor-->>init_instrumentations: return True/False
Related issues: Suggested labels: enhancement, feature Suggested reviewers: nirga 🐰 A rabbit hopped through httpx's door, Instrumented calls it never wired before, An enum grew, a package too, Tracing now sees requests anew, Hop, hop, hooray — one dependency more!🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds HTTPX client instrumentation support to OpenLLMetry, implementing feature request from issue #2283.
Changes
Instruments.HTTPCLIENT = 'httpclient'to the Instruments enuminit_httpclient_instrumentor()function that initializesHTTPXClientInstrumentor_initialize_instrument()dispatcheropentelemetry-instrumentation-httpx>=0.59b0as a dependency in pyproject.tomlUsage
Closes
Closes #2283
Summary by CodeRabbit