Currently ApplicationInsights-JS only allow XHR to add correlation headers, which blocked some projects that using "fetch" and want to use AI's correlation feature. Will ApplicationInsights-JS support fetch in the future? ( #166 seems mentioned the same issue)
*attach CORS and correlation headers config used in this issue:
{
disableCorrelationHeaders: false,
enableCorsCorrelation: true
}

We have a new iteration of the sdk under works currently which will have the ability to use fetch for sending data as well.
wow, wonderful news, looking forward to new iteration.
@yuejiaozhs judging by the answer it's planned to use fetch to send data. Not monitor fetch calls. Anyhow, while you're waiting
https://github.com/MaximBalaganskiy/application-insights-fetch-monitor
Do you want to send PR into this repo?
I will. I needed it yesterday hence a separate project.
Great
I'm using @microsoft/[email protected] which seems to add the request-id for OPTIONS requests but not for the actual requests themselves.
This is my config:
config: {
instrumentationKey: "--key--",
disableFetchTracking: false,
enableCorsCorrelation: true
}
Hey @FelschR, it should be adding request-id to the list of Access-Control-Request-Headers in the OPTIONS call, and then fills in the request-id for the actual fetch. Is this different from what you are seeing?
The OPTONS call

The fetch

Most helpful comment
I will. I needed it yesterday hence a separate project.