I am using ADOT.
whats the difference between http_server_request_duration_seconds_count vs http_server_requests_seconds_count
.net application has metric http_server_request_duration_seconds_count and java has - http_server_requests_seconds_count
I am using ADOT.
whats the difference between http_server_request_duration_seconds_count vs http_server_requests_seconds_count
.net application has metric http_server_request_duration_seconds_count and java has - http_server_requests_seconds_count
Hi,
I guess those are metrics exposed by some framework (in Java it would be spring + micrometer and I guess ADOT is a micrometer for .Net?). Anyway, they both should expose their metrics on some endpoint of the application (like /metrics
or so). Can you look there to see the type of metrics? If they are the same (e.g. both histogram or both counters - although histogram is a bit more probable), the difference would be purely in names. There also should be some kind of help that would describe the metric.
You can start by checking there and, if it still doesn’t answer your question, could you paste the help for the metric? I’m like 60% sure they just have different names and that’s it.
I am using this query to count no of api calls but it’s showing incorrect data.
round(sum by (uri) (increase(http_server_requests_seconds_count{uri=“”,method=“GET”,job=“ABC-Service",status=“200”} [$__range])))
Same query for .net part gives me correct api volume.
round(sum(increase(http_server_request_duration_seconds_count{http_route=“”}[$__range])) by (http_route))
What do you mean by incorrect? Did you run some tests in your Java app, so you know how many requests there should be and there are none? What’s the expected result and what is being shown by the query?
BTW by doing:
sum by (uri)
you want to get number of requests per uri, but in your selector:
http_server_requests_seconds_count{uri=“”,method=“GET”,job=“ABC-Service",status=“200”}
you’re selecting only empty uri
here some more detailed info.
Are you sure that there’s nothing else sending requests to that URL in Java? The queries are correct and should show the number of requests (although it seems strange to have over 2k requests) - what is the value of $__range
(you can check that in Query) in both cases? Also, can you check the endpoint with the metrics and see the HELP section of the metric? What framework do you use in Java? Springboot?
thanks, I checked and $__range is same for both .Net and Java. We are using ADOT collector for java. Springboot version 2.4