Azure Application Insights codeless agent does not show cloudRoleInstance and cloudRoleName in application map

huangapple go评论78阅读模式
英文:

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.

{
    &quot;instrumentationSettings&quot;: {
        &quot;connectionString&quot;: &quot;InstrumentationKey=XXX..XXX&quot;
    },
    &quot;preview&quot;: {
        &quot;roleName&quot;: &quot;MYROLE&quot;,
        &quot;roleInstance&quot;: &quot;myinstance&quot;
    }
}

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":

{
  &quot;instrumentationSettings&quot;: {
    &quot;connectionString&quot;: &quot;InstrumentationKey=00000000-0000-0000-0000-000000000000&quot;,
    &quot;preview&quot;: {
      &quot;roleName&quot;: &quot;my cloud role name&quot;
    }
  }
}

huangapple
  • 本文由 发表于 2020年8月28日 04:46:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/63623946.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定