2

I'd like to measure avg request-response time for my webserver.

Apm has transaction.duration.us and it seems this could be the metric I'm looking for.

But I coulnd't find the documentation what it is.

Where can I find the meaning of the variable?

eugene
  • 39,839
  • 68
  • 255
  • 489

1 Answers1

2

transaction.duration.us should indeed be what you're looking for. It's the duration in microseconds as an integer. Divide it by 1000 to get milliseconds, or by 1'000'000 to get seconds.

https://www.elastic.co/guide/en/apm/server/7.9/exported-fields-apm-transaction.html#_duration_2

Benjamin Wohlwend
  • 30,958
  • 11
  • 90
  • 100
  • I have hardtime understanding difference between transaction and span.. oh well, it's a good news. For 15 min, I have about 80k data points in apm-* , and when I filter by `url.path:*` it drops to 1k .. Although I think it's reasonable to assume I want to measure requests which has `url.path` . I'm little concerned because the # of event with `url.path` is so low. Do you think it's reasonable? – eugene Aug 25 '20 at 09:38
  • 1
    A transaction represents a full request/response cycle, while a span represents one thing happening during a transaction (e.g. a query to a database, or a request to an external API). You definitely should have much more spans than transactions in Elasticsearch, so that sounds good. – Benjamin Wohlwend Aug 25 '20 at 12:44
  • Do you think it's reasonable to assume that avg response time = avg `transaction.duration.us` of transactions where `url.path` exists? – eugene Aug 25 '20 at 13:40
  • 1
    you could also look at `transaction.type`, which should be `"request"` for all HTTP transactions – Benjamin Wohlwend Aug 25 '20 at 14:53