Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 我可以告诉Application Insights下采样遥测,但不能告诉异常吗?_C#_Azure Application Insights_Telemetry - Fatal编程技术网

C# 我可以告诉Application Insights下采样遥测,但不能告诉异常吗?

C# 我可以告诉Application Insights下采样遥测,但不能告诉异常吗?,c#,azure-application-insights,telemetry,C#,Azure Application Insights,Telemetry,我想切换到使用应用程序见解进行日志记录等。我知道我需要对遥测数据进行采样,以保持在免费计划内。但是,我希望能够看到导致抛出异常的所有事件序列,以便能够重现它们 应用程序洞察是否内置了类似的功能?如果没有,我是否有办法编写一个定制的采样器来产生所需的行为?例如 class CustomSampler : ITelemetrySampler AdaptiveSamplingTelemetryProcessor版本2.2.0中有ExcludeTypes属性 <Add Type="Microso

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

应用程序洞察是否内置了类似的功能?如果没有,我是否有办法编写一个定制的采样器来产生所需的行为?例如

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>

谢谢,这正是我想要的。只是一个小问题——假设我的服务器正在处理数据包,我想知道导致异常的数据包的ID。如果我创建了一个带有PacketID字段的自定义异常,并使用它包装内部异常,a:PacketID字段是否会发送到Azure,B:我是否可以在Azure中遍历内部异常?a:是。是的。你知道customEvents是否被视为事件吗?谢谢