我想设置从我的 Azure Function App (v2) 发送到应用程序洞察的遥测数据的 cloud_rolename。
我的 host.json 中的 AI 配置如下所示:
"applicationInsights": {
"sampling": {
"isEnabled": true,
"maxTelemetryItemsPerSecond" : 1
}
}
我无法找到任何有关在函数应用程序中设置云角色名的文档。我该怎么办?
您应该能够通过注册自定义来做到这一点TelemetryInitializer
。看这里:https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/759#issuecomment-426687852 https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/759#issuecomment-426687852.
目前,我们今天在初始化程序中设置了该角色名称:https://github.com/Azure/azure-webjobs-sdk/blob/dev/src/Microsoft.Azure.WebJobs.Logging.ApplicationInsights/Initializers/WebJobsRoleEnvironmentTelmetryInitializer.cs https://github.com/Azure/azure-webjobs-sdk/blob/dev/src/Microsoft.Azure.WebJobs.Logging.ApplicationInsights/Initializers/WebJobsRoleEnvironmentTelmetryInitializer.cs.
我可以问一下您想要覆盖它的情况是什么吗?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)