Socket
Socket
Sign inDemoInstall

@opentelemetry/sdk-trace-base

Package Overview
Dependencies
Maintainers
2
Versions
55
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 1.7.0 to 1.8.0

8

build/esm/export/BatchSpanProcessorBase.js

@@ -16,4 +16,4 @@ /*

*/
import { context, TraceFlags } from '@opentelemetry/api';
import { BindOnceFuture, ExportResultCode, getEnv, globalErrorHandler, suppressTracing, unrefTimer, } from '@opentelemetry/core';
import { context, diag, TraceFlags } from '@opentelemetry/api';
import { BindOnceFuture, ExportResultCode, getEnv, globalErrorHandler, suppressTracing, unrefTimer } from '@opentelemetry/core';
/**

@@ -45,2 +45,6 @@ * Implementation of the {@link SpanProcessor} that batches spans exported by

this._shutdownOnce = new BindOnceFuture(this._shutdown, this);
if (this._maxExportBatchSize > this._maxQueueSize) {
diag.warn('BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize');
this._maxExportBatchSize = this._maxQueueSize;
}
}

@@ -47,0 +51,0 @@ BatchSpanProcessorBase.prototype.forceFlush = function () {

@@ -16,4 +16,4 @@ /*

*/
import { context, TraceFlags } from '@opentelemetry/api';
import { ExportResultCode, globalErrorHandler, suppressTracing, BindOnceFuture, } from '@opentelemetry/core';
import { TraceFlags } from '@opentelemetry/api';
import { internal, ExportResultCode, globalErrorHandler, BindOnceFuture } from '@opentelemetry/core';
/**

@@ -37,3 +37,2 @@ * An implementation of the {@link SpanProcessor} that converts the {@link Span}

SimpleSpanProcessor.prototype.onEnd = function (span) {
var _this = this;
if (this._shutdownOnce.isCalled) {

@@ -45,10 +44,9 @@ return;

}
// prevent downstream exporter calls from generating spans
context.with(suppressTracing(context.active()), function () {
_this._exporter.export([span], function (result) {
var _a;
if (result.code !== ExportResultCode.SUCCESS) {
globalErrorHandler((_a = result.error) !== null && _a !== void 0 ? _a : new Error("SimpleSpanProcessor: span export failed (status " + result + ")"));
}
});
internal._export(this._exporter, [span]).then(function (result) {
var _a;
if (result.code !== ExportResultCode.SUCCESS) {
globalErrorHandler((_a = result.error) !== null && _a !== void 0 ? _a : new Error("SimpleSpanProcessor: span export failed (status " + result + ")"));
}
}).catch(function (error) {
globalErrorHandler(error);
});

@@ -55,0 +53,0 @@ };

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

if (this._duration[0] < 0) {
api.diag.warn('Inconsistent start and end time, startTime > endTime', this.startTime, this.endTime);
api.diag.warn('Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.', this.startTime, this.endTime);
this.endTime = this.startTime.slice();
this._duration = [0, 0];
}

@@ -180,0 +182,0 @@ this._spanProcessor.onEnd(this);

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

import * as api from '@opentelemetry/api';
import { sanitizeAttributes, isTracingSuppressed, AnchoredClock, otperformance, } from '@opentelemetry/core';
import { sanitizeAttributes, isTracingSuppressed, } from '@opentelemetry/core';
import { Span } from './Span';

@@ -52,16 +52,5 @@ import { mergeConfig } from './utility';

var parentSpan = api.trace.getSpan(context);
var clock;
if (parentSpan) {
clock = parentSpan['_clock'];
}
if (!clock) {
clock = new AnchoredClock(Date, otperformance);
if (parentSpan) {
parentSpan['_clock'] = clock;
}
}
if (isTracingSuppressed(context)) {
api.diag.debug('Instrumentation suppressed, returning Noop Span');
var nonRecordingSpan = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT);
nonRecordingSpan['_clock'] = clock;
return nonRecordingSpan;

@@ -101,6 +90,5 @@ }

var nonRecordingSpan = api.trace.wrapSpanContext(spanContext);
nonRecordingSpan['_clock'] = clock;
return nonRecordingSpan;
}
var span = new Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime, clock);
var span = new Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime);
// Set initial span attributes. The attributes object may have been mutated

@@ -107,0 +95,0 @@ // by the sampler, so we sanitize the merged attributes before setting them.

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

export declare const VERSION = "1.7.0";
export declare const VERSION = "1.8.0";
//# sourceMappingURL=version.d.ts.map

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

// this is autogenerated file, see scripts/version-update.js
export var VERSION = '1.7.0';
export var VERSION = '1.8.0';
//# sourceMappingURL=version.js.map

@@ -16,4 +16,4 @@ /*

*/
import { context, TraceFlags } from '@opentelemetry/api';
import { BindOnceFuture, ExportResultCode, getEnv, globalErrorHandler, suppressTracing, unrefTimer, } from '@opentelemetry/core';
import { context, diag, TraceFlags } from '@opentelemetry/api';
import { BindOnceFuture, ExportResultCode, getEnv, globalErrorHandler, suppressTracing, unrefTimer } from '@opentelemetry/core';
/**

@@ -45,2 +45,6 @@ * Implementation of the {@link SpanProcessor} that batches spans exported by

this._shutdownOnce = new BindOnceFuture(this._shutdown, this);
if (this._maxExportBatchSize > this._maxQueueSize) {
diag.warn('BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize');
this._maxExportBatchSize = this._maxQueueSize;
}
}

@@ -47,0 +51,0 @@ forceFlush() {

@@ -16,4 +16,4 @@ /*

*/
import { context, TraceFlags } from '@opentelemetry/api';
import { ExportResultCode, globalErrorHandler, suppressTracing, BindOnceFuture, } from '@opentelemetry/core';
import { TraceFlags } from '@opentelemetry/api';
import { internal, ExportResultCode, globalErrorHandler, BindOnceFuture } from '@opentelemetry/core';
/**

@@ -43,10 +43,9 @@ * An implementation of the {@link SpanProcessor} that converts the {@link Span}

}
// prevent downstream exporter calls from generating spans
context.with(suppressTracing(context.active()), () => {
this._exporter.export([span], result => {
var _a;
if (result.code !== ExportResultCode.SUCCESS) {
globalErrorHandler((_a = result.error) !== null && _a !== void 0 ? _a : new Error(`SimpleSpanProcessor: span export failed (status ${result})`));
}
});
internal._export(this._exporter, [span]).then((result) => {
var _a;
if (result.code !== ExportResultCode.SUCCESS) {
globalErrorHandler((_a = result.error) !== null && _a !== void 0 ? _a : new Error(`SimpleSpanProcessor: span export failed (status ${result})`));
}
}).catch(error => {
globalErrorHandler(error);
});

@@ -53,0 +52,0 @@ }

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

if (this._duration[0] < 0) {
api.diag.warn('Inconsistent start and end time, startTime > endTime', this.startTime, this.endTime);
api.diag.warn('Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.', this.startTime, this.endTime);
this.endTime = this.startTime.slice();
this._duration = [0, 0];
}

@@ -140,0 +142,0 @@ this._spanProcessor.onEnd(this);

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

import * as api from '@opentelemetry/api';
import { sanitizeAttributes, isTracingSuppressed, AnchoredClock, otperformance, } from '@opentelemetry/core';
import { sanitizeAttributes, isTracingSuppressed, } from '@opentelemetry/core';
import { Span } from './Span';

@@ -50,16 +50,5 @@ import { mergeConfig } from './utility';

const parentSpan = api.trace.getSpan(context);
let clock;
if (parentSpan) {
clock = parentSpan['_clock'];
}
if (!clock) {
clock = new AnchoredClock(Date, otperformance);
if (parentSpan) {
parentSpan['_clock'] = clock;
}
}
if (isTracingSuppressed(context)) {
api.diag.debug('Instrumentation suppressed, returning Noop Span');
const nonRecordingSpan = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT);
nonRecordingSpan['_clock'] = clock;
return nonRecordingSpan;

@@ -99,6 +88,5 @@ }

const nonRecordingSpan = api.trace.wrapSpanContext(spanContext);
nonRecordingSpan['_clock'] = clock;
return nonRecordingSpan;
}
const span = new Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime, clock);
const span = new Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime);
// Set initial span attributes. The attributes object may have been mutated

@@ -105,0 +93,0 @@ // by the sampler, so we sanitize the merged attributes before setting them.

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

export declare const VERSION = "1.7.0";
export declare const VERSION = "1.8.0";
//# sourceMappingURL=version.d.ts.map

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

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

@@ -47,2 +47,6 @@ "use strict";

this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this);
if (this._maxExportBatchSize > this._maxQueueSize) {
api_1.diag.warn('BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize');
this._maxExportBatchSize = this._maxQueueSize;
}
}

@@ -49,0 +53,0 @@ forceFlush() {

@@ -45,10 +45,9 @@ "use strict";

}
// prevent downstream exporter calls from generating spans
api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => {
this._exporter.export([span], result => {
var _a;
if (result.code !== core_1.ExportResultCode.SUCCESS) {
(0, core_1.globalErrorHandler)((_a = result.error) !== null && _a !== void 0 ? _a : new Error(`SimpleSpanProcessor: span export failed (status ${result})`));
}
});
core_1.internal._export(this._exporter, [span]).then((result) => {
var _a;
if (result.code !== core_1.ExportResultCode.SUCCESS) {
(0, core_1.globalErrorHandler)((_a = result.error) !== null && _a !== void 0 ? _a : new Error(`SimpleSpanProcessor: span export failed (status ${result})`));
}
}).catch(error => {
(0, core_1.globalErrorHandler)(error);
});

@@ -55,0 +54,0 @@ }

@@ -140,3 +140,5 @@ "use strict";

if (this._duration[0] < 0) {
api.diag.warn('Inconsistent start and end time, startTime > endTime', this.startTime, this.endTime);
api.diag.warn('Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.', this.startTime, this.endTime);
this.endTime = this.startTime.slice();
this._duration = [0, 0];
}

@@ -143,0 +145,0 @@ this._spanProcessor.onEnd(this);

@@ -52,16 +52,5 @@ "use strict";

const parentSpan = api.trace.getSpan(context);
let clock;
if (parentSpan) {
clock = parentSpan['_clock'];
}
if (!clock) {
clock = new core_1.AnchoredClock(Date, core_1.otperformance);
if (parentSpan) {
parentSpan['_clock'] = clock;
}
}
if ((0, core_1.isTracingSuppressed)(context)) {
api.diag.debug('Instrumentation suppressed, returning Noop Span');
const nonRecordingSpan = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT);
nonRecordingSpan['_clock'] = clock;
return nonRecordingSpan;

@@ -101,6 +90,5 @@ }

const nonRecordingSpan = api.trace.wrapSpanContext(spanContext);
nonRecordingSpan['_clock'] = clock;
return nonRecordingSpan;
}
const span = new Span_1.Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime, clock);
const span = new Span_1.Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime);
// Set initial span attributes. The attributes object may have been mutated

@@ -107,0 +95,0 @@ // by the sampler, so we sanitize the merged attributes before setting them.

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

export declare const VERSION = "1.7.0";
export declare const VERSION = "1.8.0";
//# sourceMappingURL=version.d.ts.map

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

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

@@ -67,4 +67,4 @@ "main": "build/src/index.js",

"devDependencies": {
"@opentelemetry/api": ">=1.0.0 <1.3.0",
"@types/mocha": "9.1.1",
"@opentelemetry/api": ">=1.0.0 <1.4.0",
"@types/mocha": "10.0.0",
"@types/node": "18.6.5",

@@ -92,11 +92,12 @@ "@types/sinon": "10.0.13",

"peerDependencies": {
"@opentelemetry/api": ">=1.0.0 <1.3.0"
"@opentelemetry/api": ">=1.0.0 <1.4.0"
},
"dependencies": {
"@opentelemetry/core": "1.7.0",
"@opentelemetry/resources": "1.7.0",
"@opentelemetry/semantic-conventions": "1.7.0"
"@opentelemetry/core": "1.8.0",
"@opentelemetry/resources": "1.8.0",
"@opentelemetry/semantic-conventions": "1.8.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-base",
"gitHead": "ad88c3d9aa0100fe259b93f4b660e84417b757ac"
"sideEffects": false,
"gitHead": "7972edf6659fb6e0d5928a5cf7a35f26683e168f"
}

@@ -60,6 +60,8 @@ # OpenTelemetry Tracing SDK

```js
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { AlwaysOnSampler } = require("@opentelemetry/core");
const {
AlwaysOnSampler,
BasicTracerProvider,
} = require("@opentelemetry/sdk-trace-base");
const tracerProvider = new NodeTracerProvider({
const tracerProvider = new BasicTracerProvider({
sampler: new AlwaysOnSampler()

@@ -74,6 +76,8 @@ });

```js
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { AlwaysOffSampler } = require("@opentelemetry/core");
const {
AlwaysOffSampler,
BasicTracerProvider,
} = require("@opentelemetry/sdk-trace-base");
const tracerProvider = new NodeTracerProvider({
const tracerProvider = new BasicTracerProvider({
sampler: new AlwaysOffSampler()

@@ -91,6 +95,8 @@ });

```js
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { TraceIdRatioBasedSampler } = require("@opentelemetry/core");
const {
BasicTracerProvider,
TraceIdRatioBasedSampler,
} = require("@opentelemetry/sdk-trace-base");
const tracerProvider = new NodeTracerProvider({
const tracerProvider = new BasicTracerProvider({
// See details of ParentBasedSampler below

@@ -136,6 +142,10 @@ sampler: new ParentBasedSampler({

```js
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { ParentBasedSampler, AlwaysOffSampler, TraceIdRatioBasedSampler } = require("@opentelemetry/core");
const {
AlwaysOffSampler,
BasicTracerProvider,
ParentBasedSampler,
TraceIdRatioBasedSampler,
} = require("@opentelemetry/sdk-trace-base");
const tracerProvider = new NodeTracerProvider({
const tracerProvider = new BasicTracerProvider({
sampler: new ParentBasedSampler({

@@ -142,0 +152,0 @@ // By default, the ParentBasedSampler will respect the parent span's sampling

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc