Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] disableCorrelationHeaders does not work as expected #2348

Open
krystofmatejka opened this issue May 15, 2024 · 2 comments
Open

[BUG] disableCorrelationHeaders does not work as expected #2348

krystofmatejka opened this issue May 15, 2024 · 2 comments

Comments

@krystofmatejka
Copy link

Description/Screenshot

Documentation 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.

@Karlie-777
Copy link
Contributor

The current logic (by design) for the two configs is:

  1. if disableCorrelationHeaders is set to true, regardless of other settings, correlation headers will not be added.
  2. if disableCorrelationHeaders is set to false and enableCorsCorrelation is set to false, correlation headers will not be added.
  3. if disableCorrelationHeaders is set to false and enableCorsCorrelation is set to true, correlation headers will be added based on correlationHeaderExcludePatterns, correlationHeaderDomains and correlationHeaderExcludedDomains

@krystofmatejka
Copy link
Author

thank you for clarification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants