Skip to content

sentry-trace and baggage headers are not attached to XHR Requests #8527

@JustDoItSascha

Description

@JustDoItSascha

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/angular

SDK Version

7.58.1

Framework Version

Angular 12.2.17

Link to Sentry event

No response

SDK Setup

Sentry.init({
  dsn: '...',
  integrations: [
    new Sentry.BrowserTracing({
      // Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
      tracePropagationTargets: ['localhost', /^http/],
      routingInstrumentation: Sentry.routingInstrumentation,
    }),
  ],

  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for performance monitoring.
  // We recommend adjusting this value in production
  tracesSampleRate: 1.0,
  tracePropagationTargets: ['localhost', /^http/],
});

Steps to Reproduce

I have an Angular 12 application where I added sentry. But the sentry-trace header is not attached to XHR Requests initiated by HttpClient. When I'm doing a fetch() manually, then the header is set.

Expected Result

I see the sentry-trace header in the request.

Actual Result

I don't the the header in the request.

Metadata

Metadata

Assignees

Labels

Package: angularIssues related to the Sentry Angular SDK
No fields configured for issues without a type.

Projects

Status

Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions