App insights doubling some metrics

Harrison Henri 5 Reputation points
2025-01-21T19:11:56.89+00:00

Hi everyone,

I have a NodeJS api deployed in a container app instrumented with App Insights:

User's image

However, exploring the dashboards I noticed something strange. I get 8 requests failed:User's image

even when the logs only show 4 requests with status 400:

User's image

Does anyone know what's happening?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,428 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Stanislav Zhelyazkov 25,491 Reputation points MVP
    2025-01-22T06:48:58.5966667+00:00

    Hi,

    I think you have Application Insights sampling enabled. In such case some similar requests (even failed ones) will be put into single record in the table. Each record in the requests table will have column itemCount with certain value. So when you count the records you need to count the sum of itemCount. For example:

    requests
    | summarize count(itemCount)
    

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.