Skip to content

Commit 362f811

Browse files
committed
Document RoleName tag
1 parent 3486e2d commit 362f811

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,24 @@ appInsights.defaultClient.addTelemetryProcessor(envelope => {
176176

177177
### Java
178178

179+
Starting with Application Insights Java SDK 2.5.0, you can specify the cloud role name
180+
by adding `<RoleName>` to your `ApplicationInsights.xml` file, e.g.
181+
182+
```XML
183+
<?xml version="1.0" encoding="utf-8"?>
184+
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
185+
<InstrumentationKey>** Your instrumentation key **</InstrumentationKey>
186+
<RoleName>** Your role name **</RoleName>
187+
...
188+
</ApplicationInsights>
189+
```
190+
179191
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.
180192

181193
`spring.application.name=<name-of-app>`
182194

183195
The Spring Boot starter will automatically assign cloud role name to the value you enter for the spring.application.name property.
184196

185-
For further information on Java correlation and how to configure cloud role name for non-SpringBoot applications checkout this [section](https://docs.microsoft.com/azure/application-insights/application-insights-correlation#role-name) on correlation.
186-
187197
### Client/browser-side JavaScript
188198

189199
```javascript

articles/azure-monitor/app/correlation.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -331,25 +331,23 @@ In order to correlate telemetry in Asynchronous Spring Boot application, please
331331
332332
At times, you might want to customize the way component names are displayed in the [Application Map](../../azure-monitor/app/app-map.md). To do so, you can manually set the `cloud_RoleName` by doing one of the following:
333333
334-
- 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.
335-
336-
`spring.application.name=<name-of-app>`
337-
338-
The Spring Boot starter automatically assigns `cloudRoleName` to the value you enter for the `spring.application.name` property.
339-
340-
- If you're using the `WebRequestTrackingFilter`, the `WebAppNameContextInitializer` sets the application name automatically. Add the following to your configuration file (ApplicationInsights.xml):
334+
- Starting with Application Insights Java SDK 2.5.0, you can specify the cloud role name
335+
by adding `<RoleName>` to your `ApplicationInsights.xml` file, e.g.
341336
342337
```XML
343-
<ContextInitializers>
344-
<Add type="com.microsoft.applicationinsights.web.extensibility.initializers.WebAppNameContextInitializer" />
345-
</ContextInitializers>
338+
<?xml version="1.0" encoding="utf-8"?>
339+
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
340+
<InstrumentationKey>** Your instrumentation key **</InstrumentationKey>
341+
<RoleName>** Your role name **</RoleName>
342+
...
343+
</ApplicationInsights>
346344
```
347345
348-
- If you use the cloud context class:
346+
- 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.
349347
350-
```Java
351-
telemetryClient.getContext().getCloud().setRole("My Component Name");
352-
```
348+
`spring.application.name=<name-of-app>`
349+
350+
The Spring Boot starter automatically assigns `cloudRoleName` to the value you enter for the `spring.application.name` property.
353351
354352
## Next steps
355353

0 commit comments

Comments
 (0)