@opentelemetry/core
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -32,5 +32,5 @@ "use strict"; | ||
const baggage = api_1.propagation.getBaggage(context); | ||
if (!baggage || suppress_tracing_1.isTracingSuppressed(context)) | ||
if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) | ||
return; | ||
const keyPairs = utils_1.getKeyPairs(baggage) | ||
const keyPairs = (0, utils_1.getKeyPairs)(baggage) | ||
.filter((pair) => { | ||
@@ -40,3 +40,3 @@ return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; | ||
.slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); | ||
const headerValue = utils_1.serializeKeyPairs(keyPairs); | ||
const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); | ||
if (headerValue.length > 0) { | ||
@@ -48,11 +48,12 @@ setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); | ||
const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); | ||
if (!headerValue) | ||
const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue; | ||
if (!baggageString) | ||
return context; | ||
const baggage = {}; | ||
if (headerValue.length === 0) { | ||
if (baggageString.length === 0) { | ||
return context; | ||
} | ||
const pairs = headerValue.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); | ||
const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); | ||
pairs.forEach(entry => { | ||
const keyPair = utils_1.parsePairKeyValue(entry); | ||
const keyPair = (0, utils_1.parsePairKeyValue)(entry); | ||
if (keyPair) { | ||
@@ -59,0 +60,0 @@ const baggageEntry = { value: keyPair.value }; |
@@ -29,5 +29,11 @@ "use strict"; | ||
function getKeyPairs(baggage) { | ||
return baggage | ||
.getAllEntries() | ||
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`); | ||
return baggage.getAllEntries().map(([key, value]) => { | ||
let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; | ||
// include opaque metadata if provided | ||
// NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation | ||
if (value.metadata !== undefined) { | ||
entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); | ||
} | ||
return entry; | ||
}); | ||
} | ||
@@ -49,3 +55,3 @@ exports.getKeyPairs = getKeyPairs; | ||
if (valueProps.length > 0) { | ||
metadata = api_1.baggageEntryMetadataFromString(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); | ||
metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); | ||
} | ||
@@ -52,0 +58,0 @@ return { key, value, metadata }; |
@@ -21,3 +21,3 @@ "use strict"; | ||
/** The global error handler delegate */ | ||
let delegateHandler = logging_error_handler_1.loggingErrorHandler(); | ||
let delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)(); | ||
/** | ||
@@ -24,0 +24,0 @@ * Set the global error handler |
@@ -26,3 +26,4 @@ export * from './baggage/propagation/W3CBaggagePropagator'; | ||
export * from './utils/wrap'; | ||
export * from './utils/callback'; | ||
export * from './version'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -54,3 +54,4 @@ "use strict"; | ||
__exportStar(require("./utils/wrap"), exports); | ||
__exportStar(require("./utils/callback"), exports); | ||
__exportStar(require("./version"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -25,3 +25,3 @@ "use strict"; | ||
function getEnv() { | ||
const globalEnv = environment_1.parseEnvironment(globalThis_1._globalThis); | ||
const globalEnv = (0, environment_1.parseEnvironment)(globalThis_1._globalThis); | ||
return Object.assign({}, environment_1.DEFAULT_ENVIRONMENT, globalEnv); | ||
@@ -28,0 +28,0 @@ } |
@@ -25,3 +25,3 @@ "use strict"; | ||
function getEnv() { | ||
const processEnv = environment_1.parseEnvironment(process.env); | ||
const processEnv = (0, environment_1.parseEnvironment)(process.env); | ||
return Object.assign({ | ||
@@ -28,0 +28,0 @@ HOSTNAME: os.hostname(), |
@@ -20,3 +20,3 @@ "use strict"; | ||
const api_1 = require("@opentelemetry/api"); | ||
const RPC_METADATA_KEY = api_1.createContextKey('OpenTelemetry SDK Context Key RPC_METADATA'); | ||
const RPC_METADATA_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key RPC_METADATA'); | ||
var RPCType; | ||
@@ -23,0 +23,0 @@ (function (RPCType) { |
@@ -32,3 +32,3 @@ "use strict"; | ||
if (!this._root) { | ||
global_error_handler_1.globalErrorHandler(new Error('ParentBasedSampler must have a root sampler configured')); | ||
(0, global_error_handler_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); | ||
this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); | ||
@@ -47,3 +47,3 @@ } | ||
const parentContext = api_1.trace.getSpanContext(context); | ||
if (!parentContext || !api_1.isSpanContextValid(parentContext)) { | ||
if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { | ||
return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); | ||
@@ -50,0 +50,0 @@ } |
@@ -29,3 +29,3 @@ "use strict"; | ||
return { | ||
decision: api_1.isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound | ||
decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound | ||
? api_1.SamplingDecision.RECORD_AND_SAMPLED | ||
@@ -32,0 +32,0 @@ : api_1.SamplingDecision.NOT_RECORD, |
@@ -20,3 +20,3 @@ "use strict"; | ||
const api_1 = require("@opentelemetry/api"); | ||
const SUPPRESS_TRACING_KEY = api_1.createContextKey('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); | ||
const SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); | ||
function suppressTracing(context) { | ||
@@ -23,0 +23,0 @@ return context.setValue(SUPPRESS_TRACING_KEY, true); |
@@ -77,3 +77,3 @@ "use strict"; | ||
const value = listMember.slice(i + 1, part.length); | ||
if (validators_1.validateKey(key) && validators_1.validateValue(value)) { | ||
if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) { | ||
agg.set(key, value); | ||
@@ -80,0 +80,0 @@ } |
@@ -66,4 +66,4 @@ "use strict"; | ||
if (!spanContext || | ||
suppress_tracing_1.isTracingSuppressed(context) || | ||
!api_1.isSpanContextValid(spanContext)) | ||
(0, suppress_tracing_1.isTracingSuppressed)(context) || | ||
!(0, api_1.isSpanContextValid)(spanContext)) | ||
return; | ||
@@ -70,0 +70,0 @@ const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; |
@@ -5,3 +5,3 @@ import { DiagLogLevel } from '@opentelemetry/api'; | ||
*/ | ||
declare const ENVIRONMENT_NUMBERS_KEYS: readonly ["OTEL_BSP_EXPORT_TIMEOUT", "OTEL_BSP_MAX_EXPORT_BATCH_SIZE", "OTEL_BSP_MAX_QUEUE_SIZE", "OTEL_BSP_SCHEDULE_DELAY", "OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT", "OTEL_ATTRIBUTE_COUNT_LIMIT", "OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT", "OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT", "OTEL_SPAN_EVENT_COUNT_LIMIT", "OTEL_SPAN_LINK_COUNT_LIMIT"]; | ||
declare const ENVIRONMENT_NUMBERS_KEYS: readonly ["OTEL_BSP_EXPORT_TIMEOUT", "OTEL_BSP_MAX_EXPORT_BATCH_SIZE", "OTEL_BSP_MAX_QUEUE_SIZE", "OTEL_BSP_SCHEDULE_DELAY", "OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT", "OTEL_ATTRIBUTE_COUNT_LIMIT", "OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT", "OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT", "OTEL_SPAN_EVENT_COUNT_LIMIT", "OTEL_SPAN_LINK_COUNT_LIMIT", "OTEL_EXPORTER_JAEGER_AGENT_PORT"]; | ||
declare type ENVIRONMENT_NUMBERS = { | ||
@@ -38,2 +38,5 @@ [K in typeof ENVIRONMENT_NUMBERS_KEYS[number]]?: number; | ||
OTEL_TRACES_SAMPLER?: string; | ||
OTEL_EXPORTER_OTLP_COMPRESSION?: string; | ||
OTEL_EXPORTER_OTLP_TRACES_COMPRESSION?: string; | ||
OTEL_EXPORTER_OTLP_METRICS_COMPRESSION?: string; | ||
} & ENVIRONMENT_NUMBERS & ENVIRONMENT_LISTS; | ||
@@ -40,0 +43,0 @@ export declare type RAW_ENVIRONMENT = { |
@@ -36,2 +36,3 @@ "use strict"; | ||
'OTEL_SPAN_LINK_COUNT_LIMIT', | ||
'OTEL_EXPORTER_JAEGER_AGENT_PORT', | ||
]; | ||
@@ -65,2 +66,3 @@ function isEnvVarANumber(key) { | ||
OTEL_EXPORTER_JAEGER_AGENT_HOST: '', | ||
OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832, | ||
OTEL_EXPORTER_JAEGER_ENDPOINT: '', | ||
@@ -90,2 +92,5 @@ OTEL_EXPORTER_JAEGER_PASSWORD: '', | ||
OTEL_TRACES_SAMPLER_ARG: '', | ||
OTEL_EXPORTER_OTLP_COMPRESSION: '', | ||
OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: '', | ||
OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: '' | ||
}; | ||
@@ -92,0 +97,0 @@ /** |
@@ -154,3 +154,3 @@ "use strict"; | ||
function shouldMerge(one, two) { | ||
if (!lodash_merge_1.isPlainObject(one) || !lodash_merge_1.isPlainObject(two)) { | ||
if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) { | ||
return false; | ||
@@ -157,0 +157,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "1.0.1"; | ||
export declare const VERSION = "1.1.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '1.0.1'; | ||
exports.VERSION = '1.1.0'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/core", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "OpenTelemetry Core provides constants and utilities shared by all OpenTelemetry SDK packages.", | ||
"main": "build/src/index.js", | ||
"module": "build/esm/index.js", | ||
"esnext": "build/esnext/index.js", | ||
"browser": { | ||
"./src/platform/index.ts": "./src/platform/browser/index.ts", | ||
"./build/esm/platform/index.js": "./build/esm/platform/browser/index.js", | ||
"./build/esnext/platform/index.js": "./build/esnext/platform/browser/index.js", | ||
"./build/src/platform/index.js": "./build/src/platform/browser/index.js" | ||
@@ -15,4 +17,4 @@ }, | ||
"scripts": { | ||
"compile": "tsc --build tsconfig.json tsconfig.esm.json", | ||
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json", | ||
"compile": "tsc --build tsconfig.all.json", | ||
"clean": "tsc --build --clean tsconfig.all.json", | ||
"test": "nyc ts-mocha -p tsconfig.json test/**/*.test.ts --exclude 'test/platform/browser/**/*.ts'", | ||
@@ -28,4 +30,4 @@ "test:browser": "nyc karma start --single-run", | ||
"version": "node ../../scripts/version-update.js", | ||
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json", | ||
"precompile": "lerna run version --scope $(npm pkg get name) --include-filtered-dependencies", | ||
"watch": "tsc --build --watch tsconfig.all.json", | ||
"precompile": "lerna run version --scope $(npm pkg get name) --include-dependencies", | ||
"prewatch": "npm run precompile" | ||
@@ -51,2 +53,5 @@ }, | ||
"build/esm/**/*.d.ts", | ||
"build/esnext/**/*.js", | ||
"build/esnext/**/*.js.map", | ||
"build/esnext/**/*.d.ts", | ||
"build/src/**/*.js", | ||
@@ -63,10 +68,10 @@ "build/src/**/*.js.map", | ||
"devDependencies": { | ||
"@opentelemetry/api": "~1.0.3", | ||
"@opentelemetry/api": "~1.1.0", | ||
"@types/mocha": "8.2.3", | ||
"@types/node": "14.17.11", | ||
"@types/sinon": "10.0.2", | ||
"@types/webpack-env": "1.16.2", | ||
"@types/node": "14.17.33", | ||
"@types/sinon": "10.0.6", | ||
"@types/webpack-env": "1.16.3", | ||
"codecov": "3.8.3", | ||
"istanbul-instrumenter-loader": "3.0.1", | ||
"karma": "6.3.7", | ||
"karma": "6.3.16", | ||
"karma-chrome-launcher": "3.1.0", | ||
@@ -84,12 +89,12 @@ "karma-coverage-istanbul-reporter": "3.0.3", | ||
"ts-mocha": "8.0.0", | ||
"typescript": "4.3.5", | ||
"typescript": "4.4.4", | ||
"webpack": "4.46.0" | ||
}, | ||
"peerDependencies": { | ||
"@opentelemetry/api": ">=1.0.0 <1.1.0" | ||
"@opentelemetry/api": ">=1.0.0 <1.2.0" | ||
}, | ||
"dependencies": { | ||
"@opentelemetry/semantic-conventions": "1.0.1" | ||
"@opentelemetry/semantic-conventions": "1.1.0" | ||
}, | ||
"gitHead": "9cf402ee4231ee1446884b5f59958ceafc1b5188" | ||
"gitHead": "f384303ac469914d0dbafde0758ccdae473f336e" | ||
} |
# OpenTelemetry Core | ||
[![NPM Published Version][npm-img]][npm-url] | ||
[![dependencies][dependencies-image]][dependencies-url] | ||
[![devDependencies][devDependencies-image]][devDependencies-url] | ||
[![Apache License][license-image]][license-image] | ||
@@ -15,3 +13,3 @@ | ||
- [Built-in Propagators](#built-in-propagators) | ||
- [W3CTraceContextPropagator Propagator](#httptracecontext-propagator) | ||
- [W3CTraceContextPropagator Propagator](#w3ctracecontextpropagator-propagator) | ||
- [Composite Propagator](#composite-propagator) | ||
@@ -181,7 +179,3 @@ - [Baggage Propagator](#baggage-propagator) | ||
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat | ||
[dependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js.svg?path=packages%2Fopentelemetry-core | ||
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-core | ||
[devDependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js.svg?path=packages%2Fopentelemetry-core&type=dev | ||
[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-core&type=dev | ||
[npm-url]: https://www.npmjs.com/package/@opentelemetry/core | ||
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fcore.svg |
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
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
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
3
273258
144
2973
180
+ Added@opentelemetry/api@1.1.0(transitive)
+ Added@opentelemetry/semantic-conventions@1.1.0(transitive)
- Removed@opentelemetry/api@1.0.4(transitive)
- Removed@opentelemetry/semantic-conventions@1.0.1(transitive)