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.

[BUG] Unable to include telemetry correlation headers

See original GitHub issue

Description We using this SDK in an SPA using fetch. The requests to the my .NET Web APIs do not include the telemetry correlation headers (‘Request-Id’ and ‘Request-Context’). Dependency telemetry is being collected just fine.

Request Headers
  Request URL: https://api.domain.com:8082/resource
  Request Method: GET
  Status Code: 200 
  Referrer Policy: no-referrer-when-downgrade
  :authority: api.domain.com:8082
  :method: GET
  :path: /resource
  :scheme: https
  accept: application/json
  accept-encoding: gzip, deflate, br
  accept-language: en-US,en;q=0.9,es;q=0.8,uk;q=0.7
  content-type: application/json
  origin: https://client.domain.com
  referer: https://client.domain.com
  sec-fetch-dest: empty
  sec-fetch-mode: cors
  sec-fetch-site: cross-site
  user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) 
  Chrome/80.0.3987.149 Safari/537.36

Response headers
  access-control-allow-credentials: true
  access-control-allow-origin: https://client.domain.com
  access-control-expose-headers: Request-Context
  content-encoding: gzip
  content-length: 361
  content-type: application/json; charset=utf-8
  date: Sat, 28 Mar 2020 17:18:46 GMT
  request-context: appId=cid-v1:<some id>
  server: Microsoft-IIS/10.0
  status: 200
  x-powered-by: ASP.NET
  • OS/Browser: Windows / Chrome (Version 80.0.3987.149)

  • SDK Version [e.g. 22]: Version 2.5.2

  • How you initialized the SDK: NPM setup / webpack

import { ApplicationInsights } from '@microsoft/applicationinsights-web';

export class Logger {
  _ai;

  constructor() {
    this._init();
  }

  _init() {
    var options = {
     config: {
       instrumentationKey: 'my key',
       appId: 'my-app',
       autoTrackPageVisitTime: true,
       disableAjaxTracking: true,
       disableFetchTracking: false,
       enableCorsCorrelation: true,
       enableRequestHeaderTracking: true,
       enableDebug: true,
       loggingLevelConsole: 2,
    }
    this._ai = new ApplicationInsights(options);
    this._ai.loadAppInsights();
  }
  // Logging methods excluded
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
MSNevcommented, Apr 8, 2020

Now also fully deployed to primary CDN

2reactions
MSNevcommented, Apr 8, 2020

Fixed deployed as NPM and next CDN channels

Read more comments on GitHub >

github_iconTop Results From Across the Web

How we used OpenTelemetry to fix a bug in OpenTelemetry
The trace headers ( baggage , traceparent , tracestate ) are send as multiple header fields: the nginx module added the value of...
Read more >
Diagnose exceptions in web apps with Application Insights
Exceptions in web applications can be reported with Application Insights. You can correlate failed requests with exceptions and other events on ...
Read more >
microsoft/ApplicationInsights-JS 2.5.4 on GitHub - NewReleases.io
#1240 [BUG] Telemetry correlation headers are not included for all fetch requests; #1229 [BUG] Unable to include telemetry correlation headers ...
Read more >
Trace Context - W3C
This specification defines standard HTTP headers and a value format to ... The tracestate header includes the parent in a potentially ...
Read more >
What is Distributed Tracing? How it Works & Use Cases
And with Datadog's unified platform, you can easily correlate traces with logs, infrastructure metrics, code profiles, and other telemetry data to quickly ...
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