traceparent/tracestate not in outgoing request headers
See original GitHub issueDescription/Screenshot Upon following the instructions here to enable distributedTracingMode with AI_AND_W3C, AI, or W3C, i’m still not seeing traceparent/tracestate on outgoing request headers.
Steps to Reproduce Follow regular instructions for applicationinsights setup for web as well as react-native plugin and set distributedTracignMode property of ApplicationInsights config object to DistributedTracingModes.AI_AND_W3C using type IConfig | IConfiguration
import { ApplicationInsights, DistributedTracingModes, IConfig, IConfiguration } from "@microsoft/applicationinsights-web";
import { ReactNativePlugin } from "@microsoft/applicationinsights-react-native";
// ---
const appInsightsConfig: IConfig | I Configuration = {
disableAjaxTracking: false,
disableCorrelationHeaders: false,
disableFetchTracking: false,
distributedTracingMode: DistributedTracingModes.AI_AND_W3C,
instrumentationKey,
extensions: [RNPlugin]
};
const appInsights = new ApplicationInsights({ config: appInsightsConfig });
appInsights.loadAppInsights();
// ---
- OS/Browser: iOS, React-Native application, Typescript
- SDK Version [e.g. 22]: applicationinsights-web@2.5.5, applicationinsights-react-native@1.0.3
- How you initialized the SDK: npm setup
Expected behavior Expected to see traceparent/tracestate on outgoing requests.
Additional context Even though this bug is resolved I tried to match the header params according to this thread just in case.
Descriptions of urls:
* General Headers
* Request URL: https###
* Request Method: GET
* Status Code: 200 OK
* Remote Address: ###
* Referrer Policy: no-referrer-when-downgrade
* Response Headers
* Content-Encoding: gzip
* Content-Type: application/json; charset=utf-8
* Date: Fri, 05 Jun 2020 20:52:06 GMT
* Request-Context: appId=###
* Transfer-Encoding: chunked
* Vary: Accept-Encoding
* x-content-type-options: nosniff
* x-correlation-id: context.Request.Headers.GetValueOrDefault("x-correlation-id","")
* X-Powered-By: ASP.NET
* Request Headers
* Provisional headers are shown
* accept: text/plain
* authorization: ###
* content-type: application/json
* dwp-apim-subscription-key: ###
* User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) ReactNativeDebugger/0.10.7 Chrome/78.0.3904.130 Electron/7.1.9 Safari/537.36
* x-app-version: 1.0
* x-build-version: 1
* x-correlation-id: ###
* x-user-session-id: ###
* Query String Parametersview source
view URL encoded
* top: 10
“###” - indicates that the field is present but left out for sensitivity reasons @markwolff Is this what you’re looking for?
I’m relatively new to App Insights so please let me know if there is not enough information or if this is not the best place to post this.
Thanks,
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top GitHub Comments
I just wanted to add more details for anyone who tries to debug network requests thru React Native Debugger - this issue seems occur when enabling
Network Inspect
on React Native Debugger. It uses a Web Worker to send XHR requests when it gets enabled, and the mechanism in which App Insights JS SDK uses to catch those XHR events do not get hit. As soon as I turned off Network Inspect, the XHR send event callback was being hit again.Could you provide a network trace or describe the urls your app is on and to where requests are being sent? One thing that could be required is
enableCorsCorrelation
if you are sending cross origin requests here.