dd-trace-rb icon indicating copy to clipboard operation
dd-trace-rb copied to clipboard

HTTP request queuing duration

Open ib-drct-dev opened this issue 2 years ago • 0 comments

I want to measure how much a request waits in a queue until it is served by an app.

There is a way to generate traces that include the time spent in a queue. The instrumentation produces http_server.queue.duration metric. Which is not exactly I need and expect.

  1. Is it possible to compute queue waiting time some how from the information we have? I thought about subtracting http_server.queue.duration from rack.request.duration but http_server.queue.duration filters out some traces so aggregated duration values could be skewed and we won't get accurate values. Maybe there are other options?
  2. Maybe it's possible to add another metric which subtracts X-Request-Start from the time a request has arrived in an app?
  3. Why the produced metric is called http_server.queue.duration even it does not compute queue waiting time? Wouldn't http_server.request.duration be more accurate name?

https://docs.datadoghq.com/tracing/setup_overview/setup/ruby/#http-request-queuing https://github.com/DataDog/dd-trace-rb/blob/3cbcea6f1fd240de00200b7135c907f3fd194c9a/lib/datadog/tracing/contrib/rack/middlewares.rb#L116

Thanks!

ib-drct-dev avatar Jun 02 '22 09:06 ib-drct-dev