Azure Application Insights 采样更改了采样率

穆鲁克

我们的一个 azure function v3 应用程序从 200mb 的应用程序洞察摄取量增加到约 18gb。我们没有添加任何额外的日志语句、更改任何 sdk 或触发任何额外的函数执行。我们没有在我们的项目中指定应用洞察 sdk,因此它使用 Azure 安装的内容。运行下面来自 Microsoft 的推荐查询以显示采样百分比,很明显自适应采样发生了一些变化。

union requests,dependencies,pageViews,browserTimings,exceptions,traces
| where timestamp > ago(50d)
| summarize RetainedPercentage = 100/avg(itemCount) by bin(timestamp, 1h), itemType
|  order by timestamp, itemType

这是在峰值发生之前 在此处输入图片说明

这是在尖峰发生之后 在此处输入图片说明

这是host.json

{
  "version": "2.0",
  "logging": {
    "logLevel": {
      "default": "Information",
      "Host.Triggers.DurableTask": "Warning",
      "DurableTask.AzureStorage": "Warning",
      "DurableTask.Core": "Warning"
    },
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensions": {
    "eventHubs": {
      "batchCheckpointFrequency": 1,
      "eventProcessorOptions": {
        "maxBatchSize": 64,
        "prefetchCount": 128
      }
    },
    "durableTask": {
      "hubName": "FooDevicesTaskHub",
      "storageProvider": {
        "connectionStringName": "AzureWebJobsStorageDurable"
      },
      "tracing": {
        "traceInputsAndOutputs": false,
        "traceReplayEvents": false
      }
    },
    "serviceBus": {
      "messageHandlerOptions": {
        "maxConcurrentCalls": 1
      }
    }
  }
}

这里是包

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="AutoMapper" Version="8.1.1" />
    <PackageReference Include="Azure.Storage.Blobs" Version="12.8.0" />
    <PackageReference Include="Azure.Storage.Files.DataLake" Version="12.2.2" />
    <PackageReference Include="Microsoft.Azure.Devices" Version="1.18.1" />
    <PackageReference Include="Microsoft.Azure.EventGrid" Version="3.2.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.CosmosDB" Version="3.0.7" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.5.1" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventGrid" Version="2.1.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventHubs" Version="4.1.1" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="4.3.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="4.0.3" />
    <PackageReference Include="Microsoft.Extensions.Http" Version="3.1.7" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.13" />
    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
    <PackageReference Include="Polly" Version="7.2.1" />
    <PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
    <PackageReference Include="SendGrid" Version="9.24.2" />
    <PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
  </ItemGroup>

添加了更多基于评论的查询结果:

traces
| summarize sum(itemCount), count(), dcount(strcat(cloud_RoleName, "/")) by bin(timestamp, 30sec)
| render timechart

前: 在此处输入图片说明

后: 在此处输入图片说明

关于可能导致这种情况或寻找什么的任何想法?我们有一张与 MS 的票,但他们已经调查了数周。

崎马

自适应采样基于每个应用程序实例。因此,如果每个节点的负载减少(负载总体减少,或者您重构了您的应用程序{切换到其他计划等},现在有更小的实例等),那么这可以解释这些数字。

要检查是否是这种情况,您可以输出以下列:

sum(itemCount), count(), dcount(strcat(cloud_RoleName, "/", cloud_RoleInstance), 4)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Azure Application Insights中的会话

结合使用Azure Application Insights和Azure WebJob

Azure Application Insights不记录Redis调用

使用ASP.NET Core库禁用Application Insights采样

更改Application Insights的位置?

Azure Application Insights中的每小时平均使用量

如何更改Azure Application Insights的保留期限?

Azure Application Insights连续导出过程

如何在Azure Application Insights中导出性能数据

ILogger如何记录到Azure Application Insights?

无法在Azure中安装Application Insights

如何在Azure Application Insights中访问页面视图?

Azure Application Insights实施angular6

Azure Application Insights失败的IN语法

使用Azure功能的Application Insights搜索

为本地环境设置Azure Application Insights

如何在Net Core HostBuilder上配置Application Insights采样?

Azure Application Insights如何确定流量峰值来自何处

Azure Application Insights无法跟踪SQL查询

Azure Application Insights日志严重性级别

Azure Cli如何为Webapp启用Application Insights

Application Insights SDK(本地)和Azure Application Insights之间的区别

删除Azure上的特定Application Insights事件

Azure Application Insights - 对象中的值

在 Application Insights 中采样指标数据

Azure Application Insights 在相同的时间戳多次显示相同的事件

ASP.NET Core Application Insights 自适应采样

Azure Application Insights - 获取应用列表及其 ID

Azure Application Insights CLI 事件类型