question

GeorgeLuizBittencourt-4143 avatar image
0 Votes"
GeorgeLuizBittencourt-4143 asked GeorgeLuizBittencourt-4143 commented

Application Insights Sampling

Hello,

I am about to use Application Insights to calculate some metrics about our response time and I am afraid that sampling might impact our metrics.
My question is very simple, if I have a record on the request table and the itemCount is 5 and this request has failed, the other 4 requests were not saved because sampling might have been completed successfully

The itemCount counts the number of records discarded, but they might be completely different from the one that got saved.
Is that understanding correct?

Thanks,

azure-monitor
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AnuragSingh-MSFT avatar image
0 Votes"
AnuragSingh-MSFT answered GeorgeLuizBittencourt-4143 commented

Hi @GeorgeLuizBittencourt-4143

Welcome to Microsoft Q&A! Thanks for posting the question.

Yes, your understanding is almost correct - with one modification. itemCount=<sampling ratio>. Therefore, based on the example in question, for a record if itemCount is 5 - it would mean that this single record represents 5 telemetry (4 of which were sampled out). Thus itemCount=<sampling ratio> = 5/1 = 5. Also, the sampled record (both the stored one as well as the discarded out ones) will be independent of each other. The App Insights SDK, however, samples based on operation_Id, meaning that an operation_Id is selected and all of the telemetry for that single operation are ingested and saved (not random individual records). This enables the end-to-end transaction view of the stored telemetry record.

You may refer to the following links for more details:

1. How sampling works - The example scenario should help clear much of the doubts.
2. StackOverFlow discussion for "Azure App Insights Sampling (ItemCount)"

Please let me know if you have any questions.


Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks,

In this case, just to make sure I understood correctly, if I got 5 requests and 4 were successfully and AI randomly selected the failed one to be saved, then my metrics may be impacted if I am looking for the successful requests.

So in my case, the best would be to disable sampling at all to avoid any impact on my metrics.

Thanks,

0 Votes 0 ·