【问题标题】:A way to configure InitialSamplingPercentage in ASP.NET Core?在 ASP.NET Core 中配置 InitialSamplingPercentage 的方法?
【发布时间】:2022-01-10 02:42:58
【问题描述】:

我正在本地服务器上设置 AppInsights。

在 AppInsights 的 asp.net 配置中有一个设置 InitialSamplingPercentage, Aps.Net Core 中是否有类比?

我这样设置我的 appInsights:

在配置中:

    var builder = configuration.DefaultTelemetrySink.TelemetryProcessorChainBuilder;
    builder.UseAdaptiveSampling(maxTelemetryItemsPerSecond:2);
    builder.Build();

在 ConfigureServices 中:

    var aiOptions = new ApplicationInsightsServiceOptions();
    aiOptions.EnableAdaptiveSampling = false;
    
    services.AddApplicationInsightsTelemetry(aiOptions);

【问题讨论】:

    标签: asp.net asp.net-core azure-application-insights asp.net-core-3.1 appinsights


    【解决方案1】:

    找到方法

        builder.UseAdaptiveSampling(new SamplingPercentageEstimatorSettings()
        {
            InitialSamplingPercentage = 0.1,
        }, (_, _, _, _, _) => { }, excludedTypes: "Exception;");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-07-15
      • 2019-06-18
      • 1970-01-01
      • 2021-04-26
      • 1970-01-01
      • 2016-07-03
      • 1970-01-01
      相关资源
      最近更新 更多