You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a node:http client request is initiated with parameters that cause a synchronous error to be thrown, dd-trace will not finish the instrumented http client span, preventing otherwise-completed traces from being submitted to the Agent, as the child spans are never finished. The example that triggered this issue for us was an inadvertent newline that crept into a header due to a bad config value. The problem went unnoticed for a bit because without traces, we weren't getting error metrics from our endpoint traces alerting us to the issue.
This behavior might be intentional, but I'm not sure what we'd expect to do here. The entire trace getting swallowed is very unexpected.
Expected behaviour
Parent traces (at the very least) are submitted to DataDog for ingestion.
Actual behaviour
No trace is submitted.
Steps to reproduce
I set up a repro in this repo: https://github.com/ndresselhaus/dd-trace-http-bug. It's a simple Express app that can conditionally trigger an HTTP request with a BadHeader value that will cause node:http to throw Invalid character in header content, which is interpreted as an HTTP 500 status from express.
The trace debug logs enabled is DD_TRACE_DEBUG=true demonstrated the behavior:
Encoded payload / Request sent to agent trace logs when there's a regular HTTP client 500 error.
No such logs when the synchronous "invalid header content" error resulted in no request actually being made.
The text was updated successfully, but these errors were encountered:
If a
node:http
client request is initiated with parameters that cause a synchronous error to be thrown, dd-trace will not finish the instrumentedhttp
client span, preventing otherwise-completed traces from being submitted to the Agent, as the child spans are never finished. The example that triggered this issue for us was an inadvertent newline that crept into a header due to a bad config value. The problem went unnoticed for a bit because without traces, we weren't getting error metrics from our endpoint traces alerting us to the issue.This behavior might be intentional, but I'm not sure what we'd expect to do here. The entire trace getting swallowed is very unexpected.
Expected behaviour
Parent traces (at the very least) are submitted to DataDog for ingestion.
Actual behaviour
No trace is submitted.
Steps to reproduce
I set up a repro in this repo: https://github.com/ndresselhaus/dd-trace-http-bug. It's a simple Express app that can conditionally trigger an HTTP request with a BadHeader value that will cause
node:http
to throwInvalid character in header content
, which is interpreted as an HTTP 500 status from express.The trace debug logs enabled is
DD_TRACE_DEBUG=true
demonstrated the behavior:Encoded payload
/Request sent to agent
trace logs when there's a regular HTTP client 500 error.The text was updated successfully, but these errors were encountered: