Socket
Socket
Sign inDemoInstall

@opentelemetry/core

Package Overview
Dependencies
Maintainers
4
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/core - npm Package Compare versions

Comparing version 0.24.1-alpha.31 to 0.25.0

16

build/esm/baggage/utils.d.ts

@@ -1,9 +0,10 @@

import { Baggage } from '@opentelemetry/api';
export declare const serializeKeyPairs: (keyPairs: string[]) => string;
export declare const getKeyPairs: (baggage: Baggage) => string[];
export declare const parsePairKeyValue: (entry: string) => {
import { Baggage, BaggageEntryMetadata } from '@opentelemetry/api';
declare type ParsedBaggageKeyValue = {
key: string;
value: string;
metadata: import("@opentelemetry/api").BaggageEntryMetadata | undefined;
} | undefined;
metadata: BaggageEntryMetadata | undefined;
};
export declare function serializeKeyPairs(keyPairs: string[]): string;
export declare function getKeyPairs(baggage: Baggage): string[];
export declare function parsePairKeyValue(entry: string): ParsedBaggageKeyValue | undefined;
/**

@@ -13,3 +14,4 @@ * Parse a string serialized in the baggage HTTP Format (without metadata):

*/
export declare const parseKeyPairsIntoRecord: (value?: string | undefined) => Record<string, string>;
export declare function parseKeyPairsIntoRecord(value?: string): Record<string, string>;
export {};
//# sourceMappingURL=utils.d.ts.map

@@ -18,3 +18,3 @@ /*

import { BAGGAGE_ITEMS_SEPARATOR, BAGGAGE_PROPERTIES_SEPARATOR, BAGGAGE_KEY_PAIR_SEPARATOR, BAGGAGE_MAX_TOTAL_LENGTH, } from './constants';
export var serializeKeyPairs = function (keyPairs) {
export function serializeKeyPairs(keyPairs) {
return keyPairs.reduce(function (hValue, current) {

@@ -24,4 +24,4 @@ var value = "" + hValue + (hValue !== '' ? BAGGAGE_ITEMS_SEPARATOR : '') + current;

}, '');
};
export var getKeyPairs = function (baggage) {
}
export function getKeyPairs(baggage) {
return baggage

@@ -33,4 +33,4 @@ .getAllEntries()

});
};
export var parsePairKeyValue = function (entry) {
}
export function parsePairKeyValue(entry) {
var valueProps = entry.split(BAGGAGE_PROPERTIES_SEPARATOR);

@@ -52,3 +52,3 @@ if (valueProps.length <= 0)

return { key: key, value: value, metadata: metadata };
};
}
/**

@@ -58,3 +58,3 @@ * Parse a string serialized in the baggage HTTP Format (without metadata):

*/
export var parseKeyPairsIntoRecord = function (value) {
export function parseKeyPairsIntoRecord(value) {
if (typeof value !== 'string' || value.length === 0)

@@ -69,6 +69,7 @@ return {};

.reduce(function (headers, keyPair) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
headers[keyPair.key] = keyPair.value;
return headers;
}, {});
};
}
//# sourceMappingURL=utils.js.map

@@ -6,2 +6,3 @@ export function sanitizeAttributes(attributes) {

}
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
for (var _i = 0, _a = Object.entries(attributes); _i < _a.length; _i++) {

@@ -8,0 +9,0 @@ var _b = _a[_i], k = _b[0], v = _b[1];

@@ -12,3 +12,3 @@ import { Exception } from '@opentelemetry/api';

*/
export declare const globalErrorHandler: (ex: Exception) => void;
export declare function globalErrorHandler(ex: Exception): void;
//# sourceMappingURL=global-error-handler.d.ts.map

@@ -30,3 +30,3 @@ /*

*/
export var globalErrorHandler = function (ex) {
export function globalErrorHandler(ex) {
try {

@@ -36,3 +36,3 @@ delegateHandler(ex);

catch (_a) { } // eslint-disable-line no-empty
};
}
//# sourceMappingURL=global-error-handler.js.map

@@ -21,20 +21,20 @@ import * as api from '@opentelemetry/api';

* Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z"
* @param hrTime
* @param time
*/
export declare function hrTimeToTimeStamp(hrTime: api.HrTime): string;
export declare function hrTimeToTimeStamp(time: api.HrTime): string;
/**
* Convert hrTime to nanoseconds.
* @param hrTime
* @param time
*/
export declare function hrTimeToNanoseconds(hrTime: api.HrTime): number;
export declare function hrTimeToNanoseconds(time: api.HrTime): number;
/**
* Convert hrTime to milliseconds.
* @param hrTime
* @param time
*/
export declare function hrTimeToMilliseconds(hrTime: api.HrTime): number;
export declare function hrTimeToMilliseconds(time: api.HrTime): number;
/**
* Convert hrTime to microseconds.
* @param hrTime
* @param time
*/
export declare function hrTimeToMicroseconds(hrTime: api.HrTime): number;
export declare function hrTimeToMicroseconds(time: api.HrTime): number;
/**

@@ -44,3 +44,3 @@ * check if time is HrTime

*/
export declare function isTimeInputHrTime(value: unknown): boolean;
export declare function isTimeInputHrTime(value: unknown): value is api.HrTime;
/**

@@ -50,3 +50,3 @@ * check if input value is a correct types.TimeInput

*/
export declare function isTimeInput(value: unknown): boolean;
export declare function isTimeInput(value: unknown): value is api.HrTime | number | Date;
//# sourceMappingURL=time.d.ts.map

@@ -101,9 +101,9 @@ /*

* Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z"
* @param hrTime
* @param time
*/
export function hrTimeToTimeStamp(hrTime) {
export function hrTimeToTimeStamp(time) {
var precision = NANOSECOND_DIGITS;
var tmp = "" + '0'.repeat(precision) + hrTime[1] + "Z";
var tmp = "" + '0'.repeat(precision) + time[1] + "Z";
var nanoString = tmp.substr(tmp.length - precision - 1);
var date = new Date(hrTime[0] * 1000).toISOString();
var date = new Date(time[0] * 1000).toISOString();
return date.replace('000Z', nanoString);

@@ -113,20 +113,20 @@ }

* Convert hrTime to nanoseconds.
* @param hrTime
* @param time
*/
export function hrTimeToNanoseconds(hrTime) {
return hrTime[0] * SECOND_TO_NANOSECONDS + hrTime[1];
export function hrTimeToNanoseconds(time) {
return time[0] * SECOND_TO_NANOSECONDS + time[1];
}
/**
* Convert hrTime to milliseconds.
* @param hrTime
* @param time
*/
export function hrTimeToMilliseconds(hrTime) {
return Math.round(hrTime[0] * 1e3 + hrTime[1] / 1e6);
export function hrTimeToMilliseconds(time) {
return Math.round(time[0] * 1e3 + time[1] / 1e6);
}
/**
* Convert hrTime to microseconds.
* @param hrTime
* @param time
*/
export function hrTimeToMicroseconds(hrTime) {
return Math.round(hrTime[0] * 1e6 + hrTime[1] / 1e3);
export function hrTimeToMicroseconds(time) {
return Math.round(time[0] * 1e6 + time[1] / 1e3);
}

@@ -133,0 +133,0 @@ /**

@@ -16,3 +16,3 @@ import { Exception } from '@opentelemetry/api';

*/
export interface ShimWrapped {
export interface ShimWrapped extends Function {
__wrapped: boolean;

@@ -19,0 +19,0 @@ __unwrap: Function;

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

import { ShimWrapped } from '../common/types';
/**

@@ -5,3 +6,3 @@ * Checks if certain function has been already wrapped

*/
export declare function isWrapped(func: any): boolean;
export declare function isWrapped(func: unknown): func is ShimWrapped;
//# sourceMappingURL=wrap.d.ts.map

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

export declare const VERSION = "0.24.0";
export declare const VERSION = "0.25.0";
//# sourceMappingURL=version.d.ts.map

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

// this is autogenerated file, see scripts/version-update.js
export var VERSION = '0.24.0';
export var VERSION = '0.25.0';
//# sourceMappingURL=version.js.map

@@ -1,9 +0,10 @@

import { Baggage } from '@opentelemetry/api';
export declare const serializeKeyPairs: (keyPairs: string[]) => string;
export declare const getKeyPairs: (baggage: Baggage) => string[];
export declare const parsePairKeyValue: (entry: string) => {
import { Baggage, BaggageEntryMetadata } from '@opentelemetry/api';
declare type ParsedBaggageKeyValue = {
key: string;
value: string;
metadata: import("@opentelemetry/api").BaggageEntryMetadata | undefined;
} | undefined;
metadata: BaggageEntryMetadata | undefined;
};
export declare function serializeKeyPairs(keyPairs: string[]): string;
export declare function getKeyPairs(baggage: Baggage): string[];
export declare function parsePairKeyValue(entry: string): ParsedBaggageKeyValue | undefined;
/**

@@ -13,3 +14,4 @@ * Parse a string serialized in the baggage HTTP Format (without metadata):

*/
export declare const parseKeyPairsIntoRecord: (value?: string | undefined) => Record<string, string>;
export declare function parseKeyPairsIntoRecord(value?: string): Record<string, string>;
export {};
//# sourceMappingURL=utils.d.ts.map

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

const constants_1 = require("./constants");
const serializeKeyPairs = (keyPairs) => {
function serializeKeyPairs(keyPairs) {
return keyPairs.reduce((hValue, current) => {

@@ -27,11 +27,11 @@ const value = `${hValue}${hValue !== '' ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ''}${current}`;

}, '');
};
}
exports.serializeKeyPairs = serializeKeyPairs;
const getKeyPairs = (baggage) => {
function getKeyPairs(baggage) {
return baggage
.getAllEntries()
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`);
};
}
exports.getKeyPairs = getKeyPairs;
const parsePairKeyValue = (entry) => {
function parsePairKeyValue(entry) {
const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR);

@@ -53,3 +53,3 @@ if (valueProps.length <= 0)

return { key, value, metadata };
};
}
exports.parsePairKeyValue = parsePairKeyValue;

@@ -60,3 +60,3 @@ /**

*/
const parseKeyPairsIntoRecord = (value) => {
function parseKeyPairsIntoRecord(value) {
if (typeof value !== 'string' || value.length === 0)

@@ -67,11 +67,12 @@ return {};

.map(entry => {
return exports.parsePairKeyValue(entry);
return parsePairKeyValue(entry);
})
.filter(keyPair => keyPair !== undefined && keyPair.value.length > 0)
.reduce((headers, keyPair) => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
headers[keyPair.key] = keyPair.value;
return headers;
}, {});
};
}
exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord;
//# sourceMappingURL=utils.js.map

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

}
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
for (const [k, v] of Object.entries(attributes)) {

@@ -11,0 +12,0 @@ if (isAttributeValue(v)) {

@@ -12,3 +12,3 @@ import { Exception } from '@opentelemetry/api';

*/
export declare const globalErrorHandler: (ex: Exception) => void;
export declare function globalErrorHandler(ex: Exception): void;
//# sourceMappingURL=global-error-handler.d.ts.map

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

*/
const globalErrorHandler = (ex) => {
function globalErrorHandler(ex) {
try {

@@ -40,4 +40,4 @@ delegateHandler(ex);

catch (_a) { } // eslint-disable-line no-empty
};
}
exports.globalErrorHandler = globalErrorHandler;
//# sourceMappingURL=global-error-handler.js.map

@@ -21,20 +21,20 @@ import * as api from '@opentelemetry/api';

* Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z"
* @param hrTime
* @param time
*/
export declare function hrTimeToTimeStamp(hrTime: api.HrTime): string;
export declare function hrTimeToTimeStamp(time: api.HrTime): string;
/**
* Convert hrTime to nanoseconds.
* @param hrTime
* @param time
*/
export declare function hrTimeToNanoseconds(hrTime: api.HrTime): number;
export declare function hrTimeToNanoseconds(time: api.HrTime): number;
/**
* Convert hrTime to milliseconds.
* @param hrTime
* @param time
*/
export declare function hrTimeToMilliseconds(hrTime: api.HrTime): number;
export declare function hrTimeToMilliseconds(time: api.HrTime): number;
/**
* Convert hrTime to microseconds.
* @param hrTime
* @param time
*/
export declare function hrTimeToMicroseconds(hrTime: api.HrTime): number;
export declare function hrTimeToMicroseconds(time: api.HrTime): number;
/**

@@ -44,3 +44,3 @@ * check if time is HrTime

*/
export declare function isTimeInputHrTime(value: unknown): boolean;
export declare function isTimeInputHrTime(value: unknown): value is api.HrTime;
/**

@@ -50,3 +50,3 @@ * check if input value is a correct types.TimeInput

*/
export declare function isTimeInput(value: unknown): boolean;
export declare function isTimeInput(value: unknown): value is api.HrTime | number | Date;
//# sourceMappingURL=time.d.ts.map

@@ -107,9 +107,9 @@ "use strict";

* Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z"
* @param hrTime
* @param time
*/
function hrTimeToTimeStamp(hrTime) {
function hrTimeToTimeStamp(time) {
const precision = NANOSECOND_DIGITS;
const tmp = `${'0'.repeat(precision)}${hrTime[1]}Z`;
const tmp = `${'0'.repeat(precision)}${time[1]}Z`;
const nanoString = tmp.substr(tmp.length - precision - 1);
const date = new Date(hrTime[0] * 1000).toISOString();
const date = new Date(time[0] * 1000).toISOString();
return date.replace('000Z', nanoString);

@@ -120,6 +120,6 @@ }

* Convert hrTime to nanoseconds.
* @param hrTime
* @param time
*/
function hrTimeToNanoseconds(hrTime) {
return hrTime[0] * SECOND_TO_NANOSECONDS + hrTime[1];
function hrTimeToNanoseconds(time) {
return time[0] * SECOND_TO_NANOSECONDS + time[1];
}

@@ -129,6 +129,6 @@ exports.hrTimeToNanoseconds = hrTimeToNanoseconds;

* Convert hrTime to milliseconds.
* @param hrTime
* @param time
*/
function hrTimeToMilliseconds(hrTime) {
return Math.round(hrTime[0] * 1e3 + hrTime[1] / 1e6);
function hrTimeToMilliseconds(time) {
return Math.round(time[0] * 1e3 + time[1] / 1e6);
}

@@ -138,6 +138,6 @@ exports.hrTimeToMilliseconds = hrTimeToMilliseconds;

* Convert hrTime to microseconds.
* @param hrTime
* @param time
*/
function hrTimeToMicroseconds(hrTime) {
return Math.round(hrTime[0] * 1e6 + hrTime[1] / 1e3);
function hrTimeToMicroseconds(time) {
return Math.round(time[0] * 1e6 + time[1] / 1e3);
}

@@ -144,0 +144,0 @@ exports.hrTimeToMicroseconds = hrTimeToMicroseconds;

@@ -16,3 +16,3 @@ import { Exception } from '@opentelemetry/api';

*/
export interface ShimWrapped {
export interface ShimWrapped extends Function {
__wrapped: boolean;

@@ -19,0 +19,0 @@ __unwrap: Function;

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

import { ShimWrapped } from '../common/types';
/**

@@ -5,3 +6,3 @@ * Checks if certain function has been already wrapped

*/
export declare function isWrapped(func: any): boolean;
export declare function isWrapped(func: unknown): func is ShimWrapped;
//# sourceMappingURL=wrap.d.ts.map

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

export declare const VERSION = "0.24.0";
export declare const VERSION = "0.25.0";
//# sourceMappingURL=version.d.ts.map

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

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.24.0';
exports.VERSION = '0.25.0';
//# sourceMappingURL=version.js.map
{
"name": "@opentelemetry/core",
"version": "0.24.1-alpha.31+fd2410cc",
"version": "0.25.0",
"description": "OpenTelemetry Core provides default and no-op implementations of the OpenTelemetry types for trace and metrics",

@@ -58,6 +58,6 @@ "main": "build/src/index.js",

"devDependencies": {
"@opentelemetry/api": "^1.0.1",
"@opentelemetry/api": "^1.0.2",
"@types/mocha": "8.2.3",
"@types/node": "14.17.5",
"@types/semver": "7.3.7",
"@types/node": "14.17.9",
"@types/semver": "7.3.8",
"@types/sinon": "10.0.2",

@@ -83,9 +83,9 @@ "@types/webpack-env": "1.16.2",

"peerDependencies": {
"@opentelemetry/api": "^1.0.1"
"@opentelemetry/api": "^1.0.2"
},
"dependencies": {
"@opentelemetry/semantic-conventions": "^0.24.1-alpha.31+fd2410cc",
"semver": "^7.1.3"
"@opentelemetry/semantic-conventions": "0.25.0",
"semver": "^7.3.5"
},
"gitHead": "fd2410cc9e8d43210b6ea44b8193fa70ee900499"
"gitHead": "0ef1fc28d366b74d98b73b5d6334ffdc75342fe2"
}

@@ -77,3 +77,3 @@ # OpenTelemetry Core

```js
const { NodeTracerProvider } = require("@opentelemetry/node");
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { AlwaysOnSampler } = require("@opentelemetry/core");

@@ -91,3 +91,3 @@

```js
const { NodeTracerProvider } = require("@opentelemetry/node");
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { AlwaysOffSampler } = require("@opentelemetry/core");

@@ -108,3 +108,3 @@

```js
const { NodeTracerProvider } = require("@opentelemetry/node");
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { TraceIdRatioBasedSampler } = require("@opentelemetry/core");

@@ -153,3 +153,3 @@

```js
const { NodeTracerProvider } = require("@opentelemetry/node");
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
const { ParentBasedSampler, AlwaysOffSampler, TraceIdRatioBasedSampler } = require("@opentelemetry/core");

@@ -156,0 +156,0 @@

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

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