gpt4 book ai didi

c# - 如何限制 Azure Application Insights 仅记录 dotnet core 项目中的自定义事件?

转载 作者:太空宇宙 更新时间:2023-11-03 12:02:40 24 4
gpt4 key购买 nike

我正在使用 dotnet core api 项目,并已通过 Azure Application Insight 启用它,大量数据已发送到 Microsoft Azure,我如何限制它,使其仅发送我的客户 TrackEvent 并禁用其余部分。我可以使用 appsettings.json 或以编程方式配置它吗?

最佳答案

如果您只关心使用 Microsoft.ApplicationInsights 包记录自定义事件,并使用 TelemetryClient.TrackEvent API 记录事件。我假设您已添加应用程序见解包 Microsoft.ApplicationInsights.AspNetCore 并启用请求、依赖项等的自动收集。由于您不希望收集这些内容,因此请勿启用自动收集。正如 Shahzad 提到的,当您从 Visual Studio 启用应用程序洞察时,它可能是为您添加的。

关于c# - 如何限制 Azure Application Insights 仅记录 dotnet core 项目中的自定义事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56381910/

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