question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

traceparent/tracestate not in outgoing request headers

See original GitHub issue

Description/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:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
alchau92commented, Jul 10, 2020

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.

1reaction
markwolffcommented, Jun 5, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trace Context - W3C
The traceparent header represents the incoming request in a tracing system in a common format, understood by all vendors. Here's an example of...
Read more >
Trace context HTTP header format rationale
This document provides rationale for the decisions made, mapping the traceparent and tracestate fields to HTTP headers. Lowercase concatenated header names.
Read more >
Browser data in distributed tracing | New Relic Documentation
By default, distributed tracing for cross-origin requests is not enabled ... HTTP headers ( newrelic , traceparent , and tracestate ) to outgoing...
Read more >
OpenTelemetry Traceparent HTTP Header [Go] - Uptrace
[toc]] What is traceparent header? The traceparent HTTP header contains information about the incoming request in a tracing ...
Read more >
Using W3C Trace Context standard in distributed tracing
The W3C Trace Context specification defines a standard to HTTP headers and ... tracestate : extends traceparent with vendor-specific data represented by a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found