Socket
Socket
Sign inDemoInstall

@sentry/core

Package Overview
Dependencies
2
Maintainers
11
Versions
476
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.100.1 to 7.101.0

cjs/metrics/metric-summary.js

43

cjs/hub.js

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

* @param version number, higher number means higher priority.
*
* @deprecated Instantiation of Hub objects is deprecated and the constructor will be removed in version 8 of the SDK.
*
* If you are currently using the Hub for multi-client use like so:
*
* ```
* // OLD
* const hub = new Hub();
* hub.bindClient(client);
* makeMain(hub)
* ```
*
* instead initialize the client as follows:
*
* ```
* // NEW
* Sentry.withIsolationScope(() => {
* Sentry.setCurrentClient(client);
* client.init();
* });
* ```
*
* If you are using the Hub to capture events like so:
*
* ```
* // OLD
* const client = new Client();
* const hub = new Hub(client);
* hub.captureException()
* ```
*
* instead capture isolated events as follows:
*
* ```
* // NEW
* const client = new Client();
* const scope = new Scope();
* scope.setClient(client);
* scope.captureException();
* ```
*/

@@ -670,2 +710,3 @@ constructor(

) {
// eslint-disable-next-line deprecation/deprecation
setHubOnCarrier(registry, new Hub());

@@ -696,2 +737,3 @@ }

const isolationScope = parent.getIsolationScope();
// eslint-disable-next-line deprecation/deprecation
setHubOnCarrier(carrier, new Hub(client, scope.clone(), isolationScope.clone()));

@@ -746,2 +788,3 @@ }

function getHubFromCarrier(carrier) {
// eslint-disable-next-line deprecation/deprecation
return utils.getGlobalSingleton('hub', () => new Hub(), carrier);

@@ -748,0 +791,0 @@ }

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

const instance = require('./instance.js');
const metricSummary = require('./metric-summary.js');
const utils = require('./utils.js');

@@ -54,3 +55,7 @@

const bucketKey = utils.getBucketKey(metricType, name, unit, tags);
let bucketItem = this._buckets.get(bucketKey);
// If this is a set metric, we need to calculate the delta from the previous weight.
const previousWeight = bucketItem && metricType === constants.SET_METRIC_TYPE ? bucketItem.metric.weight : 0;
if (bucketItem) {

@@ -75,2 +80,6 @@ bucketItem.metric.add(value);

// If value is a string, it's a set metric so calculate the delta from the previous weight.
const val = typeof value === 'string' ? bucketItem.metric.weight - previousWeight : value;
metricSummary.updateMetricSummaryOnActiveSpan(metricType, name, val, unit, unsanitizedTags, bucketKey);
// We need to keep track of the total weight of the buckets so that we can

@@ -77,0 +86,0 @@ // flush them when we exceed the max weight.

16

cjs/metrics/browser-aggregator.js

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

const instance = require('./instance.js');
const metricSummary = require('./metric-summary.js');
const utils = require('./utils.js');

@@ -41,3 +42,7 @@

const bucketKey = utils.getBucketKey(metricType, name, unit, tags);
const bucketItem = this._buckets.get(bucketKey);
let bucketItem = this._buckets.get(bucketKey);
// If this is a set metric, we need to calculate the delta from the previous weight.
const previousWeight = bucketItem && metricType === constants.SET_METRIC_TYPE ? bucketItem.metric.weight : 0;
if (bucketItem) {

@@ -50,3 +55,3 @@ bucketItem.metric.add(value);

} else {
this._buckets.set(bucketKey, {
bucketItem = {
// @ts-expect-error we don't need to narrow down the type of value here, saves bundle size.

@@ -59,4 +64,9 @@ metric: new instance.METRIC_MAP[metricType](value),

tags,
});
};
this._buckets.set(bucketKey, bucketItem);
}
// If value is a string, it's a set metric so calculate the delta from the previous weight.
const val = typeof value === 'string' ? bucketItem.metric.weight - previousWeight : value;
metricSummary.updateMetricSummaryOnActiveSpan(metricType, name, val, unit, unsanitizedTags, bucketKey);
}

@@ -63,0 +73,0 @@

2

cjs/metrics/constants.js

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

*/
const TAG_VALUE_NORMALIZATION_REGEX = /[^\w\d_:/@.{}[\]$-]+/g;
const TAG_VALUE_NORMALIZATION_REGEX = /[^\w\d\s_:/@.{}[\]$-]+/g;

@@ -29,0 +29,0 @@ /**

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

const sanitizedKey = key.replace(constants.NAME_AND_TAG_KEY_NORMALIZATION_REGEX, '_');
tags[sanitizedKey] = String(unsanitizedTags[key]).replace(constants.TAG_VALUE_NORMALIZATION_REGEX, '_');
tags[sanitizedKey] = String(unsanitizedTags[key]).replace(constants.TAG_VALUE_NORMALIZATION_REGEX, '');
}

@@ -68,0 +68,0 @@ }

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

const debugBuild = require('../debug-build.js');
const metricSummary = require('../metrics/metric-summary.js');
const semanticAttributes = require('../semanticAttributes.js');

@@ -46,3 +47,3 @@ const getRootSpan = require('../utils/getRootSpan.js');

* Tags for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/

@@ -52,3 +53,3 @@

* Data for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/

@@ -230,3 +231,3 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any

* Attributes for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/

@@ -592,2 +593,3 @@ get attributes() {

origin: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] ,
_metrics_summary: metricSummary.getMetricSummaryJsonForSpan(this),
});

@@ -594,0 +596,0 @@ }

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

const hub = require('../hub.js');
const metricSummary = require('../metrics/metric-summary.js');
const semanticAttributes = require('../semanticAttributes.js');

@@ -311,2 +312,3 @@ const spanUtils = require('../utils/spanUtils.js');

},
_metrics_summary: metricSummary.getMetricSummaryJsonForSpan(this),
...(source && {

@@ -313,0 +315,0 @@ transaction_info: {

Object.defineProperty(exports, '__esModule', { value: true });
const SDK_VERSION = '7.100.1';
const SDK_VERSION = '7.101.0';
exports.SDK_VERSION = SDK_VERSION;
//# sourceMappingURL=version.js.map

@@ -39,2 +39,42 @@ import { isThenable, uuid4, dateTimestampInSeconds, consoleSandbox, logger, GLOBAL_OBJ, getGlobalSingleton } from '@sentry/utils';

* @param version number, higher number means higher priority.
*
* @deprecated Instantiation of Hub objects is deprecated and the constructor will be removed in version 8 of the SDK.
*
* If you are currently using the Hub for multi-client use like so:
*
* ```
* // OLD
* const hub = new Hub();
* hub.bindClient(client);
* makeMain(hub)
* ```
*
* instead initialize the client as follows:
*
* ```
* // NEW
* Sentry.withIsolationScope(() => {
* Sentry.setCurrentClient(client);
* client.init();
* });
* ```
*
* If you are using the Hub to capture events like so:
*
* ```
* // OLD
* const client = new Client();
* const hub = new Hub(client);
* hub.captureException()
* ```
*
* instead capture isolated events as follows:
*
* ```
* // NEW
* const client = new Client();
* const scope = new Scope();
* scope.setClient(client);
* scope.captureException();
* ```
*/

@@ -668,2 +708,3 @@ constructor(

) {
// eslint-disable-next-line deprecation/deprecation
setHubOnCarrier(registry, new Hub());

@@ -694,2 +735,3 @@ }

const isolationScope = parent.getIsolationScope();
// eslint-disable-next-line deprecation/deprecation
setHubOnCarrier(carrier, new Hub(client, scope.clone(), isolationScope.clone()));

@@ -744,2 +786,3 @@ }

function getHubFromCarrier(carrier) {
// eslint-disable-next-line deprecation/deprecation
return getGlobalSingleton('hub', () => new Hub(), carrier);

@@ -746,0 +789,0 @@ }

import { timestampInSeconds } from '@sentry/utils';
import { DEFAULT_FLUSH_INTERVAL, NAME_AND_TAG_KEY_NORMALIZATION_REGEX, MAX_WEIGHT } from './constants.js';
import { DEFAULT_FLUSH_INTERVAL, NAME_AND_TAG_KEY_NORMALIZATION_REGEX, SET_METRIC_TYPE, MAX_WEIGHT } from './constants.js';
import { METRIC_MAP } from './instance.js';
import { updateMetricSummaryOnActiveSpan } from './metric-summary.js';
import { sanitizeTags, getBucketKey } from './utils.js';

@@ -51,3 +52,7 @@

const bucketKey = getBucketKey(metricType, name, unit, tags);
let bucketItem = this._buckets.get(bucketKey);
// If this is a set metric, we need to calculate the delta from the previous weight.
const previousWeight = bucketItem && metricType === SET_METRIC_TYPE ? bucketItem.metric.weight : 0;
if (bucketItem) {

@@ -72,2 +77,6 @@ bucketItem.metric.add(value);

// If value is a string, it's a set metric so calculate the delta from the previous weight.
const val = typeof value === 'string' ? bucketItem.metric.weight - previousWeight : value;
updateMetricSummaryOnActiveSpan(metricType, name, val, unit, unsanitizedTags, bucketKey);
// We need to keep track of the total weight of the buckets so that we can

@@ -74,0 +83,0 @@ // flush them when we exceed the max weight.

import { timestampInSeconds } from '@sentry/utils';
import { DEFAULT_BROWSER_FLUSH_INTERVAL, NAME_AND_TAG_KEY_NORMALIZATION_REGEX } from './constants.js';
import { DEFAULT_BROWSER_FLUSH_INTERVAL, NAME_AND_TAG_KEY_NORMALIZATION_REGEX, SET_METRIC_TYPE } from './constants.js';
import { METRIC_MAP } from './instance.js';
import { updateMetricSummaryOnActiveSpan } from './metric-summary.js';
import { sanitizeTags, getBucketKey } from './utils.js';

@@ -38,3 +39,7 @@

const bucketKey = getBucketKey(metricType, name, unit, tags);
const bucketItem = this._buckets.get(bucketKey);
let bucketItem = this._buckets.get(bucketKey);
// If this is a set metric, we need to calculate the delta from the previous weight.
const previousWeight = bucketItem && metricType === SET_METRIC_TYPE ? bucketItem.metric.weight : 0;
if (bucketItem) {

@@ -47,3 +52,3 @@ bucketItem.metric.add(value);

} else {
this._buckets.set(bucketKey, {
bucketItem = {
// @ts-expect-error we don't need to narrow down the type of value here, saves bundle size.

@@ -56,4 +61,9 @@ metric: new METRIC_MAP[metricType](value),

tags,
});
};
this._buckets.set(bucketKey, bucketItem);
}
// If value is a string, it's a set metric so calculate the delta from the previous weight.
const val = typeof value === 'string' ? bucketItem.metric.weight - previousWeight : value;
updateMetricSummaryOnActiveSpan(metricType, name, val, unit, unsanitizedTags, bucketKey);
}

@@ -60,0 +70,0 @@

@@ -24,3 +24,3 @@ const COUNTER_METRIC_TYPE = 'c' ;

*/
const TAG_VALUE_NORMALIZATION_REGEX = /[^\w\d_:/@.{}[\]$-]+/g;
const TAG_VALUE_NORMALIZATION_REGEX = /[^\w\d\s_:/@.{}[\]$-]+/g;

@@ -27,0 +27,0 @@ /**

@@ -63,3 +63,3 @@ import { dropUndefinedKeys } from '@sentry/utils';

const sanitizedKey = key.replace(NAME_AND_TAG_KEY_NORMALIZATION_REGEX, '_');
tags[sanitizedKey] = String(unsanitizedTags[key]).replace(TAG_VALUE_NORMALIZATION_REGEX, '_');
tags[sanitizedKey] = String(unsanitizedTags[key]).replace(TAG_VALUE_NORMALIZATION_REGEX, '');
}

@@ -66,0 +66,0 @@ }

import { uuid4, timestampInSeconds, logger, dropUndefinedKeys } from '@sentry/utils';
import { DEBUG_BUILD } from '../debug-build.js';
import { getMetricSummaryJsonForSpan } from '../metrics/metric-summary.js';
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_OP } from '../semanticAttributes.js';

@@ -43,3 +44,3 @@ import { getRootSpan } from '../utils/getRootSpan.js';

* Tags for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/

@@ -49,3 +50,3 @@

* Data for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/

@@ -227,3 +228,3 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any

* Attributes for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/

@@ -589,2 +590,3 @@ get attributes() {

origin: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] ,
_metrics_summary: getMetricSummaryJsonForSpan(this),
});

@@ -591,0 +593,0 @@ }

import { dropUndefinedKeys, logger } from '@sentry/utils';
import { DEBUG_BUILD } from '../debug-build.js';
import { getCurrentHub } from '../hub.js';
import { getMetricSummaryJsonForSpan } from '../metrics/metric-summary.js';
import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '../semanticAttributes.js';

@@ -308,2 +309,3 @@ import { spanTimeInputToSeconds, spanToJSON, spanToTraceContext } from '../utils/spanUtils.js';

},
_metrics_summary: getMetricSummaryJsonForSpan(this),
...(source && {

@@ -310,0 +312,0 @@ transaction_info: {

@@ -1,4 +0,4 @@

const SDK_VERSION = '7.100.1';
const SDK_VERSION = '7.101.0';
export { SDK_VERSION };
//# sourceMappingURL=version.js.map
{
"name": "@sentry/core",
"version": "7.100.1",
"version": "7.101.0",
"description": "Base implementation for all Sentry JavaScript SDKs",

@@ -32,4 +32,4 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

"dependencies": {
"@sentry/types": "7.100.1",
"@sentry/utils": "7.100.1"
"@sentry/types": "7.101.0",
"@sentry/utils": "7.101.0"
},

@@ -36,0 +36,0 @@ "madge": {

@@ -74,2 +74,42 @@ import { Breadcrumb, BreadcrumbHint, Client, CustomSamplingContext, Event, EventHint, Extra, Extras, Hub as HubInterface, Integration, IntegrationClass, Primitive, Session, SessionContext, Severity, SeverityLevel, Transaction, TransactionContext, User } from '@sentry/types';

* @param version number, higher number means higher priority.
*
* @deprecated Instantiation of Hub objects is deprecated and the constructor will be removed in version 8 of the SDK.
*
* If you are currently using the Hub for multi-client use like so:
*
* ```
* // OLD
* const hub = new Hub();
* hub.bindClient(client);
* makeMain(hub)
* ```
*
* instead initialize the client as follows:
*
* ```
* // NEW
* Sentry.withIsolationScope(() => {
* Sentry.setCurrentClient(client);
* client.init();
* });
* ```
*
* If you are using the Hub to capture events like so:
*
* ```
* // OLD
* const client = new Client();
* const hub = new Hub(client);
* hub.captureException()
* ```
*
* instead capture isolated events as follows:
*
* ```
* // NEW
* const client = new Client();
* const scope = new Scope();
* scope.setClient(client);
* scope.captureException();
* ```
*/

@@ -76,0 +116,0 @@ constructor(client?: Client, scope?: Scope, isolationScope?: Scope, _version?: number);

@@ -27,3 +27,3 @@ import { Instrumenter, Primitive, Span as SpanInterface, SpanAttributeValue, SpanAttributes, SpanContext, SpanContextData, SpanJSON, SpanOrigin, SpanTimeInput, TraceContext, Transaction } from '@sentry/types';

* Tags for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/

@@ -35,3 +35,3 @@ tags: {

* Data for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/

@@ -141,3 +141,3 @@ data: {

* Attributes for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.

@@ -144,0 +144,0 @@

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

export declare const SDK_VERSION = "7.100.1";
export declare const SDK_VERSION = "7.101.0";
//# sourceMappingURL=version.d.ts.map

@@ -74,2 +74,42 @@ import type { Breadcrumb, BreadcrumbHint, Client, CustomSamplingContext, Event, EventHint, Extra, Extras, Hub as HubInterface, Integration, IntegrationClass, Primitive, Session, SessionContext, Severity, SeverityLevel, Transaction, TransactionContext, User } from '@sentry/types';

* @param version number, higher number means higher priority.
*
* @deprecated Instantiation of Hub objects is deprecated and the constructor will be removed in version 8 of the SDK.
*
* If you are currently using the Hub for multi-client use like so:
*
* ```
* // OLD
* const hub = new Hub();
* hub.bindClient(client);
* makeMain(hub)
* ```
*
* instead initialize the client as follows:
*
* ```
* // NEW
* Sentry.withIsolationScope(() => {
* Sentry.setCurrentClient(client);
* client.init();
* });
* ```
*
* If you are using the Hub to capture events like so:
*
* ```
* // OLD
* const client = new Client();
* const hub = new Hub(client);
* hub.captureException()
* ```
*
* instead capture isolated events as follows:
*
* ```
* // NEW
* const client = new Client();
* const scope = new Scope();
* scope.setClient(client);
* scope.captureException();
* ```
*/

@@ -76,0 +116,0 @@ constructor(client?: Client, scope?: Scope, isolationScope?: Scope, _version?: number);

@@ -27,3 +27,3 @@ import type { Instrumenter, Primitive, Span as SpanInterface, SpanAttributeValue, SpanAttributes, SpanContext, SpanContextData, SpanJSON, SpanOrigin, SpanTimeInput, TraceContext, Transaction } from '@sentry/types';

* Tags for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/

@@ -35,3 +35,3 @@ tags: {

* Data for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/

@@ -147,3 +147,3 @@ data: {

* Attributes for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/

@@ -150,0 +150,0 @@ get attributes(): SpanAttributes;

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

export declare const SDK_VERSION = "7.100.1";
export declare const SDK_VERSION = "7.101.0";
//# sourceMappingURL=version.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

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc