在Azure功能应用程序中为应用程序见解配置云角色名称 [英] Configure Cloud Role Name for Application Insights in an Azure Function App
问题描述
我想设置从Azure功能应用程序(v2)发送的遥测的cloud_rolename,该遥测名称发送到应用程序见解.
I would like to set the cloud_rolename of the telemetry sent from my Azure Function App (v2) that is sent to application insights.
host.json中的AI配置如下:
The AI configuration in my host.json looks like this:
"applicationInsights": {
"sampling": {
"isEnabled": true,
"maxTelemetryItemsPerSecond" : 1
}
}
我无法找到任何有关在功能应用程序中在何处设置云角色名的文档.我该怎么办?
I have been unable to find any documentation on where to set cloud rolename in function apps. How should I go about this?
推荐答案
您应该可以通过注册自定义TelemetryInitializer
来做到这一点.请参阅此处: https://github.com/Microsoft/Application/Insights-aspnetcore/issues/759#issuecomment-426687852 .
You should be able to do this by registering a custom TelemetryInitializer
. See here: https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/759#issuecomment-426687852.
We currently set that role name in an initializer today here: https://github.com/Azure/azure-webjobs-sdk/blob/dev/src/Microsoft.Azure.WebJobs.Logging.ApplicationInsights/Initializers/WebJobsRoleEnvironmentTelmetryInitializer.cs.
我能问一下您要覆盖它的情况是什么吗?
Can I ask what your scenario is that you'd want to override it?
这篇关于在Azure功能应用程序中为应用程序见解配置云角色名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!