Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sentry/tracing

Package Overview
Dependencies
Maintainers
13
Versions
317
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/tracing - npm Package Compare versions

Comparing version 5.27.2 to 5.27.3

27

dist/browser/metrics.js

@@ -111,2 +111,28 @@ Object.defineProperty(exports, "__esModule", { value: true });

if (transaction.op === 'pageload') {
// normalize applicable web vital values to be relative to transaction.startTimestamp
var timeOrigin_1 = utils_2.msToSec(performance.timeOrigin);
['fcp', 'fp', 'lcp', 'ttfb'].forEach(function (name) {
if (!_this._measurements[name] || timeOrigin_1 >= transaction.startTimestamp) {
return;
}
// The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.
// Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need
// to be adjusted to be relative to transaction.startTimestamp.
var oldValue = _this._measurements[name].value;
var measurementTimestamp = timeOrigin_1 + utils_2.msToSec(oldValue);
// normalizedValue should be in milliseconds
var normalizedValue = (measurementTimestamp - transaction.startTimestamp) * 1000;
var delta = normalizedValue - oldValue;
utils_1.logger.log("[Measurements] Normalized " + name + " from " + _this._measurements[name].value + " to " + normalizedValue + " (" + delta + ")");
_this._measurements[name].value = normalizedValue;
});
if (this._measurements['mark.fid'] && this._measurements['fid']) {
// create span for FID
_startChild(transaction, {
description: 'first input delay',
endTimestamp: this._measurements['mark.fid'].value + utils_2.msToSec(this._measurements['fid'].value),
op: 'web.vitals',
startTimestamp: this._measurements['mark.fid'].value,
});
}
transaction.setMeasurements(this._measurements);

@@ -215,2 +241,3 @@ }

addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'connectEnd');
addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'domainLookupStart');
addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin);

@@ -217,0 +244,0 @@ addRequest(transaction, entry, timeOrigin);

6

dist/browser/web-vitals/getTTFB.js

@@ -17,3 +17,5 @@ /*

Object.defineProperty(exports, "__esModule", { value: true });
var utils_1 = require("@sentry/utils");
var initMetric_1 = require("./lib/initMetric");
var global = utils_1.getGlobalObject();
var afterLoad = function (callback) {

@@ -34,3 +36,3 @@ if (document.readyState === 'complete') {

// eslint-disable-next-line deprecation/deprecation
var timing = performance.timing;
var timing = global.performance.timing;
var navigationEntry = {

@@ -52,3 +54,3 @@ entryType: 'navigation',

// Use the NavigationTiming L2 entry if available.
var navigationEntry = performance.getEntriesByType('navigation')[0] || getNavigationEntryFromPerformanceTiming();
var navigationEntry = global.performance.getEntriesByType('navigation')[0] || getNavigationEntryFromPerformanceTiming();
metric.value = metric.delta = navigationEntry.responseStart;

@@ -55,0 +57,0 @@ metric.entries = [navigationEntry];

@@ -82,3 +82,4 @@ import { Span as SpanInterface, SpanContext, Transaction } from '@sentry/types';

/**
* You should never call the constructor manually, always use `hub.startSpan()`.
* You should never call the constructor manually, always use `Sentry.startTransaction()`
* or call `startChild()` on an existing span.
* @internal

@@ -85,0 +86,0 @@ * @hideconstructor

@@ -39,3 +39,4 @@ Object.defineProperty(exports, "__esModule", { value: true });

/**
* You should never call the constructor manually, always use `hub.startSpan()`.
* You should never call the constructor manually, always use `Sentry.startTransaction()`
* or call `startChild()` on an existing span.
* @internal

@@ -42,0 +43,0 @@ * @hideconstructor

@@ -110,2 +110,28 @@ import { __assign, __rest } from "tslib";

if (transaction.op === 'pageload') {
// normalize applicable web vital values to be relative to transaction.startTimestamp
var timeOrigin_1 = msToSec(performance.timeOrigin);
['fcp', 'fp', 'lcp', 'ttfb'].forEach(function (name) {
if (!_this._measurements[name] || timeOrigin_1 >= transaction.startTimestamp) {
return;
}
// The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.
// Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need
// to be adjusted to be relative to transaction.startTimestamp.
var oldValue = _this._measurements[name].value;
var measurementTimestamp = timeOrigin_1 + msToSec(oldValue);
// normalizedValue should be in milliseconds
var normalizedValue = (measurementTimestamp - transaction.startTimestamp) * 1000;
var delta = normalizedValue - oldValue;
logger.log("[Measurements] Normalized " + name + " from " + _this._measurements[name].value + " to " + normalizedValue + " (" + delta + ")");
_this._measurements[name].value = normalizedValue;
});
if (this._measurements['mark.fid'] && this._measurements['fid']) {
// create span for FID
_startChild(transaction, {
description: 'first input delay',
endTimestamp: this._measurements['mark.fid'].value + msToSec(this._measurements['fid'].value),
op: 'web.vitals',
startTimestamp: this._measurements['mark.fid'].value,
});
}
transaction.setMeasurements(this._measurements);

@@ -214,2 +240,3 @@ }

addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'connectEnd');
addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'domainLookupStart');
addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin);

@@ -216,0 +243,0 @@ addRequest(transaction, entry, timeOrigin);

@@ -16,3 +16,5 @@ /*

*/
import { getGlobalObject } from '@sentry/utils';
import { initMetric } from './lib/initMetric';
var global = getGlobalObject();
var afterLoad = function (callback) {

@@ -33,3 +35,3 @@ if (document.readyState === 'complete') {

// eslint-disable-next-line deprecation/deprecation
var timing = performance.timing;
var timing = global.performance.timing;
var navigationEntry = {

@@ -51,3 +53,3 @@ entryType: 'navigation',

// Use the NavigationTiming L2 entry if available.
var navigationEntry = performance.getEntriesByType('navigation')[0] || getNavigationEntryFromPerformanceTiming();
var navigationEntry = global.performance.getEntriesByType('navigation')[0] || getNavigationEntryFromPerformanceTiming();
metric.value = metric.delta = navigationEntry.responseStart;

@@ -54,0 +56,0 @@ metric.entries = [navigationEntry];

@@ -82,3 +82,4 @@ import { Span as SpanInterface, SpanContext, Transaction } from '@sentry/types';

/**
* You should never call the constructor manually, always use `hub.startSpan()`.
* You should never call the constructor manually, always use `Sentry.startTransaction()`
* or call `startChild()` on an existing span.
* @internal

@@ -85,0 +86,0 @@ * @hideconstructor

@@ -38,3 +38,4 @@ import { __assign } from "tslib";

/**
* You should never call the constructor manually, always use `hub.startSpan()`.
* You should never call the constructor manually, always use `Sentry.startTransaction()`
* or call `startChild()` on an existing span.
* @internal

@@ -41,0 +42,0 @@ * @hideconstructor

{
"name": "@sentry/tracing",
"version": "5.27.2",
"version": "5.27.3",
"description": "Extensions for Sentry AM",

@@ -19,11 +19,11 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

"dependencies": {
"@sentry/hub": "5.27.2",
"@sentry/minimal": "5.27.2",
"@sentry/types": "5.27.2",
"@sentry/utils": "5.27.2",
"@sentry/hub": "5.27.3",
"@sentry/minimal": "5.27.3",
"@sentry/types": "5.27.3",
"@sentry/utils": "5.27.3",
"tslib": "^1.9.3"
},
"devDependencies": {
"@sentry-internal/eslint-config-sdk": "5.27.2",
"@sentry/browser": "5.27.2",
"@sentry-internal/eslint-config-sdk": "5.27.3",
"@sentry/browser": "5.27.3",
"@types/express": "^4.17.1",

@@ -30,0 +30,0 @@ "@types/jsdom": "^16.2.3",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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

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