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.10.3-canary.0 to 0.11.1-alpha.48

3

build/src/BasicTracerProvider.d.ts

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

private readonly _tracers;
private _cleanNotifyOnGlobalShutdown;
activeSpanProcessor: NoopSpanProcessor;

@@ -33,3 +34,5 @@ readonly logger: api.Logger;

register(config?: SDKRegistrationConfig): void;
shutdown(cb?: () => void): void;
private _shutdownActiveProcessor;
}
//# sourceMappingURL=BasicTracerProvider.d.ts.map

@@ -41,2 +41,5 @@ "use strict";

});
if (this._config.gracefulShutdown) {
this._cleanNotifyOnGlobalShutdown = core_1.notifyOnGlobalShutdown(this._shutdownActiveProcessor.bind(this));
}
}

@@ -82,4 +85,14 @@ getTracer(name, version = '*', config) {

}
shutdown(cb = () => { }) {
this.activeSpanProcessor.shutdown(cb);
if (this._cleanNotifyOnGlobalShutdown) {
this._cleanNotifyOnGlobalShutdown();
this._cleanNotifyOnGlobalShutdown = undefined;
}
}
_shutdownActiveProcessor() {
this.activeSpanProcessor.shutdown();
}
}
exports.BasicTracerProvider = BasicTracerProvider;
//# sourceMappingURL=BasicTracerProvider.js.map

@@ -22,3 +22,4 @@ import { AlwaysOnSampler } from '@opentelemetry/core';

};
gracefulShutdown: boolean;
};
//# sourceMappingURL=config.d.ts.map

@@ -40,3 +40,4 @@ "use strict";

},
gracefulShutdown: true,
};
//# sourceMappingURL=config.js.map

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

exports.BatchSpanProcessor = void 0;
const api_1 = require("@opentelemetry/api");
const core_1 = require("@opentelemetry/core");

@@ -78,3 +79,6 @@ const DEFAULT_BUFFER_SIZE = 100;

}
this._exporter.export(this._finishedSpans, cb);
// prevent downstream exporter calls from generating spans
api_1.context.with(core_1.suppressInstrumentation(api_1.context.active()), () => {
this._exporter.export(this._finishedSpans, cb);
});
this._finishedSpans = [];

@@ -81,0 +85,0 @@ }

8

build/src/export/InMemorySpanExporter.d.ts

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

* This class can be used for testing purposes. It stores the exported spans
* in a list in memory that can be retrieve using the `getFinishedSpans()`
* in a list in memory that can be retrieved using the `getFinishedSpans()`
* method.

@@ -12,3 +12,7 @@ */

private _finishedSpans;
private _stopped;
/**
* Indicates if the exporter has been "shutdown."
* When false, exported spans will not be stored in-memory.
*/
protected _stopped: boolean;
export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): void;

@@ -15,0 +19,0 @@ shutdown(): void;

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

* This class can be used for testing purposes. It stores the exported spans
* in a list in memory that can be retrieve using the `getFinishedSpans()`
* in a list in memory that can be retrieved using the `getFinishedSpans()`
* method.

@@ -29,2 +29,6 @@ */

this._finishedSpans = [];
/**
* Indicates if the exporter has been "shutdown."
* When false, exported spans will not be stored in-memory.
*/
this._stopped = false;

@@ -36,3 +40,3 @@ }

this._finishedSpans.push(...spans);
return resultCallback(core_1.ExportResult.SUCCESS);
setTimeout(() => resultCallback(core_1.ExportResult.SUCCESS), 0);
}

@@ -39,0 +43,0 @@ shutdown() {

@@ -19,2 +19,4 @@ "use strict";

exports.SimpleSpanProcessor = void 0;
const api_1 = require("@opentelemetry/api");
const core_1 = require("@opentelemetry/core");
/**

@@ -41,3 +43,6 @@ * An implementation of the {@link SpanProcessor} that converts the {@link Span}

}
this._exporter.export([span], () => { });
// prevent downstream exporter calls from generating spans
api_1.context.with(core_1.suppressInstrumentation(api_1.context.active()), () => {
this._exporter.export([span], () => { });
});
}

@@ -44,0 +49,0 @@ shutdown(cb = () => { }) {

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

isRecording(): boolean;
recordException(exception: api.Exception, time?: api.TimeInput): void;
get duration(): api.HrTime;

@@ -46,0 +47,0 @@ get ended(): boolean;

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

const core_1 = require("@opentelemetry/core");
const semantic_conventions_1 = require("@opentelemetry/semantic-conventions");
/**

@@ -131,2 +132,30 @@ * This class represents a span.

}
recordException(exception, time = core_1.hrTime()) {
const attributes = {};
if (typeof exception === 'string') {
attributes[semantic_conventions_1.ExceptionAttribute.MESSAGE] = exception;
}
else if (exception) {
if (exception.code) {
attributes[semantic_conventions_1.ExceptionAttribute.TYPE] = exception.code;
}
else if (exception.name) {
attributes[semantic_conventions_1.ExceptionAttribute.TYPE] = exception.name;
}
if (exception.message) {
attributes[semantic_conventions_1.ExceptionAttribute.MESSAGE] = exception.message;
}
if (exception.stack) {
attributes[semantic_conventions_1.ExceptionAttribute.STACKTRACE] = exception.stack;
}
}
// these are minimum requirements from spec
if (attributes[semantic_conventions_1.ExceptionAttribute.TYPE] ||
attributes[semantic_conventions_1.ExceptionAttribute.MESSAGE]) {
this.addEvent(semantic_conventions_1.ExceptionEventName, attributes, time);
}
else {
this._logger.warn(`Failed to record an exception ${exception}`);
}
}
get duration() {

@@ -133,0 +162,0 @@ return this._duration;

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

var _a, _b, _c;
if (core_1.isInstrumentationSuppressed(context)) {
this.logger.debug('Instrumentation suppressed, returning Noop Span');
return api.NOOP_SPAN;
}
const parentContext = getParent(options, context);

@@ -51,3 +55,3 @@ const spanId = this._idGenerator.generateSpanId();

let traceState;
if (!parentContext || !core_1.isValid(parentContext)) {
if (!parentContext || !api.trace.isSpanContextValid(parentContext)) {
// New root span.

@@ -54,0 +58,0 @@ traceId = this._idGenerator.generateTraceId();

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

import { HttpTextPropagator, Logger, Sampler } from '@opentelemetry/api';
import { TextMapPropagator, Logger, Sampler } from '@opentelemetry/api';
import { LogLevel, IdGenerator } from '@opentelemetry/core';

@@ -23,2 +23,4 @@ import { ContextManager } from '@opentelemetry/context-base';

resource?: Resource;
/** Bool for whether or not graceful shutdown is enabled. If disabled spans will not be exported when SIGTERM is recieved */
gracefulShutdown?: boolean;
/**

@@ -37,3 +39,3 @@ * Generator of trace and span IDs

/** Propagator to register as the global propagator */
propagator?: HttpTextPropagator | null;
propagator?: TextMapPropagator | null;
/** Context manager to register as the global context manager */

@@ -40,0 +42,0 @@ contextManager?: ContextManager | null;

@@ -15,2 +15,3 @@ import { TracerConfig } from './types';

};
gracefulShutdown: boolean;
} & {

@@ -17,0 +18,0 @@ sampler: ParentOrElseSampler;

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

export declare const VERSION = "0.10.3-canary.0+f4f2f84";
export declare const VERSION = "0.11.1-alpha.48+15174c6";
//# sourceMappingURL=version.d.ts.map

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

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.10.3-canary.0+f4f2f84';
exports.VERSION = '0.11.1-alpha.48+15174c6';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/tracing",
"version": "0.10.3-canary.0+f4f2f84",
"version": "0.11.1-alpha.48+15174c6",
"description": "OpenTelemetry Tracing",

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

"devDependencies": {
"@types/mocha": "8.0.0",
"@types/mocha": "8.0.2",
"@types/node": "14.0.27",

@@ -70,4 +70,4 @@ "@types/sinon": "9.0.4",

"rimraf": "3.0.2",
"sinon": "9.0.2",
"ts-loader": "8.0.1",
"sinon": "9.0.3",
"ts-loader": "8.0.2",
"ts-mocha": "7.0.0",

@@ -79,8 +79,9 @@ "ts-node": "8.10.2",

"dependencies": {
"@opentelemetry/api": "^0.10.3-canary.0+f4f2f84",
"@opentelemetry/context-base": "^0.10.3-canary.0+f4f2f84",
"@opentelemetry/core": "^0.10.3-canary.0+f4f2f84",
"@opentelemetry/resources": "^0.10.3-canary.0+f4f2f84"
"@opentelemetry/api": "^0.11.1-alpha.48+15174c6",
"@opentelemetry/context-base": "^0.11.1-alpha.48+15174c6",
"@opentelemetry/core": "^0.11.1-alpha.48+15174c6",
"@opentelemetry/resources": "^0.11.1-alpha.48+15174c6",
"@opentelemetry/semantic-conventions": "^0.11.1-alpha.48+15174c6"
},
"gitHead": "f4f2f84bc087389b3206a2e17837b7b0b95fb2f2"
"gitHead": "15174c6647ab9863dfc1424412fa60f2fddb3351"
}

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