router icon indicating copy to clipboard operation
router copied to clipboard

Missing http.status.response_code when there is a broken pipe error

Open danpayne17 opened this issue 1 year ago • 2 comments

Describe the bug If the caller closes the connection before the router is done sending the response (e.g. broken pipe), the router span never gets tagged with http.status.response_code. Consequently, these are the only requests that do not show any status code in DataDog.

To Reproduce Steps to reproduce the behavior:

  1. Insert code into a subgraph resolver so that it waits 10 seconds before responding to requests from router
  2. Send request to router using curl
  3. Cancel request (ctrl-c) while subgraph is waiting to respond which induces a broken pipe error
  4. Observe in DataDog that the trace for the above request has no status code

Expected behavior Every trace should have a response status code so that DataDog queries can use the status code as a predicate

Router:

  • OS: Amazon Linux 2023
  • Version: 1.37.0

danpayne17 avatar Feb 07 '24 16:02 danpayne17

Just wondering if status code 499 would be appropriate here? It's non-standard, but widely used because of nginx.

BrynCooke avatar Mar 08 '24 11:03 BrynCooke

Yes, I think 499 status code would be a good fit and would certainly work for us

danpayne17 avatar Mar 08 '24 22:03 danpayne17