'Micrometer timer metrics coming as 0 in application insights

We are publishing micrometer counter and timer metrics from our azure app to application insight. We are counting hits to an API and the time it took to process the request in the micrometer counter and timer. The metrics are coming properly in local environment as seen in the jconsole screenshot Timer metrics coming properly in local debugging

However, when viewed in azure application insight, there are a few observations:

  • The timer metrics value is mostly 0.
  • Micrometer counter and timer are updated when a request hits the API. However, we see that the counter metric is captured in application insight at a regular interval but the timer metric is captured only when a request comes. We see this by looking for the timer and counter metrics in the customMetrics table.

Timer metrics mostly are 0 in azure AI

Can someone please help us to resolve these issues?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source