Socket
Socket
Sign inDemoInstall

@sentry/core

Package Overview
Dependencies
Maintainers
11
Versions
515
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/core - npm Package Compare versions

Comparing version 8.25.0 to 8.26.0

10

build/cjs/baseclient.js

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

init() {
if (this._isEnabled()) {
if (
this._isEnabled() ||
// Force integrations to be setup even if no DSN was set when we have
// Spotlight enabled. This is particularly important for browser as we
// don't support the `spotlight` option there and rely on the users
// adding the `spotlightBrowserIntegration()` to their integrations which
// wouldn't get initialized with the check below when there's no DSN set.
this._options.integrations.some(({ name }) => name.startsWith('Spotlight'))
) {
this._setupIntegrations();

@@ -255,0 +263,0 @@ }

2

build/cjs/integration.js

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

* Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to
* preseve the order of integrations in the array.
* preserve the order of integrations in the array.
*

@@ -16,0 +16,0 @@ * @private

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

*/
function getTraceMetaTags(span, scope, client) {
return Object.entries(traceData.getTraceData(span, scope, client))
function getTraceMetaTags() {
return Object.entries(traceData.getTraceData())
.map(([key, value]) => `<meta name="${key}" content="${value}"/>`)

@@ -30,0 +30,0 @@ .join('\n');

Object.defineProperty(exports, '__esModule', { value: true });
const utils = require('@sentry/utils');
const index = require('../asyncContext/index.js');
const carrier = require('../carrier.js');
const currentScopes = require('../currentScopes.js');

@@ -18,19 +20,21 @@ require('../tracing/errors.js');

*
* @param span a span to take the trace data from. By default, the currently active span is used.
* @param scope the scope to take trace data from By default, the active current scope is used.
* @param client the SDK's client to take trace data from. By default, the current client is used.
*
* @returns an object with the tracing data values. The object keys are the name of the tracing key to be used as header
* or meta tag name.
*/
function getTraceData(span, scope, client) {
const clientToUse = client || currentScopes.getClient();
const scopeToUse = scope || currentScopes.getCurrentScope();
const spanToUse = span || spanUtils.getActiveSpan();
function getTraceData() {
const carrier$1 = carrier.getMainCarrier();
const acs = index.getAsyncContextStrategy(carrier$1);
if (acs.getTraceData) {
return acs.getTraceData();
}
const { dsc, sampled, traceId } = scopeToUse.getPropagationContext();
const rootSpan = spanToUse && spanUtils.getRootSpan(spanToUse);
const client = currentScopes.getClient();
const scope = currentScopes.getCurrentScope();
const span = spanUtils.getActiveSpan();
const sentryTrace = spanToUse ? spanUtils.spanToTraceHeader(spanToUse) : utils.generateSentryTraceHeader(traceId, undefined, sampled);
const { dsc, sampled, traceId } = scope.getPropagationContext();
const rootSpan = span && spanUtils.getRootSpan(span);
const sentryTrace = span ? spanUtils.spanToTraceHeader(span) : utils.generateSentryTraceHeader(traceId, undefined, sampled);
const dynamicSamplingContext$1 = rootSpan

@@ -40,4 +44,4 @@ ? dynamicSamplingContext.getDynamicSamplingContextFromSpan(rootSpan)

? dsc
: clientToUse
? dynamicSamplingContext.getDynamicSamplingContextFromClient(traceId, clientToUse)
: client
? dynamicSamplingContext.getDynamicSamplingContextFromClient(traceId, client)
: undefined;

@@ -44,0 +48,0 @@

@@ -250,3 +250,11 @@ import { makeDsn, logger, uuid4, checkOrSetAlreadyCaught, isParameterizedString, isPrimitive, resolvedSyncPromise, addItemToEnvelope, createAttachmentEnvelopeItem, SyncPromise, dropUndefinedKeys, rejectedSyncPromise, SentryError, createClientReportEnvelope, dsnToString, isThenable, isPlainObject } from '@sentry/utils';

init() {
if (this._isEnabled()) {
if (
this._isEnabled() ||
// Force integrations to be setup even if no DSN was set when we have
// Spotlight enabled. This is particularly important for browser as we
// don't support the `spotlight` option there and rely on the users
// adding the `spotlightBrowserIntegration()` to their integrations which
// wouldn't get initialized with the check below when there's no DSN set.
this._options.integrations.some(({ name }) => name.startsWith('Spotlight'))
) {
this._setupIntegrations();

@@ -253,0 +261,0 @@ }

@@ -11,3 +11,3 @@ import { arrayify, logger } from '@sentry/utils';

* Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to
* preseve the order of integrations in the array.
* preserve the order of integrations in the array.
*

@@ -14,0 +14,0 @@ * @private

@@ -24,4 +24,4 @@ import { getTraceData } from './traceData.js';

*/
function getTraceMetaTags(span, scope, client) {
return Object.entries(getTraceData(span, scope, client))
function getTraceMetaTags() {
return Object.entries(getTraceData())
.map(([key, value]) => `<meta name="${key}" content="${value}"/>`)

@@ -28,0 +28,0 @@ .join('\n');

import { generateSentryTraceHeader, dynamicSamplingContextToSentryBaggageHeader, TRACEPARENT_REGEXP, logger } from '@sentry/utils';
import { getAsyncContextStrategy } from '../asyncContext/index.js';
import { getMainCarrier } from '../carrier.js';
import { getClient, getCurrentScope } from '../currentScopes.js';

@@ -16,19 +18,21 @@ import '../tracing/errors.js';

*
* @param span a span to take the trace data from. By default, the currently active span is used.
* @param scope the scope to take trace data from By default, the active current scope is used.
* @param client the SDK's client to take trace data from. By default, the current client is used.
*
* @returns an object with the tracing data values. The object keys are the name of the tracing key to be used as header
* or meta tag name.
*/
function getTraceData(span, scope, client) {
const clientToUse = client || getClient();
const scopeToUse = scope || getCurrentScope();
const spanToUse = span || getActiveSpan();
function getTraceData() {
const carrier = getMainCarrier();
const acs = getAsyncContextStrategy(carrier);
if (acs.getTraceData) {
return acs.getTraceData();
}
const { dsc, sampled, traceId } = scopeToUse.getPropagationContext();
const rootSpan = spanToUse && getRootSpan(spanToUse);
const client = getClient();
const scope = getCurrentScope();
const span = getActiveSpan();
const sentryTrace = spanToUse ? spanToTraceHeader(spanToUse) : generateSentryTraceHeader(traceId, undefined, sampled);
const { dsc, sampled, traceId } = scope.getPropagationContext();
const rootSpan = span && getRootSpan(span);
const sentryTrace = span ? spanToTraceHeader(span) : generateSentryTraceHeader(traceId, undefined, sampled);
const dynamicSamplingContext = rootSpan

@@ -38,4 +42,4 @@ ? getDynamicSamplingContextFromSpan(rootSpan)

? dsc
: clientToUse
? getDynamicSamplingContextFromClient(traceId, clientToUse)
: client
? getDynamicSamplingContextFromClient(traceId, client)
: undefined;

@@ -42,0 +46,0 @@

import { Scope } from '@sentry/types';
import { getTraceData } from '../utils/traceData';
import { startInactiveSpan, startSpan, startSpanManual, suppressTracing, withActiveSpan } from './../tracing/trace';

@@ -46,3 +47,5 @@ import { getActiveSpan } from './../utils/spanUtils';

suppressTracing?: typeof suppressTracing;
/** Get trace data as serialized string values for propagation via `sentry-trace` and `baggage`. */
getTraceData?: typeof getTraceData;
}
//# sourceMappingURL=types.d.ts.map

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

export { ClientClass } from './sdk';
export { ClientClass as SentryCoreCurrentScopes } from './sdk';
export { AsyncContextStrategy } from './asyncContext/types';

@@ -3,0 +3,0 @@ export { Carrier } from './carrier';

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

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

@@ -23,3 +22,3 @@ * Returns a string of meta tags that represent the current trace data.

*/
export declare function getTraceMetaTags(span?: Span, scope?: Scope, client?: Client): string;
export declare function getTraceMetaTags(): string;
//# sourceMappingURL=meta.d.ts.map

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

import { Client, Scope, Span } from '@sentry/types';
type TraceData = {
'sentry-trace'?: string;
baggage?: string;
};
import { SerializedTraceData } from '@sentry/types';
/**

@@ -14,10 +10,6 @@ * Extracts trace propagation data from the current span or from the client's scope (via transaction or propagation

*
* @param span a span to take the trace data from. By default, the currently active span is used.
* @param scope the scope to take trace data from By default, the active current scope is used.
* @param client the SDK's client to take trace data from. By default, the current client is used.
*
* @returns an object with the tracing data values. The object keys are the name of the tracing key to be used as header
* or meta tag name.
*/
export declare function getTraceData(span?: Span, scope?: Scope, client?: Client): TraceData;
export declare function getTraceData(): SerializedTraceData;
/**

@@ -32,3 +24,2 @@ * Tests string against baggage spec as defined in:

export declare function isValidBaggageString(baggage?: string): boolean;
export {};
//# sourceMappingURL=traceData.d.ts.map
import type { Scope } from '@sentry/types';
import type { getTraceData } from '../utils/traceData';
import type { startInactiveSpan, startSpan, startSpanManual, suppressTracing, withActiveSpan } from './../tracing/trace';

@@ -46,3 +47,5 @@ import type { getActiveSpan } from './../utils/spanUtils';

suppressTracing?: typeof suppressTracing;
/** Get trace data as serialized string values for propagation via `sentry-trace` and `baggage`. */
getTraceData?: typeof getTraceData;
}
//# sourceMappingURL=types.d.ts.map

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

export type { ClientClass } from './sdk';
export type { ClientClass as SentryCoreCurrentScopes } from './sdk';
export type { AsyncContextStrategy } from './asyncContext/types';

@@ -3,0 +3,0 @@ export type { Carrier } from './carrier';

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

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

@@ -23,3 +22,3 @@ * Returns a string of meta tags that represent the current trace data.

*/
export declare function getTraceMetaTags(span?: Span, scope?: Scope, client?: Client): string;
export declare function getTraceMetaTags(): string;
//# sourceMappingURL=meta.d.ts.map

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

import type { Client, Scope, Span } from '@sentry/types';
type TraceData = {
'sentry-trace'?: string;
baggage?: string;
};
import type { SerializedTraceData } from '@sentry/types';
/**

@@ -14,10 +10,6 @@ * Extracts trace propagation data from the current span or from the client's scope (via transaction or propagation

*
* @param span a span to take the trace data from. By default, the currently active span is used.
* @param scope the scope to take trace data from By default, the active current scope is used.
* @param client the SDK's client to take trace data from. By default, the current client is used.
*
* @returns an object with the tracing data values. The object keys are the name of the tracing key to be used as header
* or meta tag name.
*/
export declare function getTraceData(span?: Span, scope?: Scope, client?: Client): TraceData;
export declare function getTraceData(): SerializedTraceData;
/**

@@ -32,3 +24,2 @@ * Tests string against baggage spec as defined in:

export declare function isValidBaggageString(baggage?: string): boolean;
export {};
//# sourceMappingURL=traceData.d.ts.map
{
"name": "@sentry/core",
"version": "8.25.0",
"version": "8.26.0",
"description": "Base implementation for all Sentry JavaScript SDKs",

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

"dependencies": {
"@sentry/types": "8.25.0",
"@sentry/utils": "8.25.0"
"@sentry/types": "8.26.0",
"@sentry/utils": "8.26.0"
},

@@ -46,0 +46,0 @@ "scripts": {

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