@sentry/browser
Version:
Official Sentry SDK for browsers
24 lines (23 loc) • 844 B
JavaScript
const require_request = require("../tracing/request.js");
let _sentry_core = require("@sentry/core");
let _sentry_browser_utils = require("@sentry/browser-utils");
// src/integrations/xhrTracing.ts
const INTEGRATION_NAME = "XhrTracing";
const _xhrTracingIntegration = ((options = {}) => {
return {
name: INTEGRATION_NAME,
setup(client) {
if ((0, _sentry_browser_utils.isBotUserAgent)()) return;
require_request.instrumentXhrRequests(client, {
...options,
tracePropagationTargets: client.getOptions().tracePropagationTargets
});
}
};
});
/**
* Creates spans for outgoing XHR requests and attaches trace propagation headers to them.
*/
const xhrTracingIntegration = (0, _sentry_core.defineIntegration)(_xhrTracingIntegration);
exports.xhrTracingIntegration = xhrTracingIntegration;
//# sourceMappingURL=xhrTracing.js.map