-
Notifications
You must be signed in to change notification settings - Fork 798
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe your environment
OS: Windows-10-10.0.22631-SP0
Python version: Python 3.12.3
Package version: opentelemetry-instrumentation-httpx="0.46b0"
What happened?
I instrumented httpx after some httpx clients being initialized, and then isinstance(client, Client)
failed.
I admit that instrumenting code should ideally be placed before any other code, but I hope that even if it is not done this way, it will result in no errors if possible.
Related to pydantic/logfire#264
Steps to Reproduce
from httpx import Client
client = Client()
from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor
HTTPXClientInstrumentor().instrument()
from httpx import Client
isinstance(client, Client)
Expected Result
True
Actual Result
False
Additional context
Maybe we can use an non-subclassing approach, like patching methods on the original class.
Would you like to implement a fix?
Being open to
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working