我们的 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 的票,但他们已经调查了好几个星期。