@opentelemetry/sdk-trace-base
Advanced tools
Comparing version 0.25.1-alpha.13 to 0.25.1-alpha.16
@@ -62,2 +62,3 @@ /* | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
return this._tracers.get(key); | ||
@@ -64,0 +65,0 @@ }; |
@@ -21,5 +21,5 @@ import { Sampler } from '@opentelemetry/api'; | ||
* Based on environment, builds a sampler, complies with specification. | ||
* @param env optional, by default uses getEnv(), but allows passing a value to reuse parsed environment | ||
* @param environment optional, by default uses getEnv(), but allows passing a value to reuse parsed environment | ||
*/ | ||
export declare function buildSamplerFromEnv(env?: Required<ENVIRONMENT>): Sampler; | ||
export declare function buildSamplerFromEnv(environment?: Required<ENVIRONMENT>): Sampler; | ||
//# sourceMappingURL=config.d.ts.map |
@@ -39,7 +39,7 @@ /* | ||
* Based on environment, builds a sampler, complies with specification. | ||
* @param env optional, by default uses getEnv(), but allows passing a value to reuse parsed environment | ||
* @param environment optional, by default uses getEnv(), but allows passing a value to reuse parsed environment | ||
*/ | ||
export function buildSamplerFromEnv(env) { | ||
if (env === void 0) { env = getEnv(); } | ||
switch (env.OTEL_TRACES_SAMPLER) { | ||
export function buildSamplerFromEnv(environment) { | ||
if (environment === void 0) { environment = getEnv(); } | ||
switch (environment.OTEL_TRACES_SAMPLER) { | ||
case TracesSamplerValues.AlwaysOn: | ||
@@ -58,25 +58,25 @@ return new AlwaysOnSampler(); | ||
case TracesSamplerValues.TraceIdRatio: | ||
return new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(env)); | ||
return new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)); | ||
case TracesSamplerValues.ParentBasedTraceIdRatio: | ||
return new ParentBasedSampler({ | ||
root: new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(env)), | ||
root: new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)), | ||
}); | ||
default: | ||
diag.error("OTEL_TRACES_SAMPLER value \"" + env.OTEL_TRACES_SAMPLER + " invalid, defaulting to " + FALLBACK_OTEL_TRACES_SAMPLER + "\"."); | ||
diag.error("OTEL_TRACES_SAMPLER value \"" + environment.OTEL_TRACES_SAMPLER + " invalid, defaulting to " + FALLBACK_OTEL_TRACES_SAMPLER + "\"."); | ||
return new AlwaysOnSampler(); | ||
} | ||
} | ||
function getSamplerProbabilityFromEnv(env) { | ||
if (env.OTEL_TRACES_SAMPLER_ARG === undefined || | ||
env.OTEL_TRACES_SAMPLER_ARG === '') { | ||
function getSamplerProbabilityFromEnv(environment) { | ||
if (environment.OTEL_TRACES_SAMPLER_ARG === undefined || | ||
environment.OTEL_TRACES_SAMPLER_ARG === '') { | ||
diag.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to " + DEFAULT_RATIO + "."); | ||
return DEFAULT_RATIO; | ||
} | ||
var probability = Number(env.OTEL_TRACES_SAMPLER_ARG); | ||
var probability = Number(environment.OTEL_TRACES_SAMPLER_ARG); | ||
if (isNaN(probability)) { | ||
diag.error("OTEL_TRACES_SAMPLER_ARG=" + env.OTEL_TRACES_SAMPLER_ARG + " was given, but it is invalid, defaulting to " + DEFAULT_RATIO + "."); | ||
diag.error("OTEL_TRACES_SAMPLER_ARG=" + environment.OTEL_TRACES_SAMPLER_ARG + " was given, but it is invalid, defaulting to " + DEFAULT_RATIO + "."); | ||
return DEFAULT_RATIO; | ||
} | ||
if (probability < 0 || probability > 1) { | ||
diag.error("OTEL_TRACES_SAMPLER_ARG=" + env.OTEL_TRACES_SAMPLER_ARG + " was given, but it is out of range ([0..1]), defaulting to " + DEFAULT_RATIO + "."); | ||
diag.error("OTEL_TRACES_SAMPLER_ARG=" + environment.OTEL_TRACES_SAMPLER_ARG + " was given, but it is out of range ([0..1]), defaulting to " + DEFAULT_RATIO + "."); | ||
return DEFAULT_RATIO; | ||
@@ -83,0 +83,0 @@ } |
@@ -6,2 +6,3 @@ import * as api from '@opentelemetry/api'; | ||
import { SpanLimits, TracerConfig } from './types'; | ||
import { SpanProcessor } from './SpanProcessor'; | ||
/** | ||
@@ -74,4 +75,4 @@ * This class represents a basic tracer. | ||
getSpanLimits(): SpanLimits; | ||
getActiveSpanProcessor(): import("./SpanProcessor").SpanProcessor; | ||
getActiveSpanProcessor(): SpanProcessor; | ||
} | ||
//# sourceMappingURL=Tracer.d.ts.map |
@@ -1,2 +0,3 @@ | ||
import { TracerConfig } from './types'; | ||
import { Sampler } from '@opentelemetry/api'; | ||
import { SpanLimits, TracerConfig } from './types'; | ||
/** | ||
@@ -6,12 +7,6 @@ * Function to merge Default configuration (as specified in './config') with | ||
*/ | ||
export declare function mergeConfig(userConfig: TracerConfig): { | ||
sampler: import("@opentelemetry/api").Sampler; | ||
forceFlushTimeoutMillis: number; | ||
spanLimits: { | ||
attributeValueLengthLimit: number; | ||
attributeCountLimit: number; | ||
linkCountLimit: number; | ||
eventCountLimit: number; | ||
}; | ||
} & Partial<TracerConfig> & TracerConfig; | ||
export declare function mergeConfig(userConfig: TracerConfig): TracerConfig & { | ||
sampler: Sampler; | ||
spanLimits: SpanLimits; | ||
}; | ||
//# sourceMappingURL=utility.d.ts.map |
@@ -64,2 +64,3 @@ "use strict"; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
return this._tracers.get(key); | ||
@@ -66,0 +67,0 @@ } |
@@ -21,5 +21,5 @@ import { Sampler } from '@opentelemetry/api'; | ||
* Based on environment, builds a sampler, complies with specification. | ||
* @param env optional, by default uses getEnv(), but allows passing a value to reuse parsed environment | ||
* @param environment optional, by default uses getEnv(), but allows passing a value to reuse parsed environment | ||
*/ | ||
export declare function buildSamplerFromEnv(env?: Required<ENVIRONMENT>): Sampler; | ||
export declare function buildSamplerFromEnv(environment?: Required<ENVIRONMENT>): Sampler; | ||
//# sourceMappingURL=config.d.ts.map |
@@ -42,6 +42,6 @@ "use strict"; | ||
* Based on environment, builds a sampler, complies with specification. | ||
* @param env optional, by default uses getEnv(), but allows passing a value to reuse parsed environment | ||
* @param environment optional, by default uses getEnv(), but allows passing a value to reuse parsed environment | ||
*/ | ||
function buildSamplerFromEnv(env = core_1.getEnv()) { | ||
switch (env.OTEL_TRACES_SAMPLER) { | ||
function buildSamplerFromEnv(environment = core_1.getEnv()) { | ||
switch (environment.OTEL_TRACES_SAMPLER) { | ||
case core_1.TracesSamplerValues.AlwaysOn: | ||
@@ -60,9 +60,9 @@ return new core_1.AlwaysOnSampler(); | ||
case core_1.TracesSamplerValues.TraceIdRatio: | ||
return new core_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(env)); | ||
return new core_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)); | ||
case core_1.TracesSamplerValues.ParentBasedTraceIdRatio: | ||
return new core_1.ParentBasedSampler({ | ||
root: new core_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(env)), | ||
root: new core_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)), | ||
}); | ||
default: | ||
api_1.diag.error(`OTEL_TRACES_SAMPLER value "${env.OTEL_TRACES_SAMPLER} invalid, defaulting to ${FALLBACK_OTEL_TRACES_SAMPLER}".`); | ||
api_1.diag.error(`OTEL_TRACES_SAMPLER value "${environment.OTEL_TRACES_SAMPLER} invalid, defaulting to ${FALLBACK_OTEL_TRACES_SAMPLER}".`); | ||
return new core_1.AlwaysOnSampler(); | ||
@@ -72,15 +72,15 @@ } | ||
exports.buildSamplerFromEnv = buildSamplerFromEnv; | ||
function getSamplerProbabilityFromEnv(env) { | ||
if (env.OTEL_TRACES_SAMPLER_ARG === undefined || | ||
env.OTEL_TRACES_SAMPLER_ARG === '') { | ||
function getSamplerProbabilityFromEnv(environment) { | ||
if (environment.OTEL_TRACES_SAMPLER_ARG === undefined || | ||
environment.OTEL_TRACES_SAMPLER_ARG === '') { | ||
api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); | ||
return DEFAULT_RATIO; | ||
} | ||
const probability = Number(env.OTEL_TRACES_SAMPLER_ARG); | ||
const probability = Number(environment.OTEL_TRACES_SAMPLER_ARG); | ||
if (isNaN(probability)) { | ||
api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${env.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${DEFAULT_RATIO}.`); | ||
api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${DEFAULT_RATIO}.`); | ||
return DEFAULT_RATIO; | ||
} | ||
if (probability < 0 || probability > 1) { | ||
api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${env.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); | ||
api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); | ||
return DEFAULT_RATIO; | ||
@@ -87,0 +87,0 @@ } |
@@ -6,2 +6,3 @@ import * as api from '@opentelemetry/api'; | ||
import { SpanLimits, TracerConfig } from './types'; | ||
import { SpanProcessor } from './SpanProcessor'; | ||
/** | ||
@@ -74,4 +75,4 @@ * This class represents a basic tracer. | ||
getSpanLimits(): SpanLimits; | ||
getActiveSpanProcessor(): import("./SpanProcessor").SpanProcessor; | ||
getActiveSpanProcessor(): SpanProcessor; | ||
} | ||
//# sourceMappingURL=Tracer.d.ts.map |
@@ -1,2 +0,3 @@ | ||
import { TracerConfig } from './types'; | ||
import { Sampler } from '@opentelemetry/api'; | ||
import { SpanLimits, TracerConfig } from './types'; | ||
/** | ||
@@ -6,12 +7,6 @@ * Function to merge Default configuration (as specified in './config') with | ||
*/ | ||
export declare function mergeConfig(userConfig: TracerConfig): { | ||
sampler: import("@opentelemetry/api").Sampler; | ||
forceFlushTimeoutMillis: number; | ||
spanLimits: { | ||
attributeValueLengthLimit: number; | ||
attributeCountLimit: number; | ||
linkCountLimit: number; | ||
eventCountLimit: number; | ||
}; | ||
} & Partial<TracerConfig> & TracerConfig; | ||
export declare function mergeConfig(userConfig: TracerConfig): TracerConfig & { | ||
sampler: Sampler; | ||
spanLimits: SpanLimits; | ||
}; | ||
//# sourceMappingURL=utility.d.ts.map |
{ | ||
"name": "@opentelemetry/sdk-trace-base", | ||
"version": "0.25.1-alpha.13+f0caa22f", | ||
"version": "0.25.1-alpha.16+63f67010", | ||
"description": "OpenTelemetry Tracing", | ||
@@ -85,8 +85,8 @@ "main": "build/src/index.js", | ||
"dependencies": { | ||
"@opentelemetry/core": "^0.25.1-alpha.13+f0caa22f", | ||
"@opentelemetry/resources": "^0.25.1-alpha.13+f0caa22f", | ||
"@opentelemetry/semantic-conventions": "^0.25.1-alpha.13+f0caa22f", | ||
"@opentelemetry/core": "^0.25.0", | ||
"@opentelemetry/resources": "^0.25.0", | ||
"@opentelemetry/semantic-conventions": "^0.25.0", | ||
"lodash.merge": "^4.6.2" | ||
}, | ||
"gitHead": "f0caa22ffcb26af2a2f05260f138a494e120a955" | ||
"gitHead": "63f6701081e3e4a7eb964bb82cbd8cbc2eaad347" | ||
} |
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
239036
3960
+ Added@opentelemetry/core@0.25.0(transitive)
+ Added@opentelemetry/resources@0.25.0(transitive)
- Removed@opentelemetry/core@0.25.1-alpha.23(transitive)
- Removed@opentelemetry/resources@0.25.1-alpha.23(transitive)
- Removed@opentelemetry/semantic-conventions@0.25.1-alpha.21(transitive)
Updated@opentelemetry/core@^0.25.0