Skip to content

HttpClient integration does not capture Axios requests #7615

@hckhanh

Description

@hckhanh

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g. bundle.tracing.min.js) in your SDK setup.

@sentry/react

SDK Version

7.45.0

Framework Version

React 18.2

Link to Sentry event

No response

SDK Setup

import {
  ErrorBoundary,
  Replay,
  init as initSentry,
  Integrations,
} from '@sentry/react'
import { BrowserTracing } from '@sentry/tracing'
import {
  HttpClient as HttpClientIntegration,
  Debug as DebugIntegration,
} from '@sentry/integrations'

initSentry({
  dsn: __SENTRY_DSN__,
  release: __SENTRY_RELEASE__,
  dist: __SENTRY_DIST__,
  environment: import.meta.env.MODE,

  // debug: true,
  enabled: true,
  integrations: [
    new BrowserTracing(),
    // new Integrations.
    new Replay({
      maskAllText: false,
      maskAllInputs: false,
      blockAllMedia: false,
    }),
    new HttpClientIntegration({
      // failedRequestStatusCodes: [401],
      // failedRequestTargets: ['http://localhost:3005'],
    }),
    new DebugIntegration({
      // // trigger DevTools debugger instead of using console.log
      // debugger: true,
      // // stringify event before passing it to console.log
      // stringify: boolean;
    }),
  ],

  tracesSampleRate: 1,
  replaysSessionSampleRate: 1,
  replaysOnErrorSampleRate: 1,
})

Steps to Reproduce

When I add HttpClient, it cannot report XHR request. I am using Axios v1

Expected Result

it will report XHR requests

Actual Result

It don't report any XHR requests. Even though the exception pointed directly to _wrapXHR function of Sentry

image

image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions