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

@opentelemetry/tracing

Package Overview
Dependencies
Maintainers
4
Versions
143
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/tracing - npm Package Compare versions

Comparing version 0.19.1-alpha.27 to 0.19.1-alpha.28

10

build/esm/config.d.ts

@@ -6,3 +6,3 @@ import { Sampler } from '@opentelemetry/api';

* value will override the corresponding default value. For fields with
* non-primitive values (like `traceParams`), the user-provided value will be
* non-primitive values (like `spanLimits`), the user-provided value will be
* used to extend the default value.

@@ -13,6 +13,6 @@ */

forceFlushTimeoutMillis: number;
traceParams: {
numberOfAttributesPerSpan: number;
numberOfLinksPerSpan: number;
numberOfEventsPerSpan: number;
spanLimits: {
attributeCountLimit: number;
linkCountLimit: number;
eventCountLimit: number;
};

@@ -19,0 +19,0 @@ };

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

* value will override the corresponding default value. For fields with
* non-primitive values (like `traceParams`), the user-provided value will be
* non-primitive values (like `spanLimits`), the user-provided value will be
* used to extend the default value.

@@ -30,6 +30,6 @@ */

forceFlushTimeoutMillis: 30000,
traceParams: {
numberOfAttributesPerSpan: getEnv().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,
numberOfLinksPerSpan: getEnv().OTEL_SPAN_LINK_COUNT_LIMIT,
numberOfEventsPerSpan: getEnv().OTEL_SPAN_EVENT_COUNT_LIMIT,
spanLimits: {
attributeCountLimit: getEnv().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,
linkCountLimit: getEnv().OTEL_SPAN_LINK_COUNT_LIMIT,
eventCountLimit: getEnv().OTEL_SPAN_EVENT_COUNT_LIMIT,
},

@@ -36,0 +36,0 @@ };

@@ -27,3 +27,3 @@ import * as api from '@opentelemetry/api';

private readonly _spanProcessor;
private readonly _traceParams;
private readonly _spanLimits;
/** Constructs a new Span instance. */

@@ -30,0 +30,0 @@ constructor(parentTracer: Tracer, context: Context, spanName: string, spanContext: api.SpanContext, kind: api.SpanKind, parentSpanId?: string, links?: api.Link[], startTime?: api.TimeInput);

@@ -45,3 +45,3 @@ /*

this.instrumentationLibrary = parentTracer.instrumentationLibrary;
this._traceParams = parentTracer.getActiveTraceParams();
this._spanLimits = parentTracer.getSpanLimits();
this._spanProcessor = parentTracer.getActiveSpanProcessor();

@@ -65,3 +65,3 @@ this._spanProcessor.onStart(this, context);

if (Object.keys(this.attributes).length >=
this._traceParams.numberOfAttributesPerSpan &&
this._spanLimits.attributeCountLimit &&
!Object.prototype.hasOwnProperty.call(this.attributes, key)) {

@@ -90,3 +90,3 @@ return this;

return this;
if (this.events.length >= this._traceParams.numberOfEventsPerSpan) {
if (this.events.length >= this._spanLimits.eventCountLimit) {
api.diag.warn('Dropping extra events.');

@@ -93,0 +93,0 @@ this.events.shift();

@@ -5,3 +5,3 @@ import * as api from '@opentelemetry/api';

import { BasicTracerProvider } from './BasicTracerProvider';
import { TraceParams, TracerConfig } from './types';
import { SpanLimits, TracerConfig } from './types';
/**

@@ -13,3 +13,3 @@ * This class represents a basic tracer.

private readonly _sampler;
private readonly _traceParams;
private readonly _spanLimits;
private readonly _idGenerator;

@@ -27,6 +27,6 @@ readonly resource: Resource;

startSpan(name: string, options?: api.SpanOptions, context?: api.Context): api.Span;
/** Returns the active {@link TraceParams}. */
getActiveTraceParams(): TraceParams;
/** Returns the active {@link SpanLimits}. */
getSpanLimits(): SpanLimits;
getActiveSpanProcessor(): import("./SpanProcessor").SpanProcessor;
}
//# sourceMappingURL=Tracer.d.ts.map

@@ -31,3 +31,3 @@ /*

this._sampler = localConfig.sampler;
this._traceParams = localConfig.traceParams;
this._spanLimits = localConfig.spanLimits;
this._idGenerator = config.idGenerator || new RandomIdGenerator();

@@ -82,5 +82,5 @@ this.resource = _tracerProvider.resource;

};
/** Returns the active {@link TraceParams}. */
Tracer.prototype.getActiveTraceParams = function () {
return this._traceParams;
/** Returns the active {@link SpanLimits}. */
Tracer.prototype.getSpanLimits = function () {
return this._spanLimits;
};

@@ -87,0 +87,0 @@ Tracer.prototype.getActiveSpanProcessor = function () {

@@ -13,4 +13,4 @@ import { TextMapPropagator, Sampler } from '@opentelemetry/api';

sampler?: Sampler;
/** Trace Parameters */
traceParams?: TraceParams;
/** Span Limits */
spanLimits?: SpanLimits;
/** Resource associated with trace telemetry */

@@ -41,9 +41,9 @@ resource?: Resource;

/** Global configuration of trace service */
export interface TraceParams {
/** numberOfAttributesPerSpan is number of attributes per span */
numberOfAttributesPerSpan?: number;
/** numberOfLinksPerSpan is number of links per span */
numberOfLinksPerSpan?: number;
/** numberOfEventsPerSpan is number of message events per span */
numberOfEventsPerSpan?: number;
export interface SpanLimits {
/** attributeCountLimit is number of attributes per span */
attributeCountLimit?: number;
/** linkCountLimit is number of links per span */
linkCountLimit?: number;
/** eventCountLimit is number of message events per span */
eventCountLimit?: number;
}

@@ -50,0 +50,0 @@ /** Interface configuration for a buffer. */

@@ -9,8 +9,8 @@ import { TracerConfig } from './types';

forceFlushTimeoutMillis: number;
traceParams: {
numberOfAttributesPerSpan: number;
numberOfLinksPerSpan: number;
numberOfEventsPerSpan: number;
spanLimits: {
attributeCountLimit: number;
linkCountLimit: number;
eventCountLimit: number;
};
} & Partial<TracerConfig> & TracerConfig;
//# sourceMappingURL=utility.d.ts.map

@@ -26,5 +26,5 @@ /*

var target = Object.assign({}, DEFAULT_CONFIG, perInstanceDefaults, userConfig);
target.traceParams = Object.assign({}, DEFAULT_CONFIG.traceParams, userConfig.traceParams || {});
target.spanLimits = Object.assign({}, DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {});
return target;
}
//# sourceMappingURL=utility.js.map

@@ -6,3 +6,3 @@ import { Sampler } from '@opentelemetry/api';

* value will override the corresponding default value. For fields with
* non-primitive values (like `traceParams`), the user-provided value will be
* non-primitive values (like `spanLimits`), the user-provided value will be
* used to extend the default value.

@@ -13,6 +13,6 @@ */

forceFlushTimeoutMillis: number;
traceParams: {
numberOfAttributesPerSpan: number;
numberOfLinksPerSpan: number;
numberOfEventsPerSpan: number;
spanLimits: {
attributeCountLimit: number;
linkCountLimit: number;
eventCountLimit: number;
};

@@ -19,0 +19,0 @@ };

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

* value will override the corresponding default value. For fields with
* non-primitive values (like `traceParams`), the user-provided value will be
* non-primitive values (like `spanLimits`), the user-provided value will be
* used to extend the default value.

@@ -33,6 +33,6 @@ */

forceFlushTimeoutMillis: 30000,
traceParams: {
numberOfAttributesPerSpan: core_1.getEnv().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,
numberOfLinksPerSpan: core_1.getEnv().OTEL_SPAN_LINK_COUNT_LIMIT,
numberOfEventsPerSpan: core_1.getEnv().OTEL_SPAN_EVENT_COUNT_LIMIT,
spanLimits: {
attributeCountLimit: core_1.getEnv().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,
linkCountLimit: core_1.getEnv().OTEL_SPAN_LINK_COUNT_LIMIT,
eventCountLimit: core_1.getEnv().OTEL_SPAN_EVENT_COUNT_LIMIT,
},

@@ -39,0 +39,0 @@ };

@@ -27,3 +27,3 @@ import * as api from '@opentelemetry/api';

private readonly _spanProcessor;
private readonly _traceParams;
private readonly _spanLimits;
/** Constructs a new Span instance. */

@@ -30,0 +30,0 @@ constructor(parentTracer: Tracer, context: Context, spanName: string, spanContext: api.SpanContext, kind: api.SpanKind, parentSpanId?: string, links?: api.Link[], startTime?: api.TimeInput);

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

this.instrumentationLibrary = parentTracer.instrumentationLibrary;
this._traceParams = parentTracer.getActiveTraceParams();
this._spanLimits = parentTracer.getSpanLimits();
this._spanProcessor = parentTracer.getActiveSpanProcessor();

@@ -66,3 +66,3 @@ this._spanProcessor.onStart(this, context);

if (Object.keys(this.attributes).length >=
this._traceParams.numberOfAttributesPerSpan &&
this._spanLimits.attributeCountLimit &&
!Object.prototype.hasOwnProperty.call(this.attributes, key)) {

@@ -90,3 +90,3 @@ return this;

return this;
if (this.events.length >= this._traceParams.numberOfEventsPerSpan) {
if (this.events.length >= this._spanLimits.eventCountLimit) {
api.diag.warn('Dropping extra events.');

@@ -93,0 +93,0 @@ this.events.shift();

@@ -5,3 +5,3 @@ import * as api from '@opentelemetry/api';

import { BasicTracerProvider } from './BasicTracerProvider';
import { TraceParams, TracerConfig } from './types';
import { SpanLimits, TracerConfig } from './types';
/**

@@ -13,3 +13,3 @@ * This class represents a basic tracer.

private readonly _sampler;
private readonly _traceParams;
private readonly _spanLimits;
private readonly _idGenerator;

@@ -27,6 +27,6 @@ readonly resource: Resource;

startSpan(name: string, options?: api.SpanOptions, context?: api.Context): api.Span;
/** Returns the active {@link TraceParams}. */
getActiveTraceParams(): TraceParams;
/** Returns the active {@link SpanLimits}. */
getSpanLimits(): SpanLimits;
getActiveSpanProcessor(): import("./SpanProcessor").SpanProcessor;
}
//# sourceMappingURL=Tracer.d.ts.map

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

this._sampler = localConfig.sampler;
this._traceParams = localConfig.traceParams;
this._spanLimits = localConfig.spanLimits;
this._idGenerator = config.idGenerator || new core_1.RandomIdGenerator();

@@ -83,5 +83,5 @@ this.resource = _tracerProvider.resource;

}
/** Returns the active {@link TraceParams}. */
getActiveTraceParams() {
return this._traceParams;
/** Returns the active {@link SpanLimits}. */
getSpanLimits() {
return this._spanLimits;
}

@@ -88,0 +88,0 @@ getActiveSpanProcessor() {

@@ -13,4 +13,4 @@ import { TextMapPropagator, Sampler } from '@opentelemetry/api';

sampler?: Sampler;
/** Trace Parameters */
traceParams?: TraceParams;
/** Span Limits */
spanLimits?: SpanLimits;
/** Resource associated with trace telemetry */

@@ -41,9 +41,9 @@ resource?: Resource;

/** Global configuration of trace service */
export interface TraceParams {
/** numberOfAttributesPerSpan is number of attributes per span */
numberOfAttributesPerSpan?: number;
/** numberOfLinksPerSpan is number of links per span */
numberOfLinksPerSpan?: number;
/** numberOfEventsPerSpan is number of message events per span */
numberOfEventsPerSpan?: number;
export interface SpanLimits {
/** attributeCountLimit is number of attributes per span */
attributeCountLimit?: number;
/** linkCountLimit is number of links per span */
linkCountLimit?: number;
/** eventCountLimit is number of message events per span */
eventCountLimit?: number;
}

@@ -50,0 +50,0 @@ /** Interface configuration for a buffer. */

@@ -9,8 +9,8 @@ import { TracerConfig } from './types';

forceFlushTimeoutMillis: number;
traceParams: {
numberOfAttributesPerSpan: number;
numberOfLinksPerSpan: number;
numberOfEventsPerSpan: number;
spanLimits: {
attributeCountLimit: number;
linkCountLimit: number;
eventCountLimit: number;
};
} & Partial<TracerConfig> & TracerConfig;
//# sourceMappingURL=utility.d.ts.map

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

const target = Object.assign({}, config_1.DEFAULT_CONFIG, perInstanceDefaults, userConfig);
target.traceParams = Object.assign({}, config_1.DEFAULT_CONFIG.traceParams, userConfig.traceParams || {});
target.spanLimits = Object.assign({}, config_1.DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {});
return target;

@@ -32,0 +32,0 @@ }

{
"name": "@opentelemetry/tracing",
"version": "0.19.1-alpha.27+68852780",
"version": "0.19.1-alpha.28+3f82ff41",
"description": "OpenTelemetry Tracing",

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

},
"gitHead": "68852780eb2b65cc4bf492f020ad48a9af96a4e9"
"gitHead": "3f82ff411c6cb26a5aa40ef30a788e6b03255242"
}

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