Open Q&A
If there's no good subforum for your question - ask it here!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to query on a micrometer timer metric with respect to count, min and max separately

amitkumar4
Newcomer

Hi team,

My app is currently sending a timer metric in the following form to Dynatrace - 

http.server.requests,app=ob-workload-executor,dt.metrics.source=micrometer, uri=/actuator/health gauge,min=149,max=491,sum=2834,count=11 1777882147110

http.server.requests,app=ob-workload-executor,dt.metrics.source=micrometer, uri=/actuator/health gauge,min=157,max=390,sum=2695,count=11 1777882207112


Now i want to calculate the the total number of requests to the endpoint in the last 1 hour, which should be around 60 * 11, as i get around 11 requests to this endpoint every minute. So i tried the following query in a notebook,

timeseries val = count(http.server.requests),
  filter: {
    k8s.pod.name == "ob-workload-executor-599dcc694f-86fdk" and
    uri == "/actuator/health"
  },
  from: now()-1h,
  interval: 1m


But the result looks like this - 

amitkumar4_0-1777907931219.png

My queries are -
a) How to get the total request count over the last 1 hour correctly ? 
b) Also when searching for metric names in the data explorer classic tab, i only see the metric name - http.server.requests and not each of them separately like - "http.server.requests.count", "http.server.requests.max" etc and hence unable to query specifically with these metric names.



 

1 REPLY 1

dannemca
DynaMight Guru
DynaMight Guru

You are getting 1 as count because you are counting the number of entries for this metric. Not the value for dimension "count".

I am afraid that you will need to change the way you are sending the values for this custom metric, and create one metric for each value (one for count, other for min, other for max, etc).

The way you are sending now, you are getting only one value, the "1777882207112", for example in your last one. All others are dimension values, and will not be used by your aggregation, but as filter.

Site Reliability Engineer @ Kyndryl

Featured Posts