Socket
Socket
Sign inDemoInstall

@sentry-internal/tracing

Package Overview
Dependencies
Maintainers
9
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry-internal/tracing - npm Package Compare versions

Comparing version 7.80.2-alpha.1 to 7.81.0

cjs/common/fetch.js

6

cjs/browser/metrics/index.js

@@ -95,3 +95,3 @@ Object.defineProperty(exports, '__esModule', { value: true });

transaction.startChild({
description: utils.getElementIdentifier(entry.target),
description: utils.htmlTreeAsString(entry.target),
op: `ui.interaction.${entry.name}`,

@@ -457,3 +457,3 @@ origin: 'auto.ui.browser.metrics',

if (_lcpEntry.element) {
transaction.setTag('lcp.element', utils.getElementIdentifier(_lcpEntry.element));
transaction.setTag('lcp.element', utils.htmlTreeAsString(_lcpEntry.element));
}

@@ -477,3 +477,3 @@

_clsEntry.sources.forEach((source, index) =>
transaction.setTag(`cls.source.${index + 1}`, utils.getElementIdentifier(source.node)),
transaction.setTag(`cls.source.${index + 1}`, utils.htmlTreeAsString(source.node)),
);

@@ -480,0 +480,0 @@ }

@@ -5,2 +5,3 @@ Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const fetch = require('../common/fetch.js');
const instrument = require('./instrument.js');

@@ -53,3 +54,3 @@

utils.addInstrumentationHandler('fetch', (handlerData) => {
const createdSpan = fetchCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);
const createdSpan = fetch.instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);
if (enableHTTPTimings && createdSpan) {

@@ -176,167 +177,2 @@ addHTTPTimings(createdSpan);

/**
* Create and track fetch request spans
*
* @returns Span if a span was created, otherwise void.
*/
function fetchCallback(
handlerData,
shouldCreateSpan,
shouldAttachHeaders,
spans,
) {
if (!core.hasTracingEnabled() || !handlerData.fetchData) {
return undefined;
}
const shouldCreateSpanResult = shouldCreateSpan(handlerData.fetchData.url);
if (handlerData.endTimestamp && shouldCreateSpanResult) {
const spanId = handlerData.fetchData.__span;
if (!spanId) return;
const span = spans[spanId];
if (span) {
if (handlerData.response) {
// TODO (kmclb) remove this once types PR goes through
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
span.setHttpStatus(handlerData.response.status);
const contentLength =
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
handlerData.response && handlerData.response.headers && handlerData.response.headers.get('content-length');
const contentLengthNum = parseInt(contentLength);
if (contentLengthNum > 0) {
span.setData('http.response_content_length', contentLengthNum);
}
} else if (handlerData.error) {
span.setStatus('internal_error');
}
span.finish();
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete spans[spanId];
}
return undefined;
}
const hub = core.getCurrentHub();
const scope = hub.getScope();
const client = hub.getClient();
const parentSpan = scope.getSpan();
const { method, url } = handlerData.fetchData;
const span =
shouldCreateSpanResult && parentSpan
? parentSpan.startChild({
data: {
url,
type: 'fetch',
'http.method': method,
},
description: `${method} ${url}`,
op: 'http.client',
origin: 'auto.http.browser',
})
: undefined;
if (span) {
handlerData.fetchData.__span = span.spanId;
spans[span.spanId] = span;
}
if (shouldAttachHeaders(handlerData.fetchData.url) && client) {
const request = handlerData.args[0];
// In case the user hasn't set the second argument of a fetch call we default it to `{}`.
handlerData.args[1] = handlerData.args[1] || {};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const options = handlerData.args[1];
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
options.headers = addTracingHeadersToFetchRequest(request, client, scope, options, span);
}
return span;
}
/**
* Adds sentry-trace and baggage headers to the various forms of fetch headers
*/
function addTracingHeadersToFetchRequest(
request, // unknown is actually type Request but we can't export DOM types from this package,
client,
scope,
options
,
requestSpan,
) {
const span = requestSpan || scope.getSpan();
const transaction = span && span.transaction;
const { traceId, sampled, dsc } = scope.getPropagationContext();
const sentryTraceHeader = span ? span.toTraceparent() : utils.generateSentryTraceHeader(traceId, undefined, sampled);
const dynamicSamplingContext = transaction
? transaction.getDynamicSamplingContext()
: dsc
? dsc
: core.getDynamicSamplingContextFromClient(traceId, client, scope);
const sentryBaggageHeader = utils.dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);
const headers =
typeof Request !== 'undefined' && utils.isInstanceOf(request, Request) ? (request ).headers : options.headers;
if (!headers) {
return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader };
} else if (typeof Headers !== 'undefined' && utils.isInstanceOf(headers, Headers)) {
const newHeaders = new Headers(headers );
newHeaders.append('sentry-trace', sentryTraceHeader);
if (sentryBaggageHeader) {
// If the same header is appended multiple times the browser will merge the values into a single request header.
// Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header.
newHeaders.append(utils.BAGGAGE_HEADER_NAME, sentryBaggageHeader);
}
return newHeaders ;
} else if (Array.isArray(headers)) {
const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]];
if (sentryBaggageHeader) {
// If there are multiple entries with the same key, the browser will merge the values into a single request header.
// Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header.
newHeaders.push([utils.BAGGAGE_HEADER_NAME, sentryBaggageHeader]);
}
return newHeaders ;
} else {
const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined;
const newBaggageHeaders = [];
if (Array.isArray(existingBaggageHeader)) {
newBaggageHeaders.push(...existingBaggageHeader);
} else if (existingBaggageHeader) {
newBaggageHeaders.push(existingBaggageHeader);
}
if (sentryBaggageHeader) {
newBaggageHeaders.push(sentryBaggageHeader);
}
return {
...(headers ),
'sentry-trace': sentryTraceHeader,
baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,
};
}
}
/**
* Create and track xhr request spans

@@ -443,6 +279,4 @@ *

exports.DEFAULT_TRACE_PROPAGATION_TARGETS = DEFAULT_TRACE_PROPAGATION_TARGETS;
exports.addTracingHeadersToFetchRequest = addTracingHeadersToFetchRequest;
exports.defaultRequestInstrumentationOptions = defaultRequestInstrumentationOptions;
exports.extractNetworkProtocol = extractNetworkProtocol;
exports.fetchCallback = fetchCallback;
exports.instrumentOutgoingRequests = instrumentOutgoingRequests;

@@ -449,0 +283,0 @@ exports.shouldAttachHeaders = shouldAttachHeaders;

@@ -16,2 +16,3 @@ Object.defineProperty(exports, '__esModule', { value: true });

const instrument = require('./browser/instrument.js');
const fetch = require('./common/fetch.js');
const extensions = require('./extensions.js');

@@ -42,3 +43,2 @@

exports.BrowserTracing = browsertracing.BrowserTracing;
exports.addTracingHeadersToFetchRequest = request.addTracingHeadersToFetchRequest;
exports.defaultRequestInstrumentationOptions = request.defaultRequestInstrumentationOptions;

@@ -50,3 +50,5 @@ exports.instrumentOutgoingRequests = request.instrumentOutgoingRequests;

exports.addPerformanceInstrumentationHandler = instrument.addPerformanceInstrumentationHandler;
exports.addTracingHeadersToFetchRequest = fetch.addTracingHeadersToFetchRequest;
exports.instrumentFetchRequest = fetch.instrumentFetchRequest;
exports.addExtensionMethods = extensions.addExtensionMethods;
//# sourceMappingURL=index.js.map

@@ -403,3 +403,4 @@ var {

// parse node.js major version
const [major] = process.versions.node.split('.').map(Number);
// Next.js will complain if we directly use `proces.versions` here because of edge runtime.
const [major] = (utils.GLOBAL_OBJ ).process.versions.node.split('.').map(Number);

@@ -406,0 +407,0 @@ // allow call extractOriginalRoute only if node version support Regex d flag, node 16+

import { getActiveTransaction } from '@sentry/core';
import { browserPerformanceTimeOrigin, getElementIdentifier, logger } from '@sentry/utils';
import { browserPerformanceTimeOrigin, htmlTreeAsString, logger } from '@sentry/utils';
import { addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addLcpInstrumentationHandler, addFidInstrumentationHandler } from '../instrument.js';

@@ -93,3 +93,3 @@ import { WINDOW } from '../types.js';

transaction.startChild({
description: getElementIdentifier(entry.target),
description: htmlTreeAsString(entry.target),
op: `ui.interaction.${entry.name}`,

@@ -455,3 +455,3 @@ origin: 'auto.ui.browser.metrics',

if (_lcpEntry.element) {
transaction.setTag('lcp.element', getElementIdentifier(_lcpEntry.element));
transaction.setTag('lcp.element', htmlTreeAsString(_lcpEntry.element));
}

@@ -475,3 +475,3 @@

_clsEntry.sources.forEach((source, index) =>
transaction.setTag(`cls.source.${index + 1}`, getElementIdentifier(source.node)),
transaction.setTag(`cls.source.${index + 1}`, htmlTreeAsString(source.node)),
);

@@ -478,0 +478,0 @@ }

import { hasTracingEnabled, getCurrentHub, getDynamicSamplingContextFromClient } from '@sentry/core';
import { addInstrumentationHandler, generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, isInstanceOf, BAGGAGE_HEADER_NAME, SENTRY_XHR_DATA_KEY, browserPerformanceTimeOrigin, stringMatchesSomePattern } from '@sentry/utils';
import { addInstrumentationHandler, SENTRY_XHR_DATA_KEY, dynamicSamplingContextToSentryBaggageHeader, generateSentryTraceHeader, BAGGAGE_HEADER_NAME, browserPerformanceTimeOrigin, stringMatchesSomePattern } from '@sentry/utils';
import { instrumentFetchRequest } from '../common/fetch.js';
import { addPerformanceInstrumentationHandler } from './instrument.js';

@@ -50,3 +51,3 @@

addInstrumentationHandler('fetch', (handlerData) => {
const createdSpan = fetchCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);
const createdSpan = instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);
if (enableHTTPTimings && createdSpan) {

@@ -173,167 +174,2 @@ addHTTPTimings(createdSpan);

/**
* Create and track fetch request spans
*
* @returns Span if a span was created, otherwise void.
*/
function fetchCallback(
handlerData,
shouldCreateSpan,
shouldAttachHeaders,
spans,
) {
if (!hasTracingEnabled() || !handlerData.fetchData) {
return undefined;
}
const shouldCreateSpanResult = shouldCreateSpan(handlerData.fetchData.url);
if (handlerData.endTimestamp && shouldCreateSpanResult) {
const spanId = handlerData.fetchData.__span;
if (!spanId) return;
const span = spans[spanId];
if (span) {
if (handlerData.response) {
// TODO (kmclb) remove this once types PR goes through
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
span.setHttpStatus(handlerData.response.status);
const contentLength =
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
handlerData.response && handlerData.response.headers && handlerData.response.headers.get('content-length');
const contentLengthNum = parseInt(contentLength);
if (contentLengthNum > 0) {
span.setData('http.response_content_length', contentLengthNum);
}
} else if (handlerData.error) {
span.setStatus('internal_error');
}
span.finish();
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
delete spans[spanId];
}
return undefined;
}
const hub = getCurrentHub();
const scope = hub.getScope();
const client = hub.getClient();
const parentSpan = scope.getSpan();
const { method, url } = handlerData.fetchData;
const span =
shouldCreateSpanResult && parentSpan
? parentSpan.startChild({
data: {
url,
type: 'fetch',
'http.method': method,
},
description: `${method} ${url}`,
op: 'http.client',
origin: 'auto.http.browser',
})
: undefined;
if (span) {
handlerData.fetchData.__span = span.spanId;
spans[span.spanId] = span;
}
if (shouldAttachHeaders(handlerData.fetchData.url) && client) {
const request = handlerData.args[0];
// In case the user hasn't set the second argument of a fetch call we default it to `{}`.
handlerData.args[1] = handlerData.args[1] || {};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const options = handlerData.args[1];
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
options.headers = addTracingHeadersToFetchRequest(request, client, scope, options, span);
}
return span;
}
/**
* Adds sentry-trace and baggage headers to the various forms of fetch headers
*/
function addTracingHeadersToFetchRequest(
request, // unknown is actually type Request but we can't export DOM types from this package,
client,
scope,
options
,
requestSpan,
) {
const span = requestSpan || scope.getSpan();
const transaction = span && span.transaction;
const { traceId, sampled, dsc } = scope.getPropagationContext();
const sentryTraceHeader = span ? span.toTraceparent() : generateSentryTraceHeader(traceId, undefined, sampled);
const dynamicSamplingContext = transaction
? transaction.getDynamicSamplingContext()
: dsc
? dsc
: getDynamicSamplingContextFromClient(traceId, client, scope);
const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);
const headers =
typeof Request !== 'undefined' && isInstanceOf(request, Request) ? (request ).headers : options.headers;
if (!headers) {
return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader };
} else if (typeof Headers !== 'undefined' && isInstanceOf(headers, Headers)) {
const newHeaders = new Headers(headers );
newHeaders.append('sentry-trace', sentryTraceHeader);
if (sentryBaggageHeader) {
// If the same header is appended multiple times the browser will merge the values into a single request header.
// Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header.
newHeaders.append(BAGGAGE_HEADER_NAME, sentryBaggageHeader);
}
return newHeaders ;
} else if (Array.isArray(headers)) {
const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]];
if (sentryBaggageHeader) {
// If there are multiple entries with the same key, the browser will merge the values into a single request header.
// Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header.
newHeaders.push([BAGGAGE_HEADER_NAME, sentryBaggageHeader]);
}
return newHeaders ;
} else {
const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined;
const newBaggageHeaders = [];
if (Array.isArray(existingBaggageHeader)) {
newBaggageHeaders.push(...existingBaggageHeader);
} else if (existingBaggageHeader) {
newBaggageHeaders.push(existingBaggageHeader);
}
if (sentryBaggageHeader) {
newBaggageHeaders.push(sentryBaggageHeader);
}
return {
...(headers ),
'sentry-trace': sentryTraceHeader,
baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,
};
}
}
/**
* Create and track xhr request spans

@@ -439,3 +275,3 @@ *

export { DEFAULT_TRACE_PROPAGATION_TARGETS, addTracingHeadersToFetchRequest, defaultRequestInstrumentationOptions, extractNetworkProtocol, fetchCallback, instrumentOutgoingRequests, shouldAttachHeaders, xhrCallback };
export { DEFAULT_TRACE_PROPAGATION_TARGETS, defaultRequestInstrumentationOptions, extractNetworkProtocol, instrumentOutgoingRequests, shouldAttachHeaders, xhrCallback };
//# sourceMappingURL=request.js.map

@@ -12,5 +12,6 @@ export { IdleTransaction, Span, SpanStatus, Transaction, extractTraceparentData, getActiveTransaction, hasTracingEnabled, spanStatusfromHttpCode, startIdleTransaction } from '@sentry/core';

export { BROWSER_TRACING_INTEGRATION_ID, BrowserTracing } from './browser/browsertracing.js';
export { addTracingHeadersToFetchRequest, defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './browser/request.js';
export { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './browser/request.js';
export { addClsInstrumentationHandler, addFidInstrumentationHandler, addLcpInstrumentationHandler, addPerformanceInstrumentationHandler } from './browser/instrument.js';
export { addTracingHeadersToFetchRequest, instrumentFetchRequest } from './common/fetch.js';
export { addExtensionMethods } from './extensions.js';
//# sourceMappingURL=index.js.map
import { _optionalChain } from '@sentry/utils';
import { logger, getNumberOfUrlSegments, stripUrlQueryAndFragment, extractPathForTransaction, isRegExp } from '@sentry/utils';
import { logger, getNumberOfUrlSegments, stripUrlQueryAndFragment, extractPathForTransaction, isRegExp, GLOBAL_OBJ } from '@sentry/utils';
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js';

@@ -398,3 +398,4 @@

// parse node.js major version
const [major] = process.versions.node.split('.').map(Number);
// Next.js will complain if we directly use `proces.versions` here because of edge runtime.
const [major] = (GLOBAL_OBJ ).process.versions.node.split('.').map(Number);

@@ -401,0 +402,0 @@ // allow call extractOriginalRoute only if node version support Regex d flag, node 16+

{
"name": "@sentry-internal/tracing",
"version": "7.80.2-alpha.1",
"version": "7.81.0",
"description": "Sentry Internal Tracing Package",

@@ -26,5 +26,5 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

"dependencies": {
"@sentry/core": "7.80.2-alpha.1",
"@sentry/types": "7.80.2-alpha.1",
"@sentry/utils": "7.80.2-alpha.1"
"@sentry/core": "7.81.0",
"@sentry/types": "7.81.0",
"@sentry/utils": "7.81.0"
},

@@ -31,0 +31,0 @@ "devDependencies": {

export * from '../exports';
export { RequestInstrumentationOptions } from './request';
export { BrowserTracing, BROWSER_TRACING_INTEGRATION_ID } from './browsertracing';
export { instrumentOutgoingRequests, defaultRequestInstrumentationOptions, addTracingHeadersToFetchRequest, } from './request';
export { instrumentOutgoingRequests, defaultRequestInstrumentationOptions } from './request';
export { addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addFidInstrumentationHandler, addLcpInstrumentationHandler, } from './instrument';
//# sourceMappingURL=index.d.ts.map

@@ -1,2 +0,2 @@

import { Client, Scope, Span } from '@sentry/types';
import { Span } from '@sentry/types';
import { SENTRY_XHR_DATA_KEY } from '@sentry/utils';

@@ -48,15 +48,2 @@ export declare const DEFAULT_TRACE_PROPAGATION_TARGETS: (string | RegExp)[];

}
/** Data returned from fetch callback */
export interface FetchData {
args: any[];
fetchData?: {
method: string;
url: string;
__span?: string;
};
response?: any;
error?: unknown;
startTimestamp: number;
endTimestamp?: number;
}
/** Data returned from XHR request */

@@ -79,10 +66,2 @@ export interface XHRData {

}
type PolymorphicRequestHeaders = Record<string, string | undefined> | Array<[
string,
string
]> | {
[key: string]: any;
append: (key: string, value: string) => void;
get: (key: string) => string | null | undefined;
};
export declare const defaultRequestInstrumentationOptions: RequestInstrumentationOptions;

@@ -108,17 +87,2 @@ /** Registers span creators for xhr and fetch requests */

/**
* Create and track fetch request spans
*
* @returns Span if a span was created, otherwise void.
*/
export declare function fetchCallback(handlerData: FetchData, shouldCreateSpan: (url: string) => boolean, shouldAttachHeaders: (url: string) => boolean, spans: Record<string, Span>): Span | undefined;
/**
* Adds sentry-trace and baggage headers to the various forms of fetch headers
*/
export declare function addTracingHeadersToFetchRequest(request: string | unknown, // unknown is actually type Request but we can't export DOM types from this package,
client: Client, scope: Scope, options: {
headers?: {
[key: string]: string[] | string | undefined;
} | PolymorphicRequestHeaders;
}, requestSpan?: Span): PolymorphicRequestHeaders | undefined;
/**
* Create and track xhr request spans

@@ -129,3 +93,2 @@ *

export declare function xhrCallback(handlerData: XHRData, shouldCreateSpan: (url: string) => boolean, shouldAttachHeaders: (url: string) => boolean, spans: Record<string, Span>): Span | undefined;
export {};
//# sourceMappingURL=request.d.ts.map
export * from './exports';
export { Apollo, Express, GraphQL, Mongo, Mysql, Postgres, Prisma, lazyLoadedNodePerformanceMonitoringIntegrations, } from './node';
export { LazyLoadedIntegration } from './node';
export { BrowserTracing, BROWSER_TRACING_INTEGRATION_ID, instrumentOutgoingRequests, defaultRequestInstrumentationOptions, addTracingHeadersToFetchRequest, addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addFidInstrumentationHandler, addLcpInstrumentationHandler, } from './browser';
export { BrowserTracing, BROWSER_TRACING_INTEGRATION_ID, instrumentOutgoingRequests, defaultRequestInstrumentationOptions, addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addFidInstrumentationHandler, addLcpInstrumentationHandler, } from './browser';
export { addTracingHeadersToFetchRequest, instrumentFetchRequest } from './common/fetch';
export { RequestInstrumentationOptions } from './browser';
export { addExtensionMethods } from './extensions';
//# sourceMappingURL=index.d.ts.map
export * from '../exports';
export type { RequestInstrumentationOptions } from './request';
export { BrowserTracing, BROWSER_TRACING_INTEGRATION_ID } from './browsertracing';
export { instrumentOutgoingRequests, defaultRequestInstrumentationOptions, addTracingHeadersToFetchRequest, } from './request';
export { instrumentOutgoingRequests, defaultRequestInstrumentationOptions } from './request';
export { addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addFidInstrumentationHandler, addLcpInstrumentationHandler, } from './instrument';
//# sourceMappingURL=index.d.ts.map

@@ -1,2 +0,2 @@

import type { Client, Scope, Span } from '@sentry/types';
import type { Span } from '@sentry/types';
import { SENTRY_XHR_DATA_KEY } from '@sentry/utils';

@@ -48,15 +48,2 @@ export declare const DEFAULT_TRACE_PROPAGATION_TARGETS: (string | RegExp)[];

}
/** Data returned from fetch callback */
export interface FetchData {
args: any[];
fetchData?: {
method: string;
url: string;
__span?: string;
};
response?: any;
error?: unknown;
startTimestamp: number;
endTimestamp?: number;
}
/** Data returned from XHR request */

@@ -79,7 +66,2 @@ export interface XHRData {

}
type PolymorphicRequestHeaders = Record<string, string | undefined> | Array<[string, string]> | {
[key: string]: any;
append: (key: string, value: string) => void;
get: (key: string) => string | null | undefined;
};
export declare const defaultRequestInstrumentationOptions: RequestInstrumentationOptions;

@@ -105,17 +87,2 @@ /** Registers span creators for xhr and fetch requests */

/**
* Create and track fetch request spans
*
* @returns Span if a span was created, otherwise void.
*/
export declare function fetchCallback(handlerData: FetchData, shouldCreateSpan: (url: string) => boolean, shouldAttachHeaders: (url: string) => boolean, spans: Record<string, Span>): Span | undefined;
/**
* Adds sentry-trace and baggage headers to the various forms of fetch headers
*/
export declare function addTracingHeadersToFetchRequest(request: string | unknown, // unknown is actually type Request but we can't export DOM types from this package,
client: Client, scope: Scope, options: {
headers?: {
[key: string]: string[] | string | undefined;
} | PolymorphicRequestHeaders;
}, requestSpan?: Span): PolymorphicRequestHeaders | undefined;
/**
* Create and track xhr request spans

@@ -126,3 +93,2 @@ *

export declare function xhrCallback(handlerData: XHRData, shouldCreateSpan: (url: string) => boolean, shouldAttachHeaders: (url: string) => boolean, spans: Record<string, Span>): Span | undefined;
export {};
//# sourceMappingURL=request.d.ts.map
export * from './exports';
export { Apollo, Express, GraphQL, Mongo, Mysql, Postgres, Prisma, lazyLoadedNodePerformanceMonitoringIntegrations, } from './node';
export type { LazyLoadedIntegration } from './node';
export { BrowserTracing, BROWSER_TRACING_INTEGRATION_ID, instrumentOutgoingRequests, defaultRequestInstrumentationOptions, addTracingHeadersToFetchRequest, addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addFidInstrumentationHandler, addLcpInstrumentationHandler, } from './browser';
export { BrowserTracing, BROWSER_TRACING_INTEGRATION_ID, instrumentOutgoingRequests, defaultRequestInstrumentationOptions, addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addFidInstrumentationHandler, addLcpInstrumentationHandler, } from './browser';
export { addTracingHeadersToFetchRequest, instrumentFetchRequest } from './common/fetch';
export type { RequestInstrumentationOptions } from './browser';
export { addExtensionMethods } from './extensions';
//# sourceMappingURL=index.d.ts.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc