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.25 to 0.19.1-alpha.26

build/esm/export/NoopSpanProcessor.d.ts

5

build/esm/BasicTracerProvider.d.ts

@@ -5,3 +5,5 @@ import { TracerProvider, TextMapPropagator } from '@opentelemetry/api';

import { SDKRegistrationConfig, TracerConfig } from './types';
import { SpanExporter } from './export/SpanExporter';
export declare type PROPAGATOR_FACTORY = () => TextMapPropagator;
export declare type EXPORTER_FACTORY = () => SpanExporter;
/**

@@ -12,2 +14,3 @@ * This class represents a basic tracer provider which platform libraries can extend

protected static readonly _registeredPropagators: Map<string, PROPAGATOR_FACTORY>;
protected static readonly _registeredExporters: Map<string, EXPORTER_FACTORY>;
private readonly _config;

@@ -36,4 +39,6 @@ private readonly _registeredSpanProcessors;

protected _getPropagator(name: string): TextMapPropagator | undefined;
protected _getSpanExporter(name: string): SpanExporter | undefined;
protected _buildPropagatorFromEnv(): TextMapPropagator | undefined;
protected _buildExporterFromEnv(): SpanExporter | undefined;
}
//# sourceMappingURL=BasicTracerProvider.d.ts.map

36

build/esm/BasicTracerProvider.js

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

import { MultiSpanProcessor } from './MultiSpanProcessor';
import { NoopSpanProcessor } from './NoopSpanProcessor';
import { NoopSpanProcessor } from './export/NoopSpanProcessor';
var merge = require('lodash.merge');
import { BatchSpanProcessor } from './export/BatchSpanProcessor';
/**

@@ -34,3 +35,2 @@ * This class represents a basic tracer provider which platform libraries can extend

this._tracers = new Map();
this.activeSpanProcessor = new NoopSpanProcessor();
var mergedConfig = merge({}, DEFAULT_CONFIG, config);

@@ -42,2 +42,10 @@ this.resource =

});
var defaultExporter = this._buildExporterFromEnv();
if (defaultExporter !== undefined) {
var batchProcessor = new BatchSpanProcessor(defaultExporter);
this.activeSpanProcessor = batchProcessor;
}
else {
this.activeSpanProcessor = new NoopSpanProcessor();
}
}

@@ -56,2 +64,11 @@ BasicTracerProvider.prototype.getTracer = function (name, version) {

BasicTracerProvider.prototype.addSpanProcessor = function (spanProcessor) {
if (this._registeredSpanProcessors.length === 0) {
// since we might have enabled by default a batchProcessor, we disable it
// before adding the new one
this.activeSpanProcessor
.shutdown()
.catch(function (err) {
return diag.error('Error while trying to shutdown current span processor', err);
});
}
this._registeredSpanProcessors.push(spanProcessor);

@@ -90,2 +107,6 @@ this.activeSpanProcessor = new MultiSpanProcessor(this._registeredSpanProcessors);

};
BasicTracerProvider.prototype._getSpanExporter = function (name) {
var _a;
return (_a = BasicTracerProvider._registeredExporters.get(name)) === null || _a === void 0 ? void 0 : _a();
};
BasicTracerProvider.prototype._buildPropagatorFromEnv = function () {

@@ -120,2 +141,12 @@ var _this = this;

};
BasicTracerProvider.prototype._buildExporterFromEnv = function () {
var exporterName = getEnv().OTEL_TRACES_EXPORTER;
if (exporterName === 'none')
return;
var exporter = this._getSpanExporter(exporterName);
if (!exporter) {
diag.error("Exporter \"" + exporterName + "\" requested through environment variable is unavailable.");
}
return exporter;
};
BasicTracerProvider._registeredPropagators = new Map([

@@ -125,2 +156,3 @@ ['tracecontext', function () { return new HttpTraceContextPropagator(); }],

]);
BasicTracerProvider._registeredExporters = new Map();
return BasicTracerProvider;

@@ -127,0 +159,0 @@ }());

@@ -9,2 +9,3 @@ export * from './Tracer';

export * from './export/SpanExporter';
export * from './export/NoopSpanProcessor';
export * from './Span';

@@ -11,0 +12,0 @@ export * from './SpanProcessor';

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

export * from './export/SpanExporter';
export * from './export/NoopSpanProcessor';
export * from './Span';

@@ -26,0 +27,0 @@ export * from './SpanProcessor';

@@ -5,3 +5,5 @@ import { TracerProvider, TextMapPropagator } from '@opentelemetry/api';

import { SDKRegistrationConfig, TracerConfig } from './types';
import { SpanExporter } from './export/SpanExporter';
export declare type PROPAGATOR_FACTORY = () => TextMapPropagator;
export declare type EXPORTER_FACTORY = () => SpanExporter;
/**

@@ -12,2 +14,3 @@ * This class represents a basic tracer provider which platform libraries can extend

protected static readonly _registeredPropagators: Map<string, PROPAGATOR_FACTORY>;
protected static readonly _registeredExporters: Map<string, EXPORTER_FACTORY>;
private readonly _config;

@@ -36,4 +39,6 @@ private readonly _registeredSpanProcessors;

protected _getPropagator(name: string): TextMapPropagator | undefined;
protected _getSpanExporter(name: string): SpanExporter | undefined;
protected _buildPropagatorFromEnv(): TextMapPropagator | undefined;
protected _buildExporterFromEnv(): SpanExporter | undefined;
}
//# sourceMappingURL=BasicTracerProvider.d.ts.map

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

const MultiSpanProcessor_1 = require("./MultiSpanProcessor");
const NoopSpanProcessor_1 = require("./NoopSpanProcessor");
const NoopSpanProcessor_1 = require("./export/NoopSpanProcessor");
const merge = require('lodash.merge');
const BatchSpanProcessor_1 = require("./export/BatchSpanProcessor");
/**

@@ -36,3 +37,2 @@ * This class represents a basic tracer provider which platform libraries can extend

this._tracers = new Map();
this.activeSpanProcessor = new NoopSpanProcessor_1.NoopSpanProcessor();
const mergedConfig = merge({}, config_1.DEFAULT_CONFIG, config);

@@ -44,2 +44,10 @@ this.resource =

});
const defaultExporter = this._buildExporterFromEnv();
if (defaultExporter !== undefined) {
const batchProcessor = new BatchSpanProcessor_1.BatchSpanProcessor(defaultExporter);
this.activeSpanProcessor = batchProcessor;
}
else {
this.activeSpanProcessor = new NoopSpanProcessor_1.NoopSpanProcessor();
}
}

@@ -58,2 +66,9 @@ getTracer(name, version) {

addSpanProcessor(spanProcessor) {
if (this._registeredSpanProcessors.length === 0) {
// since we might have enabled by default a batchProcessor, we disable it
// before adding the new one
this.activeSpanProcessor
.shutdown()
.catch(err => api_1.diag.error('Error while trying to shutdown current span processor', err));
}
this._registeredSpanProcessors.push(spanProcessor);

@@ -91,2 +106,6 @@ this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors);

}
_getSpanExporter(name) {
var _a;
return (_a = BasicTracerProvider._registeredExporters.get(name)) === null || _a === void 0 ? void 0 : _a();
}
_buildPropagatorFromEnv() {

@@ -120,2 +139,12 @@ // per spec, propagators from env must be deduplicated

}
_buildExporterFromEnv() {
const exporterName = core_1.getEnv().OTEL_TRACES_EXPORTER;
if (exporterName === 'none')
return;
const exporter = this._getSpanExporter(exporterName);
if (!exporter) {
api_1.diag.error(`Exporter "${exporterName}" requested through environment variable is unavailable.`);
}
return exporter;
}
}

@@ -127,2 +156,3 @@ exports.BasicTracerProvider = BasicTracerProvider;

]);
BasicTracerProvider._registeredExporters = new Map();
//# sourceMappingURL=BasicTracerProvider.js.map

@@ -9,2 +9,3 @@ export * from './Tracer';

export * from './export/SpanExporter';
export * from './export/NoopSpanProcessor';
export * from './Span';

@@ -11,0 +12,0 @@ export * from './SpanProcessor';

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

__exportStar(require("./export/SpanExporter"), exports);
__exportStar(require("./export/NoopSpanProcessor"), exports);
__exportStar(require("./Span"), exports);

@@ -38,0 +39,0 @@ __exportStar(require("./SpanProcessor"), exports);

8

package.json
{
"name": "@opentelemetry/tracing",
"version": "0.19.1-alpha.25+02239b52",
"version": "0.19.1-alpha.26+1758fa6e",
"description": "OpenTelemetry Tracing",

@@ -85,8 +85,8 @@ "main": "build/src/index.js",

"dependencies": {
"@opentelemetry/core": "^0.19.1-alpha.25+02239b52",
"@opentelemetry/resources": "^0.19.1-alpha.25+02239b52",
"@opentelemetry/core": "^0.19.1-alpha.26+1758fa6e",
"@opentelemetry/resources": "^0.19.1-alpha.26+1758fa6e",
"@opentelemetry/semantic-conventions": "^0.19.0",
"lodash.merge": "^4.6.2"
},
"gitHead": "02239b52557fe5b4c5ae6eba742340428b856492"
"gitHead": "1758fa6e84333c9c43cc468c5e99dd3646f7e3c7"
}

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