UNPKG

@sentry/browser

Version:
24 lines (23 loc) • 787 B
import { instrumentFetchRequests } from "../tracing/request.js"; import { defineIntegration } from "@sentry/core"; import { isBotUserAgent } from "@sentry/browser-utils"; // src/integrations/fetchTracing.ts const INTEGRATION_NAME = "FetchTracing"; const _fetchTracingIntegration = ((options = {}) => { return { name: INTEGRATION_NAME, setup(client) { if (isBotUserAgent()) return; instrumentFetchRequests(client, { ...options, tracePropagationTargets: client.getOptions().tracePropagationTargets }); } }; }); /** * Creates spans for outgoing fetch requests and attaches trace propagation headers to them. */ const fetchTracingIntegration = defineIntegration(_fetchTracingIntegration); export { fetchTracingIntegration }; //# sourceMappingURL=fetchTracing.js.map