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

@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.11.1-alpha.48 to 0.11.1-alpha.53

build/src/context/context.d.ts

6

build/src/common/Exception.d.ts
interface ExceptionWithCode {
code: string;
code: string | number;
name?: string;

@@ -8,3 +8,3 @@ message?: string;

interface ExceptionWithMessage {
code?: string;
code?: string | number;
message: string;

@@ -15,3 +15,3 @@ name?: string;

interface ExceptionWithName {
code?: string;
code?: string | number;
message?: string;

@@ -18,0 +18,0 @@ name: string;

export * from './common/Exception';
export * from './common/Logger';
export * from './common/Time';
export * from './context/context';
export * from './context/propagation/getter';

@@ -24,2 +25,3 @@ export * from './context/propagation/TextMapPropagator';

export * from './trace/link';
export * from './trace/NoopLogger';
export * from './trace/NoopSpan';

@@ -42,4 +44,4 @@ export * from './trace/NoopTracer';

export * from './trace/tracer';
export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/spancontext-utils';
export { Context } from '@opentelemetry/context-base';
export { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils';
export { Context, ROOT_CONTEXT, createContextKey, ContextManager, } from '@opentelemetry/context-base';
import { ContextAPI } from './api/context';

@@ -46,0 +48,0 @@ /** Entrypoint for context API */

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

__exportStar(require("./common/Time"), exports);
__exportStar(require("./context/context"), exports);
__exportStar(require("./context/propagation/getter"), exports);

@@ -53,2 +54,3 @@ __exportStar(require("./context/propagation/TextMapPropagator"), exports);

__exportStar(require("./trace/link"), exports);
__exportStar(require("./trace/NoopLogger"), exports);
__exportStar(require("./trace/NoopSpan"), exports);

@@ -75,4 +77,8 @@ __exportStar(require("./trace/NoopTracer"), exports);

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 context_base_1 = require("@opentelemetry/context-base");
Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return context_base_1.Context; } });
Object.defineProperty(exports, "ROOT_CONTEXT", { enumerable: true, get: function () { return context_base_1.ROOT_CONTEXT; } });
Object.defineProperty(exports, "createContextKey", { enumerable: true, get: function () { return context_base_1.createContextKey; } });
var context_1 = require("./api/context");

@@ -79,0 +85,0 @@ /** Entrypoint for context API */

@@ -35,2 +35,6 @@ import { BoundBaseObserver, BoundCounter, BoundValueRecorder } from './BoundInstrument';

logger?: Logger;
/**
* Boundaries optional for histogram
*/
boundaries?: number[];
}

@@ -37,0 +41,0 @@ export interface BatchMetricOptions extends MetricOptions {

export interface Attributes {
[attributeKey: string]: unknown;
[attributeKey: string]: AttributeValue | undefined;
}
export declare type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
//# sourceMappingURL=attributes.d.ts.map
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=attributes.js.map
import { Span, SpanOptions, Tracer } from '..';
import { Context } from '@opentelemetry/context-base';
/**

@@ -7,3 +8,3 @@ * No-op implementations of {@link Tracer}.

getCurrentSpan(): Span;
startSpan(name: string, options?: SpanOptions): Span;
startSpan(name: string, options?: SpanOptions, context?: Context): Span;
withSpan<T extends (...args: unknown[]) => ReturnType<T>>(span: Span, fn: T): ReturnType<T>;

@@ -10,0 +11,0 @@ bind<T>(target: T, span?: Span): T;

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

var NoopSpan_1 = require("./NoopSpan");
var spancontext_utils_1 = require("./spancontext-utils");
var context_1 = require("../context/context");
/**

@@ -31,4 +33,16 @@ * No-op implementations of {@link Tracer}.

// startSpan starts a noop span.
NoopTracer.prototype.startSpan = function (name, options) {
return NoopSpan_1.NOOP_SPAN;
NoopTracer.prototype.startSpan = function (name, options, context) {
var _a;
var parent = options === null || options === void 0 ? void 0 : options.parent;
var parentFromContext = context && ((_a = context_1.getActiveSpan(context)) === null || _a === void 0 ? void 0 : _a.context());
if (isSpanContext(parent) && spancontext_utils_1.isSpanContextValid(parent)) {
return new NoopSpan_1.NoopSpan(parent);
}
else if (isSpanContext(parentFromContext) &&
spancontext_utils_1.isSpanContextValid(parentFromContext)) {
return new NoopSpan_1.NoopSpan(parentFromContext);
}
else {
return NoopSpan_1.NOOP_SPAN;
}
};

@@ -44,3 +58,9 @@ NoopTracer.prototype.withSpan = function (span, fn) {

exports.NoopTracer = NoopTracer;
function isSpanContext(spanContext) {
return (typeof spanContext === 'object' &&
typeof spanContext['spanId'] === 'string' &&
typeof spanContext['traceId'] === 'string' &&
typeof spanContext['traceFlags'] === 'number');
}
exports.NOOP_TRACER = new NoopTracer();
//# sourceMappingURL=NoopTracer.js.map

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

import { TraceFlags } from './trace_flags';
import { TraceState } from './trace_state';

@@ -33,5 +32,5 @@ /**

*
* SAMPLED = 0x1 and NONE = 0x0;
* see {@link TraceFlags} for valid flag values.
*/
traceFlags: TraceFlags;
traceFlags: number;
/**

@@ -38,0 +37,0 @@ * Tracing-system-specific info to propagate.

import { Exception } from '../common/Exception';
import { Attributes } from './attributes';
import { TimeInput } from '../common/Time';
import { Attributes, AttributeValue } from './attributes';
import { SpanContext } from './span_context';
import { Status } from './status';
import { TimeInput } from '../common/Time';
/**

@@ -34,3 +34,3 @@ * An interface that represents a span. A span represents a single operation

*/
setAttribute(key: string, value: unknown): this;
setAttribute(key: string, value?: AttributeValue): this;
/**

@@ -37,0 +37,0 @@ * Sets attributes to the span.

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

export declare const VERSION = "0.11.1-alpha.48+15174c6";
export declare const VERSION = "0.11.1-alpha.53+00a8ce7f";
//# sourceMappingURL=version.d.ts.map

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

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.11.1-alpha.48+15174c6';
exports.VERSION = '0.11.1-alpha.53+00a8ce7f';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/api",
"version": "0.11.1-alpha.48+15174c6",
"version": "0.11.1-alpha.53+00a8ce7f",
"description": "Public API for OpenTelemetry",

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

"dependencies": {
"@opentelemetry/context-base": "^0.11.1-alpha.48+15174c6"
"@opentelemetry/context-base": "^0.11.0"
},

@@ -61,3 +61,3 @@ "devDependencies": {

"@types/node": "14.0.27",
"@types/sinon": "4.3.1",
"@types/sinon": "9.0.5",
"@types/webpack-env": "1.15.2",

@@ -83,3 +83,3 @@ "codecov": "3.7.2",

},
"gitHead": "15174c6647ab9863dfc1424412fa60f2fddb3351"
"gitHead": "00a8ce7f982ea24bcd4bc398477112894078ab29"
}

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