gpt4 book ai didi

c# - 我可以告诉 Application Insights 对遥测进行下采样,但不对异常进行采样吗?

转载 作者:太空狗 更新时间:2023-10-30 00:30:08 25 4
gpt4 key购买 nike

我想切换到使用 Application Insights 进行日志记录等。我知道我将需要对我的遥测数据使用采样,以保持在免费计划内。但是,我希望能够看到导致抛出异常的所有 事件序列,以便我可以重现它们。

Application Insights 是否内置了类似的东西?如果没有,有没有什么方法可以编写一个自定义采样器来产生所需的行为?例如。

class CustomSampler : ITelemetrySampler

最佳答案

AdaptiveSamplingTelemetryProcessor 2.2.0 版中有 ExcludeTypes 属性。

<Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
<MaxTelemetryItemsPerSecond>499</MaxTelemetryItemsPerSecond>
<ExcludedTypes>Exception</ExcludedTypes>
</Add>

来自 2.2.0-beta1 的发行说明

Telemetry types can be excluded from sampling by specifying the ExcludedTypes property (Add ExcludedTypes element under AdaptiveSampling telemetry processor node with ';'-separated list. Possible types are "Dependency", "Event", "Exception", "PageView", "Request", "Trace").

https://github.com/Microsoft/ApplicationInsights-dotnet/blob/v2.2.0/src/TelemetryChannels/ServerTelemetryChannel/Shared/AdaptiveSamplingTelemetryProcessor.cs#L67

关于c# - 我可以告诉 Application Insights 对遥测进行下采样,但不对异常进行采样吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41598040/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com