Ashkan S
Ashkan S

Reputation: 11501

How do I disable Data Sampling for Custom Events, but keep it for Requests?

I have a website on Azure app service(website) that logs a lot of data in my application insights. I like to have sampling only for requests, because there are a lot of them, but I need to have all my custom Events as they have a buisiness value. How can I do that?

I've tried the

application insights> Usage and estimated costs > Data Sampling

But the only option is to enable it for everything:

menu

After opening:

menu opened

Upvotes: 3

Views: 1176

Answers (1)

Marc
Marc

Reputation: 3959

You can configure a custom sampling rate in your ApplicationInsights.config file. There it is possible to include or exclude specific types from sampling.

Example:

<Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
  <MaxTelemetryItemsPerSecond>500</MaxTelemetryItemsPerSecond>
  <MaxSamplingPercentage>10.0</MaxSamplingPercentage>
  <MinSamplingPercentage>1.0</MinSamplingPercentage>
  <ExcludedTypes>Event,Exception</ExcludedTypes>
  <IncludedTypes>Request</IncludedTypes>
</Add>

See here for the complete documentation.

Upvotes: 3

Related Questions