Skip to content

Commit da1efd7

Browse files
authored
Merge pull request #110776 from MS-jgol/correlation-doc
modified telemetry correlation for Java
2 parents 6562396 + 387cc97 commit da1efd7

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

articles/azure-monitor/app/correlation.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ public void ConfigureServices(IServiceCollection services)
125125

126126
### Enable W3C distributed tracing support for Java apps
127127

128+
#### Java 3.0 agent
129+
130+
Java 3.0 agent supports W3C out of the box and no additional configuration is needed.
131+
132+
#### Java SDK
128133
- **Incoming configuration**
129134

130135
- For Java EE apps, add the following to the `<TelemetryModules>` tag in ApplicationInsights.xml:
@@ -316,18 +321,33 @@ There's a new HTTP module, [Microsoft.AspNet.TelemetryCorrelation](https://www.n
316321
The Application Insights SDK, starting with version 2.4.0-beta1, uses `DiagnosticSource` and `Activity` to collect telemetry and associate it with the current activity.
317322
318323
<a name="java-correlation"></a>
319-
## Telemetry correlation in the Java
324+
## Telemetry correlation in Java
320325
321-
[Application Insights Java agent](https://docs.microsoft.com/azure/azure-monitor/app/java-in-process-agent) as well as [Java SDK](../../azure-monitor/app/java-get-started.md) version 2.0.0 or later supports automatic correlation of telemetry. It automatically populates `operation_id` for all telemetry (like traces, exceptions, and custom events) issued within the scope of a request. It also propagates the correlation headers (described earlier) for service-to-service calls via HTTP, if the [Java SDK agent](../../azure-monitor/app/java-agent.md) is configured.
326+
[Java agent](https://docs.microsoft.com/azure/azure-monitor/app/java-in-process-agent) as well as [Java SDK](../../azure-monitor/app/java-get-started.md) version 2.0.0 or later supports automatic correlation of telemetry. It automatically populates `operation_id` for all telemetry (like traces, exceptions, and custom events) issued within the scope of a request. It also propagates the correlation headers (described earlier) for service-to-service calls via HTTP, if the [Java SDK agent](../../azure-monitor/app/java-agent.md) is configured.
322327
323328
> [!NOTE]
324329
> Application Insights Java agent auto-collects requests and dependencies for JMS, Kafka, Netty/Webflux, and more. For Java SDK only calls made via Apache HttpClient are supported for the correlation feature. Automatic context propagation across messaging technologies (like Kafka, RabbitMQ, and Azure Service Bus) isn't supported in the SDK.
325330
326-
<a name="java-role-name"></a>
327-
## Role name
331+
> [!NOTE]
332+
> To collect custom telemetry you need to instrument the application with Java 2.6 SDK.
333+
334+
### Role names
328335
329336
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 taking one of the following actions:
330337
338+
- For Application Insights Java agent 3.0, set the cloud role name as follows:
339+
340+
```json
341+
{
342+
"instrumentationSettings": {
343+
"preview": {
344+
"roleName": "my cloud role name"
345+
}
346+
}
347+
}
348+
```
349+
You can also set the cloud role name using the environment variable `APPLICATIONINSIGHTS_ROLE_NAME`.
350+
331351
- With Application Insights Java SDK 2.5.0 and later, you can specify the `cloud_RoleName`
332352
by adding `<RoleName>` to your ApplicationInsights.xml file:
333353

0 commit comments

Comments
 (0)