azure - 在 Azure Function App 中配置 Application Insights 的云角色名称

标签 azure azure-functions azure-application-insights

我想设置从我的 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/Azure/azure-webjobs-sdk/blob/dev/src/Microsoft.Azure.WebJobs.Logging.ApplicationInsights/Initializers/WebJobsRoleEnvironmentTelmetryInitializer.cs .

我可以问一下您想要覆盖它的场景是什么吗?

关于azure - 在 Azure Function App 中配置 Application Insights 的云角色名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53042476/

相关文章:

azure - 使用托管标识和 REST API 从 VM 调用 Azure 函数

azure-application-insights - 未收到心跳时发出警报

php - 如何在 PHP 中使用 Graph API 更新 Exchange 365 自动回复

powershell - 以编程方式设置 Azure 记录合作伙伴

azure - 具有 blob 触发器的可扩展 Azure 函数

Azure Application Insights 不跟踪 SQL 查询

c# - Azure应用程序洞察删除了一些自定义事件

azure - Open Id Connect 的 token 存储在哪里?

Azure Synapse 无服务器 SQL 池错误 : Incorrect syntax near 'DISTRIBUTION'

Azure DevOps CSV 导入问题 [默认状态 'Done',关闭日期字段]