-
Notifications
You must be signed in to change notification settings - Fork 468
Closed
Labels
Description
Summary of problem
When using ASGI TraceMiddleware the response headers are not processed into a trace.
Which version of dd-trace-py are you using?
1.5.3 but the same problem is in previous versions
How can we reproduce your problem?
- Setup a minimal ASGI application using
TraceMiddlewarethat is responding with known a header - add this header to the
ddtrace.config.trace_headers() - produce a trace
Produced trace has only request headers (http.request.headers.*) but no response header (http.response.headers.*).
Probable cause
I did a little digging up and found that code is using response headers directly from ASGI http.response.start message (see code). However those headers are not strings but bytes so they are not picked up ("the-header" != b"the-header"). This part requires the same treatment as request headers (see code).
I will try to create PR for it if you don't mind.