microsoft / microsoft/ApplicationInsights-JS

[BUG] disableCorrelationHeaders does not work as expected

Open
#2,348 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation enhancement
Dominant language
TypeScript
Stars
685
Forks
261
Avg merge
21h 33m
Merged PRs (30d)
5

Description

**Description/Screenshot**

[Documentation](https://learn.microsoft.com/en-us/azure/azure-monitor/app/javascript-sdk-configuration) for `disableCorrelationHeaders` attribute says

> If false, the SDK adds two headers ('Request-Id' and 'Request-Context') to all dependency requests to correlate them with corresponding requests on the server side. Default is false.

But the mentioned header `Request-Id` is sent only if attribute `enableCorsCorrelation` is set to true and `Request-Context` is sent only if `enableCorsCorrelation` is set to true and `appId` is not undefined.

**Steps to Reproduce**

- OS/Browser: win 11, edge
- SDK Version [e.g. 22]: `"@microsoft/applicationinsights-clickanalytics-js": "^3.2.1"`
- How you initialized the SDK: npm

**Expected behavior**

I expect that `Request-Id` and `Request-Context` will be sent when `disableCorrelationHeaders` is false.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the configuration documentation linked in the issue, then search the TypeScript source and tests for disableCorrelationHeaders, enableCorsCorrelation, Request-Id, and Request-Context. Reproduce the dependency-request behavior and trace the conditions controlling each header; the issue is done when the intended behavior is implemented or documented and covered by regression tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, javascript, typescript
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.