You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@opentelemetry/sdk-trace-base

Package Overview
Dependencies
Maintainers
2
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/sdk-trace-base - npm Package Compare versions

Comparing version
2.2.0
to
2.3.0
+2
-2
build/esm/export/BatchSpanProcessorBase.d.ts

@@ -12,3 +12,2 @@ import { Context } from '@opentelemetry/api';

export declare abstract class BatchSpanProcessorBase<T extends BufferConfig> implements SpanProcessor {
private readonly _exporter;
private readonly _maxExportBatchSize;

@@ -18,2 +17,3 @@ private readonly _maxQueueSize;

private readonly _exportTimeoutMillis;
private readonly _exporter;
private _isExporting;

@@ -24,3 +24,3 @@ private _finishedSpans;

private _droppedSpansCount;
constructor(_exporter: SpanExporter, config?: T);
constructor(exporter: SpanExporter, config?: T);
forceFlush(): Promise<void>;

@@ -27,0 +27,0 @@ onStart(_span: Span, _parentContext: Context): void;

@@ -23,3 +23,2 @@ /*

export class BatchSpanProcessorBase {
_exporter;
_maxExportBatchSize;

@@ -29,2 +28,3 @@ _maxQueueSize;

_exportTimeoutMillis;
_exporter;
_isExporting = false;

@@ -35,4 +35,4 @@ _finishedSpans = [];

_droppedSpansCount = 0;
constructor(_exporter, config) {
this._exporter = _exporter;
constructor(exporter, config) {
this._exporter = exporter;
this._maxExportBatchSize =

@@ -39,0 +39,0 @@ typeof config?.maxExportBatchSize === 'number'

@@ -18,3 +18,3 @@ import { Context } from '@opentelemetry/api';

private _pendingExports;
constructor(_exporter: SpanExporter);
constructor(exporter: SpanExporter);
forceFlush(): Promise<void>;

@@ -21,0 +21,0 @@ onStart(_span: Span, _parentContext: Context): void;

@@ -30,4 +30,4 @@ /*

_pendingExports;
constructor(_exporter) {
this._exporter = _exporter;
constructor(exporter) {
this._exporter = exporter;
this._shutdownOnce = new BindOnceFuture(this._shutdown, this);

@@ -34,0 +34,0 @@ this._pendingExports = new Set();

@@ -11,5 +11,6 @@ import { Context } from '@opentelemetry/api';

private readonly _spanProcessors;
constructor(_spanProcessors: SpanProcessor[]);
constructor(spanProcessors: SpanProcessor[]);
forceFlush(): Promise<void>;
onStart(span: Span, context: Context): void;
onEnding(span: Span): void;
onEnd(span: ReadableSpan): void;

@@ -16,0 +17,0 @@ shutdown(): Promise<void>;

@@ -23,4 +23,4 @@ /*

_spanProcessors;
constructor(_spanProcessors) {
this._spanProcessors = _spanProcessors;
constructor(spanProcessors) {
this._spanProcessors = spanProcessors;
}

@@ -48,2 +48,9 @@ forceFlush() {

}
onEnding(span) {
for (const spanProcessor of this._spanProcessors) {
if (spanProcessor.onEnding) {
spanProcessor.onEnding(span);
}
}
}
onEnd(span) {

@@ -50,0 +57,0 @@ for (const spanProcessor of this._spanProcessors) {

@@ -6,3 +6,3 @@ import { Sampler, SamplingResult } from '../Sampler';

private _upperBound;
constructor(_ratio?: number);
constructor(ratio?: number);
shouldSample(context: unknown, traceId: string): SamplingResult;

@@ -9,0 +9,0 @@ toString(): string;

@@ -22,5 +22,4 @@ /*

_upperBound;
constructor(_ratio = 0) {
this._ratio = _ratio;
this._ratio = this._normalize(_ratio);
constructor(ratio = 0) {
this._ratio = this._normalize(ratio);
this._upperBound = Math.floor(this._ratio * 0xffffffff);

@@ -27,0 +26,0 @@ }

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

import { diag, SpanStatusCode, } from '@opentelemetry/api';
import { addHrTimes, millisToHrTime, getTimeOrigin, hrTime, hrTimeDuration, isAttributeValue, isTimeInput, isTimeInputHrTime, otperformance, sanitizeAttributes, } from '@opentelemetry/core';
import { addHrTimes, millisToHrTime, hrTime, hrTimeDuration, isAttributeValue, isTimeInput, isTimeInputHrTime, otperformance, sanitizeAttributes, } from '@opentelemetry/core';
import { ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_STACKTRACE, ATTR_EXCEPTION_TYPE, } from '@opentelemetry/semantic-conventions';

@@ -60,3 +60,3 @@ import { ExceptionEventName } from './enums';

this._performanceOffset =
now - (this._performanceStartTime + getTimeOrigin());
now - (this._performanceStartTime + otperformance.timeOrigin);
this._startTimeProvided = opts.startTime != null;

@@ -181,3 +181,2 @@ this._spanLimits = opts.spanLimits;

}
this._ended = true;
this.endTime = this._getTime(endTime);

@@ -193,2 +192,6 @@ this._duration = hrTimeDuration(this.startTime, this.endTime);

}
if (this._spanProcessor.onEnding) {
this._spanProcessor.onEnding(this);
}
this._ended = true;
this._spanProcessor.onEnd(this);

@@ -195,0 +198,0 @@ }

@@ -20,2 +20,10 @@ import { Context } from '@opentelemetry/api';

/**
* Called when a {@link Span} is ending, if the `span.isRecording()`
* returns true.
* @param span the Span that is ending.
*
* @experimental This method is experimental and may break in minor versions of this package
*/
onEnding?(span: Span): void;
/**
* Called when a {@link ReadableSpan} is ended, if the `span.isRecording()`

@@ -22,0 +30,0 @@ * returns true.

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

export declare const VERSION = "2.2.0";
export declare const VERSION = "2.3.0";
//# sourceMappingURL=version.d.ts.map

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

// this is autogenerated file, see scripts/version-update.js
export const VERSION = '2.2.0';
export const VERSION = '2.3.0';
//# sourceMappingURL=version.js.map

@@ -12,3 +12,2 @@ import { Context } from '@opentelemetry/api';

export declare abstract class BatchSpanProcessorBase<T extends BufferConfig> implements SpanProcessor {
private readonly _exporter;
private readonly _maxExportBatchSize;

@@ -18,2 +17,3 @@ private readonly _maxQueueSize;

private readonly _exportTimeoutMillis;
private readonly _exporter;
private _isExporting;

@@ -24,3 +24,3 @@ private _finishedSpans;

private _droppedSpansCount;
constructor(_exporter: SpanExporter, config?: T);
constructor(exporter: SpanExporter, config?: T);
forceFlush(): Promise<void>;

@@ -27,0 +27,0 @@ onStart(_span: Span, _parentContext: Context): void;

@@ -23,3 +23,2 @@ /*

export class BatchSpanProcessorBase {
_exporter;
_maxExportBatchSize;

@@ -29,2 +28,3 @@ _maxQueueSize;

_exportTimeoutMillis;
_exporter;
_isExporting = false;

@@ -35,4 +35,4 @@ _finishedSpans = [];

_droppedSpansCount = 0;
constructor(_exporter, config) {
this._exporter = _exporter;
constructor(exporter, config) {
this._exporter = exporter;
this._maxExportBatchSize =

@@ -39,0 +39,0 @@ typeof config?.maxExportBatchSize === 'number'

@@ -18,3 +18,3 @@ import { Context } from '@opentelemetry/api';

private _pendingExports;
constructor(_exporter: SpanExporter);
constructor(exporter: SpanExporter);
forceFlush(): Promise<void>;

@@ -21,0 +21,0 @@ onStart(_span: Span, _parentContext: Context): void;

@@ -30,4 +30,4 @@ /*

_pendingExports;
constructor(_exporter) {
this._exporter = _exporter;
constructor(exporter) {
this._exporter = exporter;
this._shutdownOnce = new BindOnceFuture(this._shutdown, this);

@@ -34,0 +34,0 @@ this._pendingExports = new Set();

@@ -11,5 +11,6 @@ import { Context } from '@opentelemetry/api';

private readonly _spanProcessors;
constructor(_spanProcessors: SpanProcessor[]);
constructor(spanProcessors: SpanProcessor[]);
forceFlush(): Promise<void>;
onStart(span: Span, context: Context): void;
onEnding(span: Span): void;
onEnd(span: ReadableSpan): void;

@@ -16,0 +17,0 @@ shutdown(): Promise<void>;

@@ -23,4 +23,4 @@ /*

_spanProcessors;
constructor(_spanProcessors) {
this._spanProcessors = _spanProcessors;
constructor(spanProcessors) {
this._spanProcessors = spanProcessors;
}

@@ -48,2 +48,9 @@ forceFlush() {

}
onEnding(span) {
for (const spanProcessor of this._spanProcessors) {
if (spanProcessor.onEnding) {
spanProcessor.onEnding(span);
}
}
}
onEnd(span) {

@@ -50,0 +57,0 @@ for (const spanProcessor of this._spanProcessors) {

@@ -6,3 +6,3 @@ import { Sampler, SamplingResult } from '../Sampler';

private _upperBound;
constructor(_ratio?: number);
constructor(ratio?: number);
shouldSample(context: unknown, traceId: string): SamplingResult;

@@ -9,0 +9,0 @@ toString(): string;

@@ -22,5 +22,4 @@ /*

_upperBound;
constructor(_ratio = 0) {
this._ratio = _ratio;
this._ratio = this._normalize(_ratio);
constructor(ratio = 0) {
this._ratio = this._normalize(ratio);
this._upperBound = Math.floor(this._ratio * 0xffffffff);

@@ -27,0 +26,0 @@ }

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

import { diag, SpanStatusCode, } from '@opentelemetry/api';
import { addHrTimes, millisToHrTime, getTimeOrigin, hrTime, hrTimeDuration, isAttributeValue, isTimeInput, isTimeInputHrTime, otperformance, sanitizeAttributes, } from '@opentelemetry/core';
import { addHrTimes, millisToHrTime, hrTime, hrTimeDuration, isAttributeValue, isTimeInput, isTimeInputHrTime, otperformance, sanitizeAttributes, } from '@opentelemetry/core';
import { ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_STACKTRACE, ATTR_EXCEPTION_TYPE, } from '@opentelemetry/semantic-conventions';

@@ -60,3 +60,3 @@ import { ExceptionEventName } from './enums';

this._performanceOffset =
now - (this._performanceStartTime + getTimeOrigin());
now - (this._performanceStartTime + otperformance.timeOrigin);
this._startTimeProvided = opts.startTime != null;

@@ -181,3 +181,2 @@ this._spanLimits = opts.spanLimits;

}
this._ended = true;
this.endTime = this._getTime(endTime);

@@ -193,2 +192,6 @@ this._duration = hrTimeDuration(this.startTime, this.endTime);

}
if (this._spanProcessor.onEnding) {
this._spanProcessor.onEnding(this);
}
this._ended = true;
this._spanProcessor.onEnd(this);

@@ -195,0 +198,0 @@ }

@@ -20,2 +20,10 @@ import { Context } from '@opentelemetry/api';

/**
* Called when a {@link Span} is ending, if the `span.isRecording()`
* returns true.
* @param span the Span that is ending.
*
* @experimental This method is experimental and may break in minor versions of this package
*/
onEnding?(span: Span): void;
/**
* Called when a {@link ReadableSpan} is ended, if the `span.isRecording()`

@@ -22,0 +30,0 @@ * returns true.

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

export declare const VERSION = "2.2.0";
export declare const VERSION = "2.3.0";
//# sourceMappingURL=version.d.ts.map

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

// this is autogenerated file, see scripts/version-update.js
export const VERSION = '2.2.0';
export const VERSION = '2.3.0';
//# sourceMappingURL=version.js.map

@@ -12,3 +12,2 @@ import { Context } from '@opentelemetry/api';

export declare abstract class BatchSpanProcessorBase<T extends BufferConfig> implements SpanProcessor {
private readonly _exporter;
private readonly _maxExportBatchSize;

@@ -18,2 +17,3 @@ private readonly _maxQueueSize;

private readonly _exportTimeoutMillis;
private readonly _exporter;
private _isExporting;

@@ -24,3 +24,3 @@ private _finishedSpans;

private _droppedSpansCount;
constructor(_exporter: SpanExporter, config?: T);
constructor(exporter: SpanExporter, config?: T);
forceFlush(): Promise<void>;

@@ -27,0 +27,0 @@ onStart(_span: Span, _parentContext: Context): void;

@@ -26,3 +26,2 @@ "use strict";

class BatchSpanProcessorBase {
_exporter;
_maxExportBatchSize;

@@ -32,2 +31,3 @@ _maxQueueSize;

_exportTimeoutMillis;
_exporter;
_isExporting = false;

@@ -38,4 +38,4 @@ _finishedSpans = [];

_droppedSpansCount = 0;
constructor(_exporter, config) {
this._exporter = _exporter;
constructor(exporter, config) {
this._exporter = exporter;
this._maxExportBatchSize =

@@ -42,0 +42,0 @@ typeof config?.maxExportBatchSize === 'number'

@@ -18,3 +18,3 @@ import { Context } from '@opentelemetry/api';

private _pendingExports;
constructor(_exporter: SpanExporter);
constructor(exporter: SpanExporter);
forceFlush(): Promise<void>;

@@ -21,0 +21,0 @@ onStart(_span: Span, _parentContext: Context): void;

@@ -33,4 +33,4 @@ "use strict";

_pendingExports;
constructor(_exporter) {
this._exporter = _exporter;
constructor(exporter) {
this._exporter = exporter;
this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this);

@@ -37,0 +37,0 @@ this._pendingExports = new Set();

@@ -11,5 +11,6 @@ import { Context } from '@opentelemetry/api';

private readonly _spanProcessors;
constructor(_spanProcessors: SpanProcessor[]);
constructor(spanProcessors: SpanProcessor[]);
forceFlush(): Promise<void>;
onStart(span: Span, context: Context): void;
onEnding(span: Span): void;
onEnd(span: ReadableSpan): void;

@@ -16,0 +17,0 @@ shutdown(): Promise<void>;

@@ -26,4 +26,4 @@ "use strict";

_spanProcessors;
constructor(_spanProcessors) {
this._spanProcessors = _spanProcessors;
constructor(spanProcessors) {
this._spanProcessors = spanProcessors;
}

@@ -51,2 +51,9 @@ forceFlush() {

}
onEnding(span) {
for (const spanProcessor of this._spanProcessors) {
if (spanProcessor.onEnding) {
spanProcessor.onEnding(span);
}
}
}
onEnd(span) {

@@ -53,0 +60,0 @@ for (const spanProcessor of this._spanProcessors) {

@@ -6,3 +6,3 @@ import { Sampler, SamplingResult } from '../Sampler';

private _upperBound;
constructor(_ratio?: number);
constructor(ratio?: number);
shouldSample(context: unknown, traceId: string): SamplingResult;

@@ -9,0 +9,0 @@ toString(): string;

@@ -25,5 +25,4 @@ "use strict";

_upperBound;
constructor(_ratio = 0) {
this._ratio = _ratio;
this._ratio = this._normalize(_ratio);
constructor(ratio = 0) {
this._ratio = this._normalize(ratio);
this._upperBound = Math.floor(this._ratio * 0xffffffff);

@@ -30,0 +29,0 @@ }

@@ -62,3 +62,3 @@ "use strict";

this._performanceOffset =
now - (this._performanceStartTime + (0, core_1.getTimeOrigin)());
now - (this._performanceStartTime + core_1.otperformance.timeOrigin);
this._startTimeProvided = opts.startTime != null;

@@ -183,3 +183,2 @@ this._spanLimits = opts.spanLimits;

}
this._ended = true;
this.endTime = this._getTime(endTime);

@@ -195,2 +194,6 @@ this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime);

}
if (this._spanProcessor.onEnding) {
this._spanProcessor.onEnding(this);
}
this._ended = true;
this._spanProcessor.onEnd(this);

@@ -197,0 +200,0 @@ }

@@ -20,2 +20,10 @@ import { Context } from '@opentelemetry/api';

/**
* Called when a {@link Span} is ending, if the `span.isRecording()`
* returns true.
* @param span the Span that is ending.
*
* @experimental This method is experimental and may break in minor versions of this package
*/
onEnding?(span: Span): void;
/**
* Called when a {@link ReadableSpan} is ended, if the `span.isRecording()`

@@ -22,0 +30,0 @@ * returns true.

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

export declare const VERSION = "2.2.0";
export declare const VERSION = "2.3.0";
//# sourceMappingURL=version.d.ts.map

@@ -20,3 +20,3 @@ "use strict";

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '2.2.0';
exports.VERSION = '2.3.0';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/sdk-trace-base",
"version": "2.2.0",
"version": "2.3.0",
"description": "OpenTelemetry Tracing",

@@ -79,3 +79,3 @@ "main": "build/src/index.js",

"karma-webpack": "5.0.1",
"mocha": "11.7.4",
"mocha": "11.7.5",
"nyc": "17.1.0",

@@ -91,4 +91,4 @@ "sinon": "18.0.1",

"dependencies": {
"@opentelemetry/core": "2.2.0",
"@opentelemetry/resources": "2.2.0",
"@opentelemetry/core": "2.3.0",
"@opentelemetry/resources": "2.3.0",
"@opentelemetry/semantic-conventions": "^1.29.0"

@@ -98,3 +98,3 @@ },

"sideEffects": false,
"gitHead": "fb6476d8243ac8dcaaea74130b9c50c43938275c"
"gitHead": "228cb920bbededf4f3fd6355e88409e84bfd87b6"
}

@@ -137,5 +137,5 @@ # OpenTelemetry Tracing SDK

|Parent| parent.isRemote() | parent.isSampled()| Invoke sampler|
|--|--|--|--|
|absent| n/a | n/a |`root()`|
|Parent|parent.isRemote()|parent.isSampled()|Invoke sampler|
|---|---|---|---|
|absent|n/a|n/a|`root()`|
|present|true|true|`remoteParentSampled()`|

@@ -142,0 +142,0 @@ |present|true|false|`remoteParentNotSampled()`|

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