英文:
Azure Application Insights codeless agent does not show cloudRoleInstance and cloudRoleName in application map
问题
{
"instrumentationSettings": {
"connectionString": "InstrumentationKey=XXX..XXX"
},
"preview": {
"roleName": "MYROLE",
"roleInstance": "myinstance"
}
}
在Azure门户中转到日志选项卡时,传入数据的roleInstance字段仍然设置为计算机名称,并且roleName不在传入数据中。
JSON文件可以被读取,因为它包含了我的Application Insights资源的InstrumentationKey。
<details>
<summary>英文:</summary>
I am using Azure Application Insights on my Java App, I added an ApplicationInsights.json file next to the JAR (Java codeless agent 3.0.0) but the roleName and roleInstance are not pushed to Aplication Insights.
{
"instrumentationSettings": {
"connectionString": "InstrumentationKey=XXX..XXX"
},
"preview": {
"roleName": "MYROLE",
"roleInstance": "myinstance"
}
}
When I go to the Log tabs in the Azure portal, the roleInstance field on incoming data is still set to the machine name and the roleName is not among incoming data.
The JSON file can be read because it contains the InstrumentationKey of my Application Insights resource.
</details>
# 答案1
**得分**: 0
根据这个链接(https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-config),"preview" 应该是 "instrumentationSettings" 的一部分:
```json
{
"instrumentationSettings": {
"connectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000",
"preview": {
"roleName": "我自己的云角色名"
}
}
}
英文:
According to this (https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-config) "preview" should be a part of "instrumentationSettings":
{
"instrumentationSettings": {
"connectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000",
"preview": {
"roleName": "my cloud role name"
}
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论