Socket
Socket
Sign inDemoInstall

@opentelemetry/api

Package Overview
Dependencies
Maintainers
4
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/api - npm Package Compare versions

Comparing version 0.10.3-canary.0 to 0.11.0

build/src/common/Exception.d.ts

4

build/src/api/global-utils.d.ts
import { ContextManager } from '@opentelemetry/context-base';
import { HttpTextPropagator } from '../context/propagation/HttpTextPropagator';
import { TextMapPropagator } from '../context/propagation/TextMapPropagator';
import { MeterProvider } from '../metrics/MeterProvider';

@@ -13,3 +13,3 @@ import { TracerProvider } from '../trace/tracer_provider';

[GLOBAL_METRICS_API_KEY]: Get<MeterProvider>;
[GLOBAL_PROPAGATION_API_KEY]: Get<HttpTextPropagator>;
[GLOBAL_PROPAGATION_API_KEY]: Get<TextMapPropagator>;
[GLOBAL_TRACE_API_KEY]: Get<TracerProvider>;

@@ -16,0 +16,0 @@ }>;

import { Context } from '@opentelemetry/context-base';
import { GetterFunction } from '../context/propagation/getter';
import { HttpTextPropagator } from '../context/propagation/HttpTextPropagator';
import { TextMapPropagator } from '../context/propagation/TextMapPropagator';
import { SetterFunction } from '../context/propagation/setter';

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

*/
setGlobalPropagator(propagator: HttpTextPropagator): HttpTextPropagator;
setGlobalPropagator(propagator: TextMapPropagator): TextMapPropagator;
/**

@@ -20,0 +20,0 @@ * Inject context into a carrier to be propagated inter-process

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

var getter_1 = require("../context/propagation/getter");
var NoopHttpTextPropagator_1 = require("../context/propagation/NoopHttpTextPropagator");
var NoopTextMapPropagator_1 = require("../context/propagation/NoopTextMapPropagator");
var setter_1 = require("../context/propagation/setter");

@@ -48,3 +48,3 @@ var context_1 = require("./context");

}
global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, propagator, NoopHttpTextPropagator_1.NOOP_HTTP_TEXT_PROPAGATOR);
global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, propagator, NoopTextMapPropagator_1.NOOP_TEXT_MAP_PROPAGATOR);
return propagator;

@@ -82,3 +82,3 @@ };

var _a, _b;
return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopHttpTextPropagator_1.NOOP_HTTP_TEXT_PROPAGATOR);
return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopTextMapPropagator_1.NOOP_TEXT_MAP_PROPAGATOR);
};

@@ -85,0 +85,0 @@ return PropagationAPI;

import { Tracer } from '../trace/tracer';
import { TracerProvider } from '../trace/tracer_provider';
import { isSpanContextValid } from '../trace/spancontext-utils';
/**

@@ -8,2 +9,3 @@ * Singleton object which represents the entry point to the OpenTelemetry Tracing API

private static _instance?;
private _proxyTracerProvider;
/** Empty private constructor prevents end users from constructing a new instance of the API */

@@ -27,3 +29,4 @@ private constructor();

disable(): void;
isSpanContextValid: typeof isSpanContextValid;
}
//# sourceMappingURL=trace.d.ts.map

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

var NoopTracerProvider_1 = require("../trace/NoopTracerProvider");
var ProxyTracerProvider_1 = require("../trace/ProxyTracerProvider");
var spancontext_utils_1 = require("../trace/spancontext-utils");
var global_utils_1 = require("./global-utils");

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

function TraceAPI() {
this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider();
this.isSpanContextValid = spancontext_utils_1.isSpanContextValid;
}

@@ -45,3 +49,4 @@ /** Get the singleton instance of the Trace API */

}
global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopTracerProvider_1.NOOP_TRACER_PROVIDER);
this._proxyTracerProvider.setDelegate(provider);
global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, this._proxyTracerProvider, NoopTracerProvider_1.NOOP_TRACER_PROVIDER);
return this.getTracerProvider();

@@ -54,3 +59,3 @@ };

var _a, _b;
return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopTracerProvider_1.NOOP_TRACER_PROVIDER);
return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : this._proxyTracerProvider);
};

@@ -66,2 +71,3 @@ /**

delete global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY];
this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider();
};

@@ -68,0 +74,0 @@ return TraceAPI;

@@ -0,6 +1,7 @@

export * from './common/Exception';
export * from './common/Logger';
export * from './common/Time';
export * from './context/propagation/getter';
export * from './context/propagation/HttpTextPropagator';
export * from './context/propagation/NoopHttpTextPropagator';
export * from './context/propagation/TextMapPropagator';
export * from './context/propagation/NoopTextMapPropagator';
export * from './context/propagation/setter';

@@ -26,2 +27,4 @@ export * from './correlation_context/CorrelationContext';

export * from './trace/NoopTracerProvider';
export * from './trace/ProxyTracer';
export * from './trace/ProxyTracerProvider';
export * from './trace/Sampler';

@@ -39,2 +42,3 @@ export * from './trace/SamplingResult';

export * from './trace/tracer';
export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/spancontext-utils';
export { Context } from '@opentelemetry/context-base';

@@ -41,0 +45,0 @@ import { ContextAPI } from './api/context';

@@ -29,7 +29,8 @@ "use strict";

exports.propagation = exports.metrics = exports.trace = exports.context = void 0;
__exportStar(require("./common/Exception"), exports);
__exportStar(require("./common/Logger"), exports);
__exportStar(require("./common/Time"), exports);
__exportStar(require("./context/propagation/getter"), exports);
__exportStar(require("./context/propagation/HttpTextPropagator"), exports);
__exportStar(require("./context/propagation/NoopHttpTextPropagator"), exports);
__exportStar(require("./context/propagation/TextMapPropagator"), exports);
__exportStar(require("./context/propagation/NoopTextMapPropagator"), exports);
__exportStar(require("./context/propagation/setter"), exports);

@@ -55,2 +56,4 @@ __exportStar(require("./correlation_context/CorrelationContext"), exports);

__exportStar(require("./trace/NoopTracerProvider"), exports);
__exportStar(require("./trace/ProxyTracer"), exports);
__exportStar(require("./trace/ProxyTracerProvider"), exports);
__exportStar(require("./trace/Sampler"), exports);

@@ -68,2 +71,6 @@ __exportStar(require("./trace/SamplingResult"), exports);

__exportStar(require("./trace/tracer"), exports);
var spancontext_utils_1 = require("./trace/spancontext-utils");
Object.defineProperty(exports, "INVALID_SPANID", { enumerable: true, get: function () { return spancontext_utils_1.INVALID_SPANID; } });
Object.defineProperty(exports, "INVALID_TRACEID", { enumerable: true, get: function () { return spancontext_utils_1.INVALID_TRACEID; } });
Object.defineProperty(exports, "INVALID_SPAN_CONTEXT", { enumerable: true, get: function () { return spancontext_utils_1.INVALID_SPAN_CONTEXT; } });
var context_base_1 = require("@opentelemetry/context-base");

@@ -70,0 +77,0 @@ Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return context_base_1.Context; } });

@@ -1,3 +0,1 @@

import { CorrelationContext } from '../correlation_context/CorrelationContext';
import { SpanContext } from '../trace/span_context';
/** An Instrument for Counter Metric. */

@@ -16,10 +14,4 @@ export interface BoundCounter {

* @param value to record.
* @param correlationContext the correlationContext associated with the
* values.
* @param spanContext the {@link SpanContext} that identifies the {@link Span}
* which the values are associated with.
*/
record(value: number): void;
record(value: number, correlationContext: CorrelationContext): void;
record(value: number, correlationContext: CorrelationContext, spanContext: SpanContext): void;
}

@@ -26,0 +18,0 @@ /** An Instrument for Base Observer */

@@ -1,3 +0,1 @@

import { CorrelationContext } from '../correlation_context/CorrelationContext';
import { SpanContext } from '../trace/span_context';
import { BoundBaseObserver, BoundCounter, BoundValueRecorder } from './BoundInstrument';

@@ -29,7 +27,2 @@ import { Logger } from '../common/Logger';

/**
* (Measure only, default true) Asserts that this metric will only accept
* non-negative values (e.g. disk usage).
*/
absolute?: boolean;
/**
* Indicates the type of the recorded value.

@@ -116,4 +109,2 @@ * @default {@link ValueType.DOUBLE}

record(value: number, labels?: Labels): void;
record(value: number, labels: Labels, correlationContext: CorrelationContext): void;
record(value: number, labels: Labels, correlationContext: CorrelationContext, spanContext: SpanContext): void;
}

@@ -120,0 +111,0 @@ /** Base interface for the Observer metrics. */

@@ -71,3 +71,3 @@ import { BatchObserverResult } from './BatchObserverResult';

export declare class NoopValueRecorderMetric extends NoopMetric<BoundValueRecorder> implements ValueRecorder {
record(value: number, labels: Labels, correlationContext?: CorrelationContext, spanContext?: SpanContext): void;
record(value: number, labels: Labels): void;
}

@@ -74,0 +74,0 @@ export declare class NoopBaseObserverMetric extends NoopMetric<BoundBaseObserver> implements BaseObserver {

@@ -129,12 +129,4 @@ "use strict";

}
NoopValueRecorderMetric.prototype.record = function (value, labels, correlationContext, spanContext) {
if (typeof correlationContext === 'undefined') {
this.bind(labels).record(value);
}
else if (typeof spanContext === 'undefined') {
this.bind(labels).record(value, correlationContext);
}
else {
this.bind(labels).record(value, correlationContext, spanContext);
}
NoopValueRecorderMetric.prototype.record = function (value, labels) {
this.bind(labels).record(value);
};

@@ -141,0 +133,0 @@ return NoopValueRecorderMetric;

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

import { Exception } from '../common/Exception';
import { TimeInput } from '../common/Time';

@@ -6,4 +7,2 @@ import { Attributes } from './attributes';

import { Status } from './status';
export declare const INVALID_TRACE_ID = "0";
export declare const INVALID_SPAN_ID = "0";
/**

@@ -25,4 +24,5 @@ * The NoopSpan is the default {@link Span} that is used when no Span

isRecording(): boolean;
recordException(exception: Exception, time?: TimeInput): void;
}
export declare const NOOP_SPAN: NoopSpan;
//# sourceMappingURL=NoopSpan.d.ts.map

@@ -18,11 +18,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.NOOP_SPAN = exports.NoopSpan = exports.INVALID_SPAN_ID = exports.INVALID_TRACE_ID = void 0;
var trace_flags_1 = require("./trace_flags");
exports.INVALID_TRACE_ID = '0';
exports.INVALID_SPAN_ID = '0';
var INVALID_SPAN_CONTEXT = {
traceId: exports.INVALID_TRACE_ID,
spanId: exports.INVALID_SPAN_ID,
traceFlags: trace_flags_1.TraceFlags.NONE,
};
exports.NOOP_SPAN = exports.NoopSpan = void 0;
var spancontext_utils_1 = require("./spancontext-utils");
/**

@@ -35,3 +28,3 @@ * The NoopSpan is the default {@link Span} that is used when no Span

function NoopSpan(_spanContext) {
if (_spanContext === void 0) { _spanContext = INVALID_SPAN_CONTEXT; }
if (_spanContext === void 0) { _spanContext = spancontext_utils_1.INVALID_SPAN_CONTEXT; }
this._spanContext = _spanContext;

@@ -69,2 +62,4 @@ }

};
// By default does nothing
NoopSpan.prototype.recordException = function (exception, time) { };
return NoopSpan;

@@ -71,0 +66,0 @@ }());

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

import { Exception } from '../common/Exception';
import { Attributes } from './attributes';

@@ -89,3 +90,10 @@ import { SpanContext } from './span_context';

isRecording(): boolean;
/**
* Sets exception as a span event
* @param exception the exception the only accepted values are string or Error
* @param [time] the time to set as Span's event time. If not provided,
* use the current time.
*/
recordException(exception: Exception, time?: TimeInput): void;
}
//# sourceMappingURL=span.d.ts.map

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

export declare const VERSION = "0.10.3-canary.0+f4f2f84";
export declare const VERSION = "0.11.0";
//# 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.0';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/api",
"version": "0.10.3-canary.0+f4f2f84",
"version": "0.11.0",
"description": "Public API for OpenTelemetry",

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

"dependencies": {
"@opentelemetry/context-base": "^0.10.3-canary.0+f4f2f84"
"@opentelemetry/context-base": "^0.11.0"
},
"devDependencies": {
"@types/mocha": "8.0.0",
"@types/mocha": "8.0.2",
"@types/node": "14.0.27",
"@types/sinon": "4.3.1",
"@types/webpack-env": "1.15.2",

@@ -74,9 +75,10 @@ "codecov": "3.7.2",

"nyc": "15.1.0",
"ts-loader": "8.0.1",
"sinon": "9.0.3",
"ts-loader": "8.0.2",
"ts-mocha": "7.0.0",
"typedoc": "0.17.8",
"typedoc": "0.18.0",
"typescript": "3.9.7",
"webpack": "4.44.1"
},
"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