Skip to content

Commit 1ca7f56

Browse files
Merge pull request #250043 from v-jbasden/v-jbasden-update-w3c-distributed-tracing
Updating enabling W3C distributed tracing support for web apps per Incident 419354112
2 parents 836bd07 + afee190 commit 1ca7f56

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

articles/azure-monitor/app/distributed-tracing-telemetry-correlation.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ It's important to make sure the incoming and outgoing configurations are exactly
171171
172172
### Enable W3C distributed tracing support for web apps
173173
174-
This feature is in `Microsoft.ApplicationInsights.JavaScript`. It's disabled by default. To enable it, use `distributedTracingMode` config. AI_AND_W3C is provided for backward compatibility with any legacy services instrumented by Application Insights.
174+
This feature is enabled by default for Javascript and the headers are automatically included when the hosting page domain is the same as the domain the requests are sent to (for example, the hosting page is `example.com` and the Ajax requests are sent to `example.com`). To change the distributed tracing mode, use the [`distributedTracingMode` configuration field](./javascript-sdk-configuration.md#sdk-configuration). AI_AND_W3C is provided by default for backward compatibility with any legacy services instrumented by Application Insights.
175175
176176
- **[npm-based setup](./javascript-sdk.md?tabs=npmpackage#get-started)**
177177
@@ -186,6 +186,9 @@ This feature is in `Microsoft.ApplicationInsights.JavaScript`. It's disabled by
186186
```
187187
distributedTracingMode: 2 // DistributedTracingModes.W3C
188188
```
189+
190+
If the XMLHttpRequest or Fetch Ajax requests are sent to a different domain host, including sub-domains, the correlation headers are not included by default. To enable this feature, set the [`enableCorsCorrelation` configuration field](./javascript-sdk-configuration.md#sdk-configuration) to `true`. If you set `enableCorsCorrelation` to `true`, all XMLHttpRequest and Fetch Ajax requests include the correlation headers. As a result, if the application on the server that is being called doesn't support the `traceparent` header, the request may fail, depending on whether the browser / version can validate the request based on which headers the server will accept.
191+
189192
> [!IMPORTANT]
190193
> To see all configurations required to enable correlation, see the [JavaScript correlation documentation](./javascript.md#enable-distributed-tracing).
191194

0 commit comments

Comments
 (0)