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