如何禁用自定义事件的数据采样,但将其保留用于请求?

问题描述 投票:1回答:1

我有一个Azure应用服务(网站)网站,它在我的应用程序洞察中记录了大量数据。我喜欢仅对请求进行采样,因为它们有很多,但我需要拥有所有自定义事件,因为它们具有商务价值。我怎样才能做到这一点?

我试过了

应用洞察>使用和估算成本>数据采样

但唯一的选择是为所有事情启用它:

menu

开场后:

menu opened

azure-web-sites azure-application-insights appinsights
1个回答
3
投票

您可以在ApplicationInsights.config文件中配置自定义采样率。在那里可以从采样中包括或排除特定类型。

例:

<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获取完整的文档。

© www.soinside.com 2019 - 2024. All rights reserved.