Socket
Socket
Sign inDemoInstall

@sentry-internal/tracing

Package Overview
Dependencies
Maintainers
10
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.74.2-alpha.1 to 7.75.0

cjs/browser/instrument.js

37

cjs/browser/metrics/index.js

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

const utils = require('@sentry/utils');
const instrument = require('../instrument.js');
const types = require('../types.js');
const getCLS = require('../web-vitals/getCLS.js');
const getFID = require('../web-vitals/getFID.js');
const getLCP = require('../web-vitals/getLCP.js');
const getVisibilityWatcher = require('../web-vitals/lib/getVisibilityWatcher.js');
const observe = require('../web-vitals/lib/observe.js');
const utils$1 = require('./utils.js');

@@ -45,3 +42,3 @@

}
_trackFID();
const fidCallback = _trackFID();
const clsCallback = _trackCLS();

@@ -51,8 +48,5 @@ const lcpCallback = _trackLCP();

return () => {
if (clsCallback) {
clsCallback();
}
if (lcpCallback) {
lcpCallback();
}
fidCallback();
clsCallback();
lcpCallback();
};

@@ -68,3 +62,3 @@ }

function startTrackingLongTasks() {
const entryHandler = (entries) => {
instrument.addPerformanceInstrumentationHandler('longtask', ({ entries }) => {
for (const entry of entries) {

@@ -86,5 +80,3 @@ const transaction = core.getActiveTransaction() ;

}
};
observe.observe('longtask', entryHandler);
});
}

@@ -96,3 +88,3 @@

function startTrackingInteractions() {
const entryHandler = (entries) => {
instrument.addPerformanceInstrumentationHandler('event', ({ entries }) => {
for (const entry of entries) {

@@ -117,5 +109,3 @@ const transaction = core.getActiveTransaction() ;

}
};
observe.observe('event', entryHandler, { durationThreshold: 0 });
});
}

@@ -125,6 +115,3 @@

function _trackCLS() {
// See:
// https://web.dev/evolving-cls/
// https://web.dev/cls-web-tooling/
return getCLS.onCLS(metric => {
return instrument.addClsInstrumentationHandler(({ metric }) => {
const entry = metric.entries.pop();

@@ -143,3 +130,3 @@ if (!entry) {

function _trackLCP() {
return getLCP.onLCP(metric => {
return instrument.addLcpInstrumentationHandler(({ metric }) => {
const entry = metric.entries.pop();

@@ -158,3 +145,3 @@ if (!entry) {

function _trackFID() {
getFID.onFID(metric => {
return instrument.addFidInstrumentationHandler(({ metric }) => {
const entry = metric.entries.pop();

@@ -161,0 +148,0 @@ if (!entry) {

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

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

@@ -86,4 +87,8 @@ /* eslint-disable max-lines */

const url = span.data.url;
const observer = new PerformanceObserver(list => {
const entries = list.getEntries();
if (!url) {
return;
}
const cleanup = instrument.addPerformanceInstrumentationHandler('resource', ({ entries }) => {
entries.forEach(entry => {

@@ -93,9 +98,8 @@ if (isPerformanceResourceTiming(entry) && entry.name.endsWith(url)) {

spanData.forEach(data => span.setData(...data));
observer.disconnect();
// In the next tick, clean this handler up
// We have to wait here because otherwise this cleans itself up before it is fully done
setTimeout(cleanup);
}
});
});
observer.observe({
entryTypes: ['resource'],
});
}

@@ -102,0 +106,0 @@

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

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

@@ -44,3 +45,7 @@

exports.instrumentOutgoingRequests = request.instrumentOutgoingRequests;
exports.addClsInstrumentationHandler = instrument.addClsInstrumentationHandler;
exports.addFidInstrumentationHandler = instrument.addFidInstrumentationHandler;
exports.addLcpInstrumentationHandler = instrument.addLcpInstrumentationHandler;
exports.addPerformanceInstrumentationHandler = instrument.addPerformanceInstrumentationHandler;
exports.addExtensionMethods = extensions.addExtensionMethods;
//# sourceMappingURL=index.js.map

@@ -283,3 +283,3 @@ var {

// If we've reached our final destination, we update the transaction name.
const urlLength = utils.getNumberOfUrlSegments(req.originalUrl || '') + numExtraSegments;
const urlLength = utils.getNumberOfUrlSegments(utils.stripUrlQueryAndFragment(req.originalUrl || '')) + numExtraSegments;
const routeLength = utils.getNumberOfUrlSegments(req._reconstructedRoute);

@@ -286,0 +286,0 @@

import { getActiveTransaction } from '@sentry/core';
import { browserPerformanceTimeOrigin, logger, htmlTreeAsString } from '@sentry/utils';
import { browserPerformanceTimeOrigin, htmlTreeAsString, logger } from '@sentry/utils';
import { addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addLcpInstrumentationHandler, addFidInstrumentationHandler } from '../instrument.js';
import { WINDOW } from '../types.js';
import { onCLS } from '../web-vitals/getCLS.js';
import { onFID } from '../web-vitals/getFID.js';
import { onLCP } from '../web-vitals/getLCP.js';
import { getVisibilityWatcher } from '../web-vitals/lib/getVisibilityWatcher.js';
import { observe } from '../web-vitals/lib/observe.js';
import { _startChild, isMeasurementValue } from './utils.js';

@@ -42,3 +39,3 @@

}
_trackFID();
const fidCallback = _trackFID();
const clsCallback = _trackCLS();

@@ -48,8 +45,5 @@ const lcpCallback = _trackLCP();

return () => {
if (clsCallback) {
clsCallback();
}
if (lcpCallback) {
lcpCallback();
}
fidCallback();
clsCallback();
lcpCallback();
};

@@ -65,3 +59,3 @@ }

function startTrackingLongTasks() {
const entryHandler = (entries) => {
addPerformanceInstrumentationHandler('longtask', ({ entries }) => {
for (const entry of entries) {

@@ -83,5 +77,3 @@ const transaction = getActiveTransaction() ;

}
};
observe('longtask', entryHandler);
});
}

@@ -93,3 +85,3 @@

function startTrackingInteractions() {
const entryHandler = (entries) => {
addPerformanceInstrumentationHandler('event', ({ entries }) => {
for (const entry of entries) {

@@ -114,5 +106,3 @@ const transaction = getActiveTransaction() ;

}
};
observe('event', entryHandler, { durationThreshold: 0 });
});
}

@@ -122,6 +112,3 @@

function _trackCLS() {
// See:
// https://web.dev/evolving-cls/
// https://web.dev/cls-web-tooling/
return onCLS(metric => {
return addClsInstrumentationHandler(({ metric }) => {
const entry = metric.entries.pop();

@@ -140,3 +127,3 @@ if (!entry) {

function _trackLCP() {
return onLCP(metric => {
return addLcpInstrumentationHandler(({ metric }) => {
const entry = metric.entries.pop();

@@ -155,3 +142,3 @@ if (!entry) {

function _trackFID() {
onFID(metric => {
return addFidInstrumentationHandler(({ metric }) => {
const entry = metric.entries.pop();

@@ -158,0 +145,0 @@ if (!entry) {

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

@@ -83,4 +84,8 @@ /* eslint-disable max-lines */

const url = span.data.url;
const observer = new PerformanceObserver(list => {
const entries = list.getEntries();
if (!url) {
return;
}
const cleanup = addPerformanceInstrumentationHandler('resource', ({ entries }) => {
entries.forEach(entry => {

@@ -90,9 +95,8 @@ if (isPerformanceResourceTiming(entry) && entry.name.endsWith(url)) {

spanData.forEach(data => span.setData(...data));
observer.disconnect();
// In the next tick, clean this handler up
// We have to wait here because otherwise this cleans itself up before it is fully done
setTimeout(cleanup);
}
});
});
observer.observe({
entryTypes: ['resource'],
});
}

@@ -99,0 +103,0 @@

@@ -13,3 +13,4 @@ export { IdleTransaction, Span, SpanStatus, Transaction, extractTraceparentData, getActiveTransaction, hasTracingEnabled, spanStatusfromHttpCode, startIdleTransaction } from '@sentry/core';

export { addTracingHeadersToFetchRequest, defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './browser/request.js';
export { addClsInstrumentationHandler, addFidInstrumentationHandler, addLcpInstrumentationHandler, addPerformanceInstrumentationHandler } from './browser/instrument.js';
export { addExtensionMethods } from './extensions.js';
//# sourceMappingURL=index.js.map

@@ -278,3 +278,3 @@ import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';

// If we've reached our final destination, we update the transaction name.
const urlLength = getNumberOfUrlSegments(req.originalUrl || '') + numExtraSegments;
const urlLength = getNumberOfUrlSegments(stripUrlQueryAndFragment(req.originalUrl || '')) + numExtraSegments;
const routeLength = getNumberOfUrlSegments(req._reconstructedRoute);

@@ -281,0 +281,0 @@

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

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

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

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

@@ -5,2 +5,3 @@ export * from '../exports';

export { instrumentOutgoingRequests, defaultRequestInstrumentationOptions, addTracingHeadersToFetchRequest, } from './request';
export { addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addFidInstrumentationHandler, addLcpInstrumentationHandler, } from './instrument';
//# sourceMappingURL=index.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, } from './browser';
export { BrowserTracing, BROWSER_TRACING_INTEGRATION_ID, instrumentOutgoingRequests, defaultRequestInstrumentationOptions, addTracingHeadersToFetchRequest, addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addFidInstrumentationHandler, addLcpInstrumentationHandler, } from './browser';
export { RequestInstrumentationOptions } from './browser';
export { addExtensionMethods } from './extensions';
//# sourceMappingURL=index.d.ts.map

@@ -5,2 +5,3 @@ export * from '../exports';

export { instrumentOutgoingRequests, defaultRequestInstrumentationOptions, addTracingHeadersToFetchRequest, } from './request';
export { addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addFidInstrumentationHandler, addLcpInstrumentationHandler, } from './instrument';
//# sourceMappingURL=index.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, } from './browser';
export { BrowserTracing, BROWSER_TRACING_INTEGRATION_ID, instrumentOutgoingRequests, defaultRequestInstrumentationOptions, addTracingHeadersToFetchRequest, addPerformanceInstrumentationHandler, addClsInstrumentationHandler, addFidInstrumentationHandler, addLcpInstrumentationHandler, } from './browser';
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