@opentelemetry/api
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -16,5 +16,6 @@ /* | ||
*/ | ||
import { diag } from '..'; | ||
import { DiagAPI } from '../api/diag'; | ||
import { BaggageImpl } from './internal/baggage-impl'; | ||
import { baggageEntryMetadataSymbol } from './internal/symbol'; | ||
var diag = DiagAPI.instance(); | ||
/** | ||
@@ -21,0 +22,0 @@ * Create a new Baggage with optional entries |
@@ -22,3 +22,4 @@ export * from './baggage/types'; | ||
export * from './trace/tracer'; | ||
export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils'; | ||
export { isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils'; | ||
export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/invalid-span-constants'; | ||
export * from './context/context'; | ||
@@ -25,0 +26,0 @@ export * from './context/types'; |
@@ -37,3 +37,4 @@ /* | ||
export * from './trace/tracer'; | ||
export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils'; | ||
export { isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils'; | ||
export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/invalid-span-constants'; | ||
export * from './context/context'; | ||
@@ -40,0 +41,0 @@ export * from './context/types'; |
@@ -1,2 +0,1 @@ | ||
import type { DiagAPI } from '../api/diag'; | ||
import { ContextManager } from '../context/types'; | ||
@@ -6,5 +5,5 @@ import { DiagLogger } from '../diag'; | ||
import type { TracerProvider } from '../trace/tracer_provider'; | ||
export declare function registerGlobal<Type extends keyof OTelGlobalAPI>(type: Type, instance: OTelGlobalAPI[Type], diag: DiagAPI, allowOverride?: boolean): boolean; | ||
export declare function registerGlobal<Type extends keyof OTelGlobalAPI>(type: Type, instance: OTelGlobalAPI[Type], diag: DiagLogger, allowOverride?: boolean): boolean; | ||
export declare function getGlobal<Type extends keyof OTelGlobalAPI>(type: Type): OTelGlobalAPI[Type] | undefined; | ||
export declare function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagAPI): void; | ||
export declare function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagLogger): void; | ||
declare type OTelGlobalAPI = { | ||
@@ -11,0 +10,0 @@ version: string; |
@@ -16,3 +16,3 @@ /* | ||
*/ | ||
import { INVALID_SPAN_CONTEXT } from './spancontext-utils'; | ||
import { INVALID_SPAN_CONTEXT } from './invalid-span-constants'; | ||
/** | ||
@@ -19,0 +19,0 @@ * The NonRecordingSpan is the default {@link Span} that is used when no Span |
@@ -16,6 +16,7 @@ /* | ||
*/ | ||
import { context } from '../'; | ||
import { ContextAPI } from '../api/context'; | ||
import { getSpanContext, setSpan } from '../trace/context-utils'; | ||
import { NonRecordingSpan } from './NonRecordingSpan'; | ||
import { isSpanContextValid } from './spancontext-utils'; | ||
var context = ContextAPI.getInstance(); | ||
/** | ||
@@ -22,0 +23,0 @@ * No-op implementations of {@link Tracer}. |
import { Context } from '../context/types'; | ||
import { ProxyTracerProvider } from './ProxyTracerProvider'; | ||
import { Span } from './span'; | ||
@@ -14,3 +13,3 @@ import { SpanOptions } from './SpanOptions'; | ||
private _delegate?; | ||
constructor(_provider: ProxyTracerProvider, name: string, version?: string | undefined); | ||
constructor(_provider: TracerDelegator, name: string, version?: string | undefined); | ||
startSpan(name: string, options?: SpanOptions, context?: Context): Span; | ||
@@ -24,2 +23,5 @@ startActiveSpan<F extends (span: Span) => unknown>(_name: string, _options: F | SpanOptions, _context?: F | Context, _fn?: F): ReturnType<F>; | ||
} | ||
export interface TracerDelegator { | ||
getDelegateTracer(name: string, version?: string): Tracer | undefined; | ||
} | ||
//# sourceMappingURL=ProxyTracer.d.ts.map |
import { Span } from './span'; | ||
import { SpanContext } from './span_context'; | ||
export declare const INVALID_SPANID = "0000000000000000"; | ||
export declare const INVALID_TRACEID = "00000000000000000000000000000000"; | ||
export declare const INVALID_SPAN_CONTEXT: SpanContext; | ||
export declare function isValidTraceId(traceId: string): boolean; | ||
@@ -7,0 +4,0 @@ export declare function isValidSpanId(spanId: string): boolean; |
@@ -16,13 +16,6 @@ /* | ||
*/ | ||
import { INVALID_SPANID, INVALID_TRACEID } from './invalid-span-constants'; | ||
import { NonRecordingSpan } from './NonRecordingSpan'; | ||
import { TraceFlags } from './trace_flags'; | ||
var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i; | ||
var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i; | ||
export var INVALID_SPANID = '0000000000000000'; | ||
export var INVALID_TRACEID = '00000000000000000000000000000000'; | ||
export var INVALID_SPAN_CONTEXT = { | ||
traceId: INVALID_TRACEID, | ||
spanId: INVALID_SPANID, | ||
traceFlags: TraceFlags.NONE, | ||
}; | ||
export function isValidTraceId(traceId) { | ||
@@ -29,0 +22,0 @@ return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID; |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "1.0.2"; | ||
export declare const VERSION = "1.0.3"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -17,3 +17,3 @@ /* | ||
// this is autogenerated file, see scripts/version-update.js | ||
export var VERSION = '1.0.2'; | ||
export var VERSION = '1.0.3'; | ||
//# sourceMappingURL=version.js.map |
@@ -19,5 +19,6 @@ "use strict"; | ||
exports.baggageEntryMetadataFromString = exports.createBaggage = void 0; | ||
var __1 = require(".."); | ||
var diag_1 = require("../api/diag"); | ||
var baggage_impl_1 = require("./internal/baggage-impl"); | ||
var symbol_1 = require("./internal/symbol"); | ||
var diag = diag_1.DiagAPI.instance(); | ||
/** | ||
@@ -41,3 +42,3 @@ * Create a new Baggage with optional entries | ||
if (typeof str !== 'string') { | ||
__1.diag.error("Cannot create baggage metadata from unknown type: " + typeof str); | ||
diag.error("Cannot create baggage metadata from unknown type: " + typeof str); | ||
str = ''; | ||
@@ -44,0 +45,0 @@ } |
@@ -22,3 +22,4 @@ export * from './baggage/types'; | ||
export * from './trace/tracer'; | ||
export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils'; | ||
export { isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils'; | ||
export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/invalid-span-constants'; | ||
export * from './context/context'; | ||
@@ -25,0 +26,0 @@ export * from './context/types'; |
@@ -28,3 +28,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.diag = exports.propagation = exports.trace = exports.context = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.baggageEntryMetadataFromString = void 0; | ||
exports.diag = exports.propagation = exports.trace = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.baggageEntryMetadataFromString = void 0; | ||
__exportStar(require("./baggage/types"), exports); | ||
@@ -53,8 +53,9 @@ var utils_1 = require("./baggage/utils"); | ||
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; } }); | ||
Object.defineProperty(exports, "isSpanContextValid", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } }); | ||
Object.defineProperty(exports, "isValidTraceId", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } }); | ||
Object.defineProperty(exports, "isValidSpanId", { enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } }); | ||
var invalid_span_constants_1 = require("./trace/invalid-span-constants"); | ||
Object.defineProperty(exports, "INVALID_SPANID", { enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPANID; } }); | ||
Object.defineProperty(exports, "INVALID_TRACEID", { enumerable: true, get: function () { return invalid_span_constants_1.INVALID_TRACEID; } }); | ||
Object.defineProperty(exports, "INVALID_SPAN_CONTEXT", { enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPAN_CONTEXT; } }); | ||
__exportStar(require("./context/context"), exports); | ||
@@ -61,0 +62,0 @@ __exportStar(require("./context/types"), exports); |
@@ -1,2 +0,1 @@ | ||
import type { DiagAPI } from '../api/diag'; | ||
import { ContextManager } from '../context/types'; | ||
@@ -6,5 +5,5 @@ import { DiagLogger } from '../diag'; | ||
import type { TracerProvider } from '../trace/tracer_provider'; | ||
export declare function registerGlobal<Type extends keyof OTelGlobalAPI>(type: Type, instance: OTelGlobalAPI[Type], diag: DiagAPI, allowOverride?: boolean): boolean; | ||
export declare function registerGlobal<Type extends keyof OTelGlobalAPI>(type: Type, instance: OTelGlobalAPI[Type], diag: DiagLogger, allowOverride?: boolean): boolean; | ||
export declare function getGlobal<Type extends keyof OTelGlobalAPI>(type: Type): OTelGlobalAPI[Type] | undefined; | ||
export declare function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagAPI): void; | ||
export declare function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagLogger): void; | ||
declare type OTelGlobalAPI = { | ||
@@ -11,0 +10,0 @@ version: string; |
@@ -19,3 +19,3 @@ "use strict"; | ||
exports.NonRecordingSpan = void 0; | ||
var spancontext_utils_1 = require("./spancontext-utils"); | ||
var invalid_span_constants_1 = require("./invalid-span-constants"); | ||
/** | ||
@@ -28,3 +28,3 @@ * The NonRecordingSpan is the default {@link Span} that is used when no Span | ||
function NonRecordingSpan(_spanContext) { | ||
if (_spanContext === void 0) { _spanContext = spancontext_utils_1.INVALID_SPAN_CONTEXT; } | ||
if (_spanContext === void 0) { _spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT; } | ||
this._spanContext = _spanContext; | ||
@@ -31,0 +31,0 @@ } |
@@ -19,6 +19,7 @@ "use strict"; | ||
exports.NoopTracer = void 0; | ||
var __1 = require("../"); | ||
var context_1 = require("../api/context"); | ||
var context_utils_1 = require("../trace/context-utils"); | ||
var NonRecordingSpan_1 = require("./NonRecordingSpan"); | ||
var spancontext_utils_1 = require("./spancontext-utils"); | ||
var context = context_1.ContextAPI.getInstance(); | ||
/** | ||
@@ -64,6 +65,6 @@ * No-op implementations of {@link Tracer}. | ||
} | ||
var parentContext = ctx !== null && ctx !== void 0 ? ctx : __1.context.active(); | ||
var parentContext = ctx !== null && ctx !== void 0 ? ctx : context.active(); | ||
var span = this.startSpan(name, opts, parentContext); | ||
var contextWithSpanSet = context_utils_1.setSpan(parentContext, span); | ||
return __1.context.with(contextWithSpanSet, fn, undefined, span); | ||
return context.with(contextWithSpanSet, fn, undefined, span); | ||
}; | ||
@@ -70,0 +71,0 @@ return NoopTracer; |
import { Context } from '../context/types'; | ||
import { ProxyTracerProvider } from './ProxyTracerProvider'; | ||
import { Span } from './span'; | ||
@@ -14,3 +13,3 @@ import { SpanOptions } from './SpanOptions'; | ||
private _delegate?; | ||
constructor(_provider: ProxyTracerProvider, name: string, version?: string | undefined); | ||
constructor(_provider: TracerDelegator, name: string, version?: string | undefined); | ||
startSpan(name: string, options?: SpanOptions, context?: Context): Span; | ||
@@ -24,2 +23,5 @@ startActiveSpan<F extends (span: Span) => unknown>(_name: string, _options: F | SpanOptions, _context?: F | Context, _fn?: F): ReturnType<F>; | ||
} | ||
export interface TracerDelegator { | ||
getDelegateTracer(name: string, version?: string): Tracer | undefined; | ||
} | ||
//# sourceMappingURL=ProxyTracer.d.ts.map |
import { Span } from './span'; | ||
import { SpanContext } from './span_context'; | ||
export declare const INVALID_SPANID = "0000000000000000"; | ||
export declare const INVALID_TRACEID = "00000000000000000000000000000000"; | ||
export declare const INVALID_SPAN_CONTEXT: SpanContext; | ||
export declare function isValidTraceId(traceId: string): boolean; | ||
@@ -7,0 +4,0 @@ export declare function isValidSpanId(spanId: string): boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.wrapSpanContext = exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0; | ||
exports.wrapSpanContext = exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = void 0; | ||
/* | ||
@@ -19,19 +19,12 @@ * Copyright The OpenTelemetry Authors | ||
*/ | ||
var invalid_span_constants_1 = require("./invalid-span-constants"); | ||
var NonRecordingSpan_1 = require("./NonRecordingSpan"); | ||
var trace_flags_1 = require("./trace_flags"); | ||
var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i; | ||
var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i; | ||
exports.INVALID_SPANID = '0000000000000000'; | ||
exports.INVALID_TRACEID = '00000000000000000000000000000000'; | ||
exports.INVALID_SPAN_CONTEXT = { | ||
traceId: exports.INVALID_TRACEID, | ||
spanId: exports.INVALID_SPANID, | ||
traceFlags: trace_flags_1.TraceFlags.NONE, | ||
}; | ||
function isValidTraceId(traceId) { | ||
return VALID_TRACEID_REGEX.test(traceId) && traceId !== exports.INVALID_TRACEID; | ||
return VALID_TRACEID_REGEX.test(traceId) && traceId !== invalid_span_constants_1.INVALID_TRACEID; | ||
} | ||
exports.isValidTraceId = isValidTraceId; | ||
function isValidSpanId(spanId) { | ||
return VALID_SPANID_REGEX.test(spanId) && spanId !== exports.INVALID_SPANID; | ||
return VALID_SPANID_REGEX.test(spanId) && spanId !== invalid_span_constants_1.INVALID_SPANID; | ||
} | ||
@@ -38,0 +31,0 @@ exports.isValidSpanId = isValidSpanId; |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "1.0.2"; | ||
export declare const VERSION = "1.0.3"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '1.0.2'; | ||
exports.VERSION = '1.0.3'; | ||
//# sourceMappingURL=version.js.map |
@@ -5,2 +5,9 @@ # CHANGELOG | ||
### [1.0.3](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.2...v1.0.3) (2021-08-30) | ||
### Bug Fixes | ||
* remove all circular dependencies ([#119](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/119)) ([a8083e8](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/a8083e84b23227828745da80fd5fe512357dd34b)) | ||
## 1.0.2 | ||
@@ -7,0 +14,0 @@ |
{ | ||
"name": "@opentelemetry/api", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Public API for OpenTelemetry", | ||
@@ -15,6 +15,6 @@ "main": "build/src/index.js", | ||
"scripts": { | ||
"build": "npm run compile", | ||
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", | ||
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p .", | ||
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p .", | ||
"precompile": "npm run version", | ||
"compile": "tsc --build tsconfig.json tsconfig.esm.json", | ||
@@ -28,3 +28,5 @@ "docs": "typedoc", | ||
"test": "nyc ts-mocha -p tsconfig.json test/**/*.test.ts", | ||
"cycle-check": "dpdm --exit-code circular:1 src/index.ts", | ||
"version": "node scripts/version-update.js", | ||
"prewatch": "npm run version", | ||
"watch": "tsc --build --watch" | ||
@@ -67,2 +69,3 @@ }, | ||
"codecov": "3.8.2", | ||
"dpdm": "3.7.1", | ||
"eslint": "7.30.0", | ||
@@ -69,0 +72,0 @@ "eslint-plugin-header": "3.1.1", |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
372854
316
6798
30