Reputation: 832
I have an Azure Function linked with Application Insights. I log in AppInsights several business data and I can have a lot of instances of my function running during a short period of time.
I read the documentation of Data Sampling in AppInsights and I want to know: Can I lose data because of this data sampling algorithm?
Upvotes: 6
Views: 15593
Reputation: 2154
Regarding App Insights Sampling for Azure Functions from the docs:
"Application Insights has a sampling feature that can protect you from producing too much telemetry data at times of peak load. When the number of telemetry items exceeds a specified rate, Application Insights starts to randomly ignore some of the incoming items. The default setting for maximum number of items per second is 5. You can configure sampling in host.json."
You can configure or disable sampling using the host.json
{
"applicationInsights": {
"sampling": {
"isEnabled": true,
"maxTelemetryItemsPerSecond" : 5
}
}
}
If the logs are very critical, you also need to consider the aggregation process, which could lead to missing traces in re-cycles, etc.
HTH
Upvotes: 4
Reputation: 29830
I want to know if I can lose data because of this data sampling algorithm? -> Yes, that is the whole point of sampling:
Sampling retains 1 in n records and discards the rest. For example, it might retain 1 in 5 events, a sampling rate of 20%.
If all data is critical for your logging/analysis purposes you should not apply sampling, or at least limit it.
There should be enough material in the link of your question to tell you how to enable/disable sampling and how to check whether it is applies currently.
Note that metrics by default are not sampled:
Application Insights does not sample metrics and sessions telemetry types
Upvotes: 8