-
Notifications
You must be signed in to change notification settings - Fork 822
Open
Labels
bugSomething isn't workingSomething isn't working
Description
When updating httpx instrumentation, I found there was a (likely unintended) breaking change.
I found it because my app broke when it crashed on trying to read url.host in a request hook. AFAIK, this is incompliant with the spec which expects instrumentation to never cause app crashes, even in the face of broken user callbacks. Probably any user callback needs to be wrapped in a exception handler that optionally logs the error without failing completely.
The code that crashed, looks like
async def _httpx_span_name_hook(span: Span, request: RequestInfo):
span.update_name(f"{request.method.decode()} {request.url.host}")
def _httpx_span_name_hook_sync(span: Span, request: RequestInfo):
span.update_name(f"{request.method.decode()} {request.url.host}")
HTTPXClientInstrumentor().instrument(
async_request_hook=_httpx_span_name_hook,
request_hook=_httpx_span_name_hook_sync,
)ods, ebracho and Steffen911
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working