Skip to content

Commit 7009e76

Browse files
authored
Merge pull request #110216 from MS-jgol/app-map-to-tabs
Changed to tabbed version
2 parents d0253d1 + 51f61d3 commit 7009e76

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

articles/azure-monitor/app/app-map.md

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ To view active alerts and the underlying rules that cause the alerts to be trigg
8181

8282
Application Map uses the **cloud role name** property to identify the components on the map. The Application Insights SDK automatically adds the cloud role name property to the telemetry emitted by components. For example, the SDK will add a web site name or service role name to the cloud role name property. However, there are cases where you may want to override the default value. To override cloud role name and change what gets displayed on the Application Map:
8383

84-
### .NET/.NET Core
84+
# [.NET/.NetCore](#tab/net)
8585

8686
**Write custom TelemetryInitializer as below.**
8787

@@ -149,7 +149,27 @@ For [ASP.NET Core](asp-net-core.md#adding-telemetryinitializers) applications, a
149149
}
150150
```
151151

152-
### Node.js
152+
# [Java](#tab/java)
153+
154+
Starting with Application Insights Java SDK 2.5.0, you can specify the cloud role name
155+
by adding `<RoleName>` to your `ApplicationInsights.xml` file, e.g.
156+
157+
```XML
158+
<?xml version="1.0" encoding="utf-8"?>
159+
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
160+
<InstrumentationKey>** Your instrumentation key **</InstrumentationKey>
161+
<RoleName>** Your role name **</RoleName>
162+
...
163+
</ApplicationInsights>
164+
```
165+
166+
If you use Spring Boot with the Application Insights Spring Boot starter, the only required change is to set your custom name for the application in the application.properties file.
167+
168+
`spring.application.name=<name-of-app>`
169+
170+
The Spring Boot starter will automatically assign cloud role name to the value you enter for the spring.application.name property.
171+
172+
# [Node.js](#tab/nodejs)
153173

154174
```javascript
155175
var appInsights = require("applicationinsights");
@@ -170,27 +190,7 @@ appInsights.defaultClient.addTelemetryProcessor(envelope => {
170190
});
171191
```
172192

173-
### Java
174-
175-
Starting with Application Insights Java SDK 2.5.0, you can specify the cloud role name
176-
by adding `<RoleName>` to your `ApplicationInsights.xml` file, e.g.
177-
178-
```XML
179-
<?xml version="1.0" encoding="utf-8"?>
180-
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
181-
<InstrumentationKey>** Your instrumentation key **</InstrumentationKey>
182-
<RoleName>** Your role name **</RoleName>
183-
...
184-
</ApplicationInsights>
185-
```
186-
187-
If you use Spring Boot with the Application Insights Spring Boot starter, the only required change is to set your custom name for the application in the application.properties file.
188-
189-
`spring.application.name=<name-of-app>`
190-
191-
The Spring Boot starter will automatically assign cloud role name to the value you enter for the spring.application.name property.
192-
193-
### Client/browser-side JavaScript
193+
# [JavaScript](#tab/javascript)
194194

195195
```javascript
196196
appInsights.queue.push(() => {
@@ -200,6 +200,7 @@ appInsights.addTelemetryInitializer((envelope) => {
200200
});
201201
});
202202
```
203+
---
203204

204205
### Understanding cloud role name within the context of the Application Map
205206

@@ -216,11 +217,11 @@ For the [official definitions](https://github.com/Microsoft/ApplicationInsights-
216217
```
217218
[Description("Name of the role the application is a part of. Maps directly to the role name in azure.")]
218219
[MaxStringLength("256")]
219-
705: string CloudRole = "ai.cloud.role";
220+
705: string CloudRole = "ai.cloud.role";
220221
221222
[Description("Name of the instance where the application is running. Computer name for on-premises, instance name for Azure.")]
222223
[MaxStringLength("256")]
223-
715: string CloudRoleInstance = "ai.cloud.roleInstance";
224+
715: string CloudRoleInstance = "ai.cloud.roleInstance";
224225
```
225226

226227
Alternatively, **cloud role instance** can be helpful for scenarios where **cloud role name** tells you the problem is somewhere in your web front-end, but you might be running your web front-end across multiple load-balanced servers so being able to drill in a layer deeper via Kusto queries and knowing if the issue is impacting all web front-end servers/instances or just one can be extremely important.
@@ -255,7 +256,7 @@ In addition, Application Map only supports up to 1000 separate ungrouped nodes r
255256

256257
To fix this, you'll need to change your instrumentation to properly set the cloud role name, dependency type, and dependency target fields.
257258

258-
* Dependency target should represent the logical name of a dependency. In many cases, its equivalent to the server or resource name of the dependency. For example, in the case of HTTP dependencies it is set to the hostname. It should not contain unique IDs or parameters that change from one request to another.
259+
* Dependency target should represent the logical name of a dependency. In many cases, it's equivalent to the server or resource name of the dependency. For example, in the case of HTTP dependencies it is set to the hostname. It should not contain unique IDs or parameters that change from one request to another.
259260

260261
* Dependency type should represent the logical type of a dependency. For example, HTTP, SQL or Azure Blob are typical dependency types. It should not contain unique IDs.
261262

0 commit comments

Comments
 (0)