🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@opentelemetry/configuration

Package Overview
Dependencies
Maintainers
6
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/configuration - npm Package Compare versions

Comparing version
0.218.0
to
0.219.0
+23
-26
build/src/EnvironmentConfigFactory.js

@@ -74,3 +74,8 @@ "use strict";

const resourceAttrList = (0, core_1.getStringFromEnv)('OTEL_RESOURCE_ATTRIBUTES');
const list = (0, core_1.getStringListFromEnv)('OTEL_RESOURCE_ATTRIBUTES');
const list = resourceAttrList
? resourceAttrList
.split(',')
.map(s => s.trim())
.filter(s => s)
: [];
const serviceName = (0, core_1.getStringFromEnv)('OTEL_SERVICE_NAME');

@@ -86,3 +91,3 @@ if (serviceName) {

}
if (list && list.length > 0) {
if (list.length > 0) {
config.resource.attributes_list = resourceAttrList;

@@ -155,19 +160,15 @@ if (config.resource.attributes == null) {

}
const composite = (0, core_1.getStringListFromEnv)('OTEL_PROPAGATORS');
if (composite && composite.length > 0) {
config.propagator.composite = [];
for (const name of composite) {
if (name === 'tracecontext') {
config.propagator.composite.push({ tracecontext: {} });
}
else if (name === 'baggage') {
config.propagator.composite.push({ baggage: {} });
}
else if (name === 'b3') {
config.propagator.composite.push({ b3: {} });
}
else if (name === 'b3multi') {
config.propagator.composite.push({ b3multi: {} });
}
else {
const compositeList = (0, core_1.getStringFromEnv)('OTEL_PROPAGATORS');
if (compositeList) {
config.propagator.composite_list = compositeList;
const names = compositeList
.split(',')
.map(s => s.trim())
.filter(s => s);
if (names.length > 0) {
config.propagator.composite = [];
// Store each propagator name as a type-discriminator key. The config
// model doesn't validate names here — known vs third-party propagators
// are resolved when the SDK instantiates from the model.
for (const name of names) {
config.propagator.composite.push({ [name]: {} });

@@ -177,6 +178,2 @@ }

}
const compositeList = (0, core_1.getStringFromEnv)('OTEL_PROPAGATORS');
if (compositeList) {
config.propagator.composite_list = compositeList;
}
}

@@ -230,3 +227,3 @@ exports.setPropagators = setPropagators;

if (exportersType.includes('none')) {
api_1.diag.info(`OTEL_TRACES_EXPORTER contains "none". Tracer provider will not be initialized.`);
api_1.diag.info('OTEL_TRACES_EXPORTER contains "none". Tracer provider will not be initialized.');
return;

@@ -344,3 +341,3 @@ }

if (exportersType.includes('none')) {
api_1.diag.info(`OTEL_METRICS_EXPORTER contains "none". Meter provider will not be initialized.`);
api_1.diag.info('OTEL_METRICS_EXPORTER contains "none". Meter provider will not be initialized.');
return;

@@ -458,3 +455,3 @@ }

if (exportersType.includes('none')) {
api_1.diag.info(`OTEL_LOGS_EXPORTER contains "none". Logger provider will not be initialized.`);
api_1.diag.info('OTEL_LOGS_EXPORTER contains "none". Logger provider will not be initialized.');
return;

@@ -461,0 +458,0 @@ }

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

{"version":3,"file":"EnvironmentConfigFactory.js","sourceRoot":"","sources":["../../src/EnvironmentConfigFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,8CAI6B;AAiB7B,4CAA0C;AAC1C,mCAOiB;AAEjB,2CAA6C;AAC7C,mDAA8C;AAQ9C;;GAEG;AACH,MAAa,wBAAwB;IAC3B,OAAO,CAAqB;IAEpC;QACE,IAAI,CAAC,OAAO,GAAG,IAAA,sCAA8B,GAAE,CAAC;QAChD,MAAM,SAAS,GAAG,IAAA,0BAAc,GAAE,CAAC;QACnC,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,iBAAiB,CAAC;QAEpD,MAAM,cAAc,GAAG,IAAA,uBAAgB,EAAC,gBAAgB,CAAC,CAAC;QAC1D,IAAI,cAAc,EAAE;YAClB,IAAI,CAAC,OAAO,CAAC,SAAS;gBACpB,sCAAsC,CAAC,cAAc,CAAC,CAAC;SAC1D;QAED,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3B,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,cAAc,CAAC,I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AAC;oBAC/D,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,QAAQ,EAAE,CAAC;iBAC5C,CAAC;gBACF,SAAS,CAAC,QAAQ,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;aAC9C;YACD,MAAM,SAAS,GAAuB,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;YAC3D,MAAM,CAAC,eAAe,CAAC,UAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACpD;KACF;AACH,CAAC;AA7HD,8CA6HC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n getStringFromEnv,\n getStringListFromEnv,\n getNumberFromEnv,\n} from '@opentelemetry/core';\nimport type { ConfigFactory } from './IConfigFactory';\nimport type {\n ExemplarFilter,\n BatchLogRecordProcessor,\n BatchSpanProcessor,\n ConfigurationModel,\n ExporterDefaultHistogramAggregation,\n ExporterTemporalityPreference,\n LogRecordExporter,\n LogRecordProcessor,\n PeriodicMetricReader,\n PushMetricExporter,\n SeverityNumber,\n SpanExporter,\n SpanProcessor,\n} from './generated/types';\nimport { diag } from '@opentelemetry/api';\nimport {\n getGrpcTlsConfig,\n getHttpTlsConfig,\n initializeDefaultConfiguration,\n initializeDefaultTracerProviderConfiguration,\n initializeDefaultMeterProviderConfiguration,\n initializeDefaultLoggerProviderConfiguration,\n} from './utils';\nimport type { EnvValues } from './EnvReader';\nimport { readAllEnvVars } from './EnvReader';\nimport { SamplerType } from './EnvDefinition';\n\ntype ExperimentalResourceDetector = NonNullable<\n NonNullable<\n NonNullable<ConfigurationModel['resource']>['detection/development']\n >['detectors']\n>[number];\n\n/**\n * EnvironmentConfigProvider provides a configuration based on environment variables.\n */\nexport class EnvironmentConfigFactory implements ConfigFactory {\n private _config: ConfigurationModel;\n\n constructor() {\n this._config = initializeDefaultConfiguration();\n const envValues = readAllEnvVars();\n this._config.disabled = envValues.OTEL_SDK_DISABLED;\n\n const logLevelString = getStringFromEnv('OTEL_LOG_LEVEL');\n if (logLevelString) {\n this._config.log_level =\n severityNumberConfigFromLogLevelString(logLevelString);\n }\n\n setResources(this._config);\n setAttributeLimits(this._config);\n setPropagators(this._config);\n setTracerProvider(this._config, envValues);\n setMeterProvider(this._config);\n setLoggerProvider(this._config);\n }\n\n getConfigModel(): ConfigurationModel {\n return this._config;\n }\n}\n\nconst SEV_NUM_CONFIG_FROM_LOG_LEVEL: { [key: string]: SeverityNumber } = {\n // Declarative config `log_level` has no \"NONE\". Using 'fatal' is\n // equivalent, because the OTel JS diag API does not have a \"fatal\" level.\n NONE: 'fatal',\n ERROR: 'error',\n WARN: 'warn',\n INFO: 'info',\n DEBUG: 'debug',\n VERBOSE: 'trace2',\n // Declarative config `log_level` has no \"ALL\". Using 'trace' is\n // equivalent, because that is the lowest SeverityNumber level.\n ALL: 'trace',\n};\n\n/**\n * Return a declarative config SeverityNumberConfig value (as used for\n * `log_level`) for the given `OTEL_LOG_LEVEL` string value.\n *\n * See notes at \"opentelemetr-sdk-node/src/diag.ts\".\n */\nfunction severityNumberConfigFromLogLevelString(\n str?: string\n): SeverityNumber | undefined {\n if (!str) {\n return undefined;\n }\n const sevNumConfig = SEV_NUM_CONFIG_FROM_LOG_LEVEL[str.toUpperCase()];\n if (!sevNumConfig) {\n diag.warn(\n `Unknown log level \"${str}\", expected one of ${Object.keys(SEV_NUM_CONFIG_FROM_LOG_LEVEL)}, using default info`\n );\n return 'info';\n }\n return sevNumConfig;\n}\n\nexport function setResources(config: ConfigurationModel): void {\n if (config.resource == null) {\n config.resource = {};\n }\n\n const resourceAttrList = getStringFromEnv('OTEL_RESOURCE_ATTRIBUTES');\n const list = getStringListFromEnv('OTEL_RESOURCE_ATTRIBUTES');\n const serviceName = getStringFromEnv('OTEL_SERVICE_NAME');\n\n if (serviceName) {\n config.resource.attributes = [\n {\n name: 'service.name',\n value: serviceName,\n type: 'string',\n },\n ];\n }\n if (list && list.length > 0) {\n config.resource.attributes_list = resourceAttrList;\n if (config.resource.attributes == null) {\n config.resource.attributes = [];\n }\n\n for (let i = 0; i < list.length; i++) {\n const element = list[i].split('=');\n if (\n element[0] !== 'service.name' ||\n (element[0] === 'service.name' && serviceName === undefined)\n ) {\n config.resource.attributes.push({\n name: element[0],\n value: element[1],\n type: 'string',\n });\n }\n }\n }\n\n const nodeDetectors = getStringListFromEnv('OTEL_NODE_RESOURCE_DETECTORS');\n if (\n nodeDetectors &&\n nodeDetectors.length > 0 &&\n !nodeDetectors.includes('none')\n ) {\n const all = nodeDetectors.includes('all');\n const detectors: ExperimentalResourceDetector[] = [];\n if (all || nodeDetectors.includes('container'))\n detectors.push({ container: {} });\n if (all || nodeDetectors.includes('host')) detectors.push({ host: {} });\n if (all || nodeDetectors.includes('os')) detectors.push({ os: {} });\n if (all || nodeDetectors.includes('process'))\n detectors.push({ process: {} });\n if (all || nodeDetectors.includes('serviceinstance'))\n detectors.push({ service: {} });\n if (all || nodeDetectors.includes('env')) detectors.push({ env: {} });\n if (detectors.length > 0) {\n if (config.resource['detection/development'] == null) {\n config.resource['detection/development'] = {};\n }\n config.resource['detection/development'].detectors = detectors;\n }\n }\n}\n\nexport function setAttributeLimits(config: ConfigurationModel): void {\n const attributeValueLengthLimit = getNumberFromEnv(\n 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT'\n );\n if (attributeValueLengthLimit && attributeValueLengthLimit > 0) {\n if (config.attribute_limits == null) {\n config.attribute_limits = { attribute_count_limit: 128 };\n }\n config.attribute_limits.attribute_value_length_limit =\n attributeValueLengthLimit;\n }\n\n const attributeCountLimit = getNumberFromEnv('OTEL_ATTRIBUTE_COUNT_LIMIT');\n if (attributeCountLimit) {\n if (config.attribute_limits == null) {\n config.attribute_limits = { attribute_count_limit: attributeCountLimit };\n } else {\n config.attribute_limits.attribute_count_limit = attributeCountLimit;\n }\n }\n}\n\nexport function setPropagators(config: ConfigurationModel): void {\n if (config.propagator == null) {\n config.propagator = {};\n }\n const composite = getStringListFromEnv('OTEL_PROPAGATORS');\n if (composite && composite.length > 0) {\n config.propagator.composite = [];\n for (const name of composite) {\n if (name === 'tracecontext') {\n config.propagator.composite.push({ tracecontext: {} });\n } else if (name === 'baggage') {\n config.propagator.composite.push({ baggage: {} });\n } else if (name === 'b3') {\n config.propagator.composite.push({ b3: {} });\n } else if (name === 'b3multi') {\n config.propagator.composite.push({ b3multi: {} });\n } else {\n config.propagator.composite.push({ [name]: {} });\n }\n }\n }\n const compositeList = getStringFromEnv('OTEL_PROPAGATORS');\n if (compositeList) {\n config.propagator.composite_list = compositeList;\n }\n}\n\nexport function setSampler(config: ConfigurationModel, env: EnvValues): void {\n const sampler = env.OTEL_TRACES_SAMPLER;\n const arg = env.OTEL_TRACES_SAMPLER_ARG;\n\n if (!sampler || !config.tracer_provider) {\n return;\n }\n\n const ratio = arg ? parseFloat(arg) : 1.0;\n\n switch (sampler) {\n case SamplerType.AlwaysOn:\n config.tracer_provider.sampler = { always_on: {} };\n break;\n\n case SamplerType.AlwaysOff:\n config.tracer_provider.sampler = { always_off: {} };\n break;\n\n case SamplerType.TraceIdRatio:\n config.tracer_provider.sampler = {\n trace_id_ratio_based: { ratio },\n };\n break;\n\n case SamplerType.ParentBasedAlwaysOn:\n config.tracer_provider.sampler = {\n parent_based: { root: { always_on: {} } },\n };\n break;\n\n case SamplerType.ParentBasedAlwaysOff:\n config.tracer_provider.sampler = {\n parent_based: { root: { always_off: {} } },\n };\n break;\n\n case SamplerType.ParentBasedTraceIdRatio:\n config.tracer_provider.sampler = {\n parent_based: { root: { trace_id_ratio_based: { ratio } } },\n };\n break;\n\n default:\n // readEnvVar already warns for invalid values via allowedValues\n break;\n }\n}\n\nexport function setTracerProvider(\n config: ConfigurationModel,\n env: EnvValues\n): void {\n const exportersType = Array.from(\n new Set(getStringListFromEnv('OTEL_TRACES_EXPORTER'))\n );\n if (exportersType.length === 0) {\n return;\n }\n if (exportersType.includes('none')) {\n diag.info(\n `OTEL_TRACES_EXPORTER contains \"none\". Tracer provider will not be initialized.`\n );\n return;\n }\n config.tracer_provider = initializeDefaultTracerProviderConfiguration();\n setSampler(config, env);\n\n const attributeValueLengthLimit = getNumberFromEnv(\n 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT'\n );\n if (attributeValueLengthLimit) {\n config.tracer_provider.limits!.attribute_value_length_limit =\n attributeValueLengthLimit;\n }\n\n const attributeCountLimit = getNumberFromEnv(\n 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT'\n );\n if (attributeCountLimit) {\n config.tracer_provider.limits!.attribute_count_limit = attributeCountLimit;\n }\n\n const eventCountLimit = getNumberFromEnv('OTEL_SPAN_EVENT_COUNT_LIMIT');\n if (eventCountLimit) {\n config.tracer_provider.limits!.event_count_limit = eventCountLimit;\n }\n\n const linkCountLimit = getNumberFromEnv('OTEL_SPAN_LINK_COUNT_LIMIT');\n if (linkCountLimit) {\n config.tracer_provider.limits!.link_count_limit = linkCountLimit;\n }\n\n const eventAttributeCountLimit = getNumberFromEnv(\n 'OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT'\n );\n if (eventAttributeCountLimit) {\n config.tracer_provider.limits!.event_attribute_count_limit =\n eventAttributeCountLimit;\n }\n\n const linkAttributeCountLimit = getNumberFromEnv(\n 'OTEL_LINK_ATTRIBUTE_COUNT_LIMIT'\n );\n if (linkAttributeCountLimit) {\n config.tracer_provider.limits!.link_attribute_count_limit =\n linkAttributeCountLimit;\n }\n\n const batch: BatchSpanProcessor = {\n exporter: {},\n schedule_delay: getNumberFromEnv('OTEL_BSP_SCHEDULE_DELAY') ?? 5000,\n export_timeout: getNumberFromEnv('OTEL_BSP_EXPORT_TIMEOUT') ?? 30000,\n max_queue_size: getNumberFromEnv('OTEL_BSP_MAX_QUEUE_SIZE') ?? 2048,\n max_export_batch_size:\n getNumberFromEnv('OTEL_BSP_MAX_EXPORT_BATCH_SIZE') ?? 512,\n };\n\n for (let i = 0; i < exportersType.length; i++) {\n const exporterType = exportersType[i];\n const batchInfo: BatchSpanProcessor = {\n ...batch,\n exporter: {},\n };\n if (exporterType === 'console') {\n const processor: SpanProcessor = {\n simple: { exporter: { console: {} } },\n };\n config.tracer_provider.processors!.push(processor);\n } else {\n const protocol =\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_PROTOCOL') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_PROTOCOL') ??\n 'http/protobuf';\n const certificateFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CERTIFICATE');\n const clientKeyFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CLIENT_KEY');\n const clientCertificateFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE');\n const compression =\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_COMPRESSION') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_COMPRESSION');\n const timeout =\n getNumberFromEnv('OTEL_EXPORTER_OTLP_TRACES_TIMEOUT') ??\n getNumberFromEnv('OTEL_EXPORTER_OTLP_TIMEOUT') ??\n 10000;\n const headersList =\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_HEADERS') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_HEADERS');\n\n if (protocol === 'grpc') {\n const tls = getGrpcTlsConfig(\n certificateFile,\n clientKeyFile,\n clientCertificateFile\n );\n const otlpGrpc: NonNullable<SpanExporter['otlp_grpc']> = {\n endpoint:\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT') ??\n 'http://localhost:4317',\n timeout,\n ...(tls !== undefined && { tls }),\n ...(compression !== undefined && { compression }),\n ...(headersList !== undefined && { headers_list: headersList }),\n };\n batchInfo.exporter = { otlp_grpc: otlpGrpc };\n } else {\n const tls = getHttpTlsConfig(\n certificateFile,\n clientKeyFile,\n clientCertificateFile\n );\n const encoding =\n protocol === 'http/json'\n ? 'json'\n : protocol === 'http/protobuf'\n ? 'protobuf'\n : undefined;\n const otlpHttp: NonNullable<SpanExporter['otlp_http']> = {\n endpoint:\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT') ??\n (getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT')\n ? `${getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT')}/v1/traces`\n : 'http://localhost:4318/v1/traces'),\n timeout,\n ...(tls !== undefined && { tls }),\n ...(compression !== undefined && { compression }),\n ...(headersList !== undefined && { headers_list: headersList }),\n ...(encoding !== undefined && { encoding }),\n };\n batchInfo.exporter = { otlp_http: otlpHttp };\n }\n\n const processor: SpanProcessor = { batch: batchInfo };\n config.tracer_provider.processors!.push(processor);\n }\n }\n}\n\nexport function setMeterProvider(config: ConfigurationModel): void {\n const exportersType = Array.from(\n new Set(getStringListFromEnv('OTEL_METRICS_EXPORTER'))\n );\n if (exportersType.length === 0) {\n return;\n }\n if (exportersType.includes('none')) {\n diag.info(\n `OTEL_METRICS_EXPORTER contains \"none\". Meter provider will not be initialized.`\n );\n return;\n }\n config.meter_provider = initializeDefaultMeterProviderConfiguration();\n\n const interval = getNumberFromEnv('OTEL_METRIC_EXPORT_INTERVAL') ?? 60000;\n for (let i = 0; i < exportersType.length; i++) {\n const exporterType = exportersType[i];\n if (exporterType === 'prometheus') {\n const pullReader = {\n exporter: {\n 'prometheus/development': {\n host:\n getStringFromEnv('OTEL_EXPORTER_PROMETHEUS_HOST') ?? 'localhost',\n port: getNumberFromEnv('OTEL_EXPORTER_PROMETHEUS_PORT') ?? 9464,\n without_scope_info: false,\n 'without_target_info/development': false,\n },\n },\n };\n config.meter_provider.readers!.push({ pull: pullReader });\n continue;\n }\n\n const readerPeriodicInfo: PeriodicMetricReader = {\n interval,\n timeout: getNumberFromEnv('OTEL_METRIC_EXPORT_TIMEOUT') ?? 30000,\n exporter: {},\n };\n\n if (exporterType === 'console') {\n readerPeriodicInfo.exporter = { console: {} };\n } else {\n const protocol =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_PROTOCOL') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_PROTOCOL') ??\n 'http/protobuf';\n const certificateFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CERTIFICATE');\n const clientKeyFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CLIENT_KEY');\n const clientCertificateFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE');\n const compression =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_COMPRESSION') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_COMPRESSION');\n const timeoutExporter =\n getNumberFromEnv('OTEL_EXPORTER_OTLP_METRICS_TIMEOUT') ??\n getNumberFromEnv('OTEL_EXPORTER_OTLP_TIMEOUT') ??\n 10000;\n const headersList =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_HEADERS') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_HEADERS');\n const rawTemporality =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE') ??\n 'cumulative';\n const validTemporalities = ['cumulative', 'delta', 'low_memory'];\n const temporalityPreference = validTemporalities.includes(rawTemporality)\n ? rawTemporality\n : 'cumulative';\n const rawHistogramAgg =\n getStringFromEnv(\n 'OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION'\n ) ?? 'explicit_bucket_histogram';\n const validHistogramAggs = [\n 'explicit_bucket_histogram',\n 'base2_exponential_bucket_histogram',\n ];\n const defaultHistogramAggregation = validHistogramAggs.includes(\n rawHistogramAgg\n )\n ? rawHistogramAgg\n : 'explicit_bucket_histogram';\n\n if (protocol === 'grpc') {\n const tls = getGrpcTlsConfig(\n certificateFile,\n clientKeyFile,\n clientCertificateFile\n );\n const otlpGrpc: NonNullable<PushMetricExporter['otlp_grpc']> = {\n endpoint:\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_ENDPOINT') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT') ??\n 'http://localhost:4317',\n timeout: timeoutExporter,\n temporality_preference:\n temporalityPreference as ExporterTemporalityPreference,\n default_histogram_aggregation:\n defaultHistogramAggregation as ExporterDefaultHistogramAggregation,\n ...(tls !== undefined && { tls }),\n ...(compression !== undefined && { compression }),\n ...(headersList !== undefined && { headers_list: headersList }),\n };\n readerPeriodicInfo.exporter = { otlp_grpc: otlpGrpc };\n } else {\n const tls = getHttpTlsConfig(\n certificateFile,\n clientKeyFile,\n clientCertificateFile\n );\n const encoding =\n protocol === 'http/json'\n ? 'json'\n : protocol === 'http/protobuf'\n ? 'protobuf'\n : undefined;\n const otlpHttp: NonNullable<PushMetricExporter['otlp_http']> = {\n endpoint:\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_ENDPOINT') ??\n (getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT')\n ? `${getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT')}/v1/metrics`\n : 'http://localhost:4318/v1/metrics'),\n timeout: timeoutExporter,\n temporality_preference:\n temporalityPreference as ExporterTemporalityPreference,\n default_histogram_aggregation:\n defaultHistogramAggregation as ExporterDefaultHistogramAggregation,\n ...(tls !== undefined && { tls }),\n ...(compression !== undefined && { compression }),\n ...(headersList !== undefined && { headers_list: headersList }),\n ...(encoding !== undefined && { encoding }),\n };\n readerPeriodicInfo.exporter = { otlp_http: otlpHttp };\n }\n }\n config.meter_provider.readers!.push({ periodic: readerPeriodicInfo });\n }\n\n const rawExemplarFilter =\n getStringFromEnv('OTEL_METRICS_EXEMPLAR_FILTER') ?? 'trace_based';\n config.meter_provider.exemplar_filter =\n rawExemplarFilter === 'default'\n ? 'trace_based'\n : (rawExemplarFilter as ExemplarFilter);\n}\n\nexport function setLoggerProvider(config: ConfigurationModel): void {\n const exportersType = Array.from(\n new Set(getStringListFromEnv('OTEL_LOGS_EXPORTER'))\n );\n if (exportersType.length === 0) {\n return;\n }\n if (exportersType.includes('none')) {\n diag.info(\n `OTEL_LOGS_EXPORTER contains \"none\". Logger provider will not be initialized.`\n );\n return;\n }\n config.logger_provider = initializeDefaultLoggerProviderConfiguration();\n\n const attributeValueLengthLimit = getNumberFromEnv(\n 'OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT'\n );\n const attributeCountLimit = getNumberFromEnv(\n 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT'\n );\n if (attributeValueLengthLimit || attributeCountLimit) {\n if (attributeValueLengthLimit) {\n config.logger_provider.limits!.attribute_value_length_limit =\n attributeValueLengthLimit;\n }\n\n if (attributeCountLimit) {\n config.logger_provider.limits!.attribute_count_limit =\n attributeCountLimit;\n }\n }\n\n const batch: BatchLogRecordProcessor = {\n exporter: {},\n schedule_delay: getNumberFromEnv('OTEL_BLRP_SCHEDULE_DELAY') ?? 1000,\n export_timeout: getNumberFromEnv('OTEL_BLRP_EXPORT_TIMEOUT') ?? 30000,\n max_queue_size: getNumberFromEnv('OTEL_BLRP_MAX_QUEUE_SIZE') ?? 2048,\n max_export_batch_size:\n getNumberFromEnv('OTEL_BLRP_MAX_EXPORT_BATCH_SIZE') ?? 512,\n };\n\n for (let i = 0; i < exportersType.length; i++) {\n const exporterType = exportersType[i];\n const batchInfo: BatchLogRecordProcessor = {\n ...batch,\n exporter: {},\n };\n if (exporterType === 'console') {\n const processor: LogRecordProcessor = {\n simple: { exporter: { console: {} } },\n };\n config.logger_provider.processors!.push(processor);\n } else {\n const protocol =\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_PROTOCOL') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_PROTOCOL') ??\n 'http/protobuf';\n const certificateFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CERTIFICATE');\n const clientKeyFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CLIENT_KEY');\n const clientCertificateFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE');\n const compression =\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_COMPRESSION') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_COMPRESSION');\n const timeout =\n getNumberFromEnv('OTEL_EXPORTER_OTLP_LOGS_TIMEOUT') ??\n getNumberFromEnv('OTEL_EXPORTER_OTLP_TIMEOUT') ??\n 10000;\n const headersList =\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_HEADERS') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_HEADERS');\n\n if (protocol === 'grpc') {\n const tls = getGrpcTlsConfig(\n certificateFile,\n clientKeyFile,\n clientCertificateFile\n );\n const otlpGrpc: NonNullable<LogRecordExporter['otlp_grpc']> = {\n endpoint:\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_ENDPOINT') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT') ??\n 'http://localhost:4317',\n timeout,\n ...(tls !== undefined && { tls }),\n ...(compression !== undefined && { compression }),\n ...(headersList !== undefined && { headers_list: headersList }),\n };\n batchInfo.exporter = { otlp_grpc: otlpGrpc };\n } else {\n const tls = getHttpTlsConfig(\n certificateFile,\n clientKeyFile,\n clientCertificateFile\n );\n const encoding =\n protocol === 'http/json'\n ? 'json'\n : protocol === 'http/protobuf'\n ? 'protobuf'\n : undefined;\n const otlpHttp: NonNullable<LogRecordExporter['otlp_http']> = {\n endpoint:\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_ENDPOINT') ??\n (getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT')\n ? `${getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT')}/v1/logs`\n : 'http://localhost:4318/v1/logs'),\n timeout,\n ...(tls !== undefined && { tls }),\n ...(compression !== undefined && { compression }),\n ...(headersList !== undefined && { headers_list: headersList }),\n ...(encoding !== undefined && { encoding }),\n };\n batchInfo.exporter = { otlp_http: otlpHttp };\n }\n const processor: LogRecordProcessor = { batch: batchInfo };\n config.logger_provider.processors!.push(processor);\n }\n }\n}\n"]}
{"version":3,"file":"EnvironmentConfigFactory.js","sourceRoot":"","sources":["../../src/EnvironmentConfigFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,8CAI6B;AAiB7B,4CAA0C;AAC1C,mCAOiB;AAEjB,2CAA6C;AAC7C,mDAA8C;AAQ9C;;GAEG;AACH,MAAa,wBAAwB;IAC3B,OAAO,CAAqB;IAEpC;QACE,IAAI,CAAC,OAAO,GAAG,IAAA,sCAA8B,GAAE,CAAC;QAChD,MAAM,SAAS,GAAG,IAAA,0BAAc,GAAE,CAAC;QACnC,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,iBAAiB,CAAC;QAEpD,MAAM,cAAc,GAAG,IAAA,uBAAgB,EAAC,gBAAgB,CAAC,CAAC;QAC1D,IAAI,cAAc,EAAE;YAClB,IAAI,CAAC,OAAO,CAAC,SAAS;gBACpB,sCAAsC,CAAC,cAAc,CAAC,CAAC;SAC1D;QAED,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3B,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,cAAc,C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,UAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACpD;KACF;AACH,CAAC;AA7HD,8CA6HC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n getStringFromEnv,\n getStringListFromEnv,\n getNumberFromEnv,\n} from '@opentelemetry/core';\nimport type { ConfigFactory } from './IConfigFactory';\nimport type {\n ExemplarFilter,\n BatchLogRecordProcessor,\n BatchSpanProcessor,\n ConfigurationModel,\n ExporterDefaultHistogramAggregation,\n ExporterTemporalityPreference,\n LogRecordExporter,\n LogRecordProcessor,\n PeriodicMetricReader,\n PushMetricExporter,\n SeverityNumber,\n SpanExporter,\n SpanProcessor,\n} from './generated/types';\nimport { diag } from '@opentelemetry/api';\nimport {\n getGrpcTlsConfig,\n getHttpTlsConfig,\n initializeDefaultConfiguration,\n initializeDefaultTracerProviderConfiguration,\n initializeDefaultMeterProviderConfiguration,\n initializeDefaultLoggerProviderConfiguration,\n} from './utils';\nimport type { EnvValues } from './EnvReader';\nimport { readAllEnvVars } from './EnvReader';\nimport { SamplerType } from './EnvDefinition';\n\ntype ExperimentalResourceDetector = NonNullable<\n NonNullable<\n NonNullable<ConfigurationModel['resource']>['detection/development']\n >['detectors']\n>[number];\n\n/**\n * EnvironmentConfigProvider provides a configuration based on environment variables.\n */\nexport class EnvironmentConfigFactory implements ConfigFactory {\n private _config: ConfigurationModel;\n\n constructor() {\n this._config = initializeDefaultConfiguration();\n const envValues = readAllEnvVars();\n this._config.disabled = envValues.OTEL_SDK_DISABLED;\n\n const logLevelString = getStringFromEnv('OTEL_LOG_LEVEL');\n if (logLevelString) {\n this._config.log_level =\n severityNumberConfigFromLogLevelString(logLevelString);\n }\n\n setResources(this._config);\n setAttributeLimits(this._config);\n setPropagators(this._config);\n setTracerProvider(this._config, envValues);\n setMeterProvider(this._config);\n setLoggerProvider(this._config);\n }\n\n getConfigModel(): ConfigurationModel {\n return this._config;\n }\n}\n\nconst SEV_NUM_CONFIG_FROM_LOG_LEVEL: { [key: string]: SeverityNumber } = {\n // Declarative config `log_level` has no \"NONE\". Using 'fatal' is\n // equivalent, because the OTel JS diag API does not have a \"fatal\" level.\n NONE: 'fatal',\n ERROR: 'error',\n WARN: 'warn',\n INFO: 'info',\n DEBUG: 'debug',\n VERBOSE: 'trace2',\n // Declarative config `log_level` has no \"ALL\". Using 'trace' is\n // equivalent, because that is the lowest SeverityNumber level.\n ALL: 'trace',\n};\n\n/**\n * Return a declarative config SeverityNumberConfig value (as used for\n * `log_level`) for the given `OTEL_LOG_LEVEL` string value.\n *\n * See notes at \"opentelemetr-sdk-node/src/diag.ts\".\n */\nfunction severityNumberConfigFromLogLevelString(\n str?: string\n): SeverityNumber | undefined {\n if (!str) {\n return undefined;\n }\n const sevNumConfig = SEV_NUM_CONFIG_FROM_LOG_LEVEL[str.toUpperCase()];\n if (!sevNumConfig) {\n diag.warn(\n `Unknown log level \"${str}\", expected one of ${Object.keys(SEV_NUM_CONFIG_FROM_LOG_LEVEL)}, using default info`\n );\n return 'info';\n }\n return sevNumConfig;\n}\n\nexport function setResources(config: ConfigurationModel): void {\n if (config.resource == null) {\n config.resource = {};\n }\n\n const resourceAttrList = getStringFromEnv('OTEL_RESOURCE_ATTRIBUTES');\n const list = resourceAttrList\n ? resourceAttrList\n .split(',')\n .map(s => s.trim())\n .filter(s => s)\n : [];\n const serviceName = getStringFromEnv('OTEL_SERVICE_NAME');\n\n if (serviceName) {\n config.resource.attributes = [\n {\n name: 'service.name',\n value: serviceName,\n type: 'string',\n },\n ];\n }\n if (list.length > 0) {\n config.resource.attributes_list = resourceAttrList;\n if (config.resource.attributes == null) {\n config.resource.attributes = [];\n }\n\n for (let i = 0; i < list.length; i++) {\n const element = list[i].split('=');\n if (\n element[0] !== 'service.name' ||\n (element[0] === 'service.name' && serviceName === undefined)\n ) {\n config.resource.attributes.push({\n name: element[0],\n value: element[1],\n type: 'string',\n });\n }\n }\n }\n\n const nodeDetectors = getStringListFromEnv('OTEL_NODE_RESOURCE_DETECTORS');\n if (\n nodeDetectors &&\n nodeDetectors.length > 0 &&\n !nodeDetectors.includes('none')\n ) {\n const all = nodeDetectors.includes('all');\n const detectors: ExperimentalResourceDetector[] = [];\n if (all || nodeDetectors.includes('container'))\n detectors.push({ container: {} });\n if (all || nodeDetectors.includes('host')) detectors.push({ host: {} });\n if (all || nodeDetectors.includes('os')) detectors.push({ os: {} });\n if (all || nodeDetectors.includes('process'))\n detectors.push({ process: {} });\n if (all || nodeDetectors.includes('serviceinstance'))\n detectors.push({ service: {} });\n if (all || nodeDetectors.includes('env')) detectors.push({ env: {} });\n if (detectors.length > 0) {\n if (config.resource['detection/development'] == null) {\n config.resource['detection/development'] = {};\n }\n config.resource['detection/development'].detectors = detectors;\n }\n }\n}\n\nexport function setAttributeLimits(config: ConfigurationModel): void {\n const attributeValueLengthLimit = getNumberFromEnv(\n 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT'\n );\n if (attributeValueLengthLimit && attributeValueLengthLimit > 0) {\n if (config.attribute_limits == null) {\n config.attribute_limits = { attribute_count_limit: 128 };\n }\n config.attribute_limits.attribute_value_length_limit =\n attributeValueLengthLimit;\n }\n\n const attributeCountLimit = getNumberFromEnv('OTEL_ATTRIBUTE_COUNT_LIMIT');\n if (attributeCountLimit) {\n if (config.attribute_limits == null) {\n config.attribute_limits = { attribute_count_limit: attributeCountLimit };\n } else {\n config.attribute_limits.attribute_count_limit = attributeCountLimit;\n }\n }\n}\n\nexport function setPropagators(config: ConfigurationModel): void {\n if (config.propagator == null) {\n config.propagator = {};\n }\n const compositeList = getStringFromEnv('OTEL_PROPAGATORS');\n if (compositeList) {\n config.propagator.composite_list = compositeList;\n const names = compositeList\n .split(',')\n .map(s => s.trim())\n .filter(s => s);\n if (names.length > 0) {\n config.propagator.composite = [];\n // Store each propagator name as a type-discriminator key. The config\n // model doesn't validate names here — known vs third-party propagators\n // are resolved when the SDK instantiates from the model.\n for (const name of names) {\n config.propagator.composite.push({ [name]: {} });\n }\n }\n }\n}\n\nexport function setSampler(config: ConfigurationModel, env: EnvValues): void {\n const sampler = env.OTEL_TRACES_SAMPLER;\n const arg = env.OTEL_TRACES_SAMPLER_ARG;\n\n if (!sampler || !config.tracer_provider) {\n return;\n }\n\n const ratio = arg ? parseFloat(arg) : 1.0;\n\n switch (sampler) {\n case SamplerType.AlwaysOn:\n config.tracer_provider.sampler = { always_on: {} };\n break;\n\n case SamplerType.AlwaysOff:\n config.tracer_provider.sampler = { always_off: {} };\n break;\n\n case SamplerType.TraceIdRatio:\n config.tracer_provider.sampler = {\n trace_id_ratio_based: { ratio },\n };\n break;\n\n case SamplerType.ParentBasedAlwaysOn:\n config.tracer_provider.sampler = {\n parent_based: { root: { always_on: {} } },\n };\n break;\n\n case SamplerType.ParentBasedAlwaysOff:\n config.tracer_provider.sampler = {\n parent_based: { root: { always_off: {} } },\n };\n break;\n\n case SamplerType.ParentBasedTraceIdRatio:\n config.tracer_provider.sampler = {\n parent_based: { root: { trace_id_ratio_based: { ratio } } },\n };\n break;\n\n default:\n // readEnvVar already warns for invalid values via allowedValues\n break;\n }\n}\n\nexport function setTracerProvider(\n config: ConfigurationModel,\n env: EnvValues\n): void {\n const exportersType = Array.from(\n new Set(getStringListFromEnv('OTEL_TRACES_EXPORTER'))\n );\n if (exportersType.length === 0) {\n return;\n }\n if (exportersType.includes('none')) {\n diag.info(\n 'OTEL_TRACES_EXPORTER contains \"none\". Tracer provider will not be initialized.'\n );\n return;\n }\n config.tracer_provider = initializeDefaultTracerProviderConfiguration();\n setSampler(config, env);\n\n const attributeValueLengthLimit = getNumberFromEnv(\n 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT'\n );\n if (attributeValueLengthLimit) {\n config.tracer_provider.limits!.attribute_value_length_limit =\n attributeValueLengthLimit;\n }\n\n const attributeCountLimit = getNumberFromEnv(\n 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT'\n );\n if (attributeCountLimit) {\n config.tracer_provider.limits!.attribute_count_limit = attributeCountLimit;\n }\n\n const eventCountLimit = getNumberFromEnv('OTEL_SPAN_EVENT_COUNT_LIMIT');\n if (eventCountLimit) {\n config.tracer_provider.limits!.event_count_limit = eventCountLimit;\n }\n\n const linkCountLimit = getNumberFromEnv('OTEL_SPAN_LINK_COUNT_LIMIT');\n if (linkCountLimit) {\n config.tracer_provider.limits!.link_count_limit = linkCountLimit;\n }\n\n const eventAttributeCountLimit = getNumberFromEnv(\n 'OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT'\n );\n if (eventAttributeCountLimit) {\n config.tracer_provider.limits!.event_attribute_count_limit =\n eventAttributeCountLimit;\n }\n\n const linkAttributeCountLimit = getNumberFromEnv(\n 'OTEL_LINK_ATTRIBUTE_COUNT_LIMIT'\n );\n if (linkAttributeCountLimit) {\n config.tracer_provider.limits!.link_attribute_count_limit =\n linkAttributeCountLimit;\n }\n\n const batch: BatchSpanProcessor = {\n exporter: {},\n schedule_delay: getNumberFromEnv('OTEL_BSP_SCHEDULE_DELAY') ?? 5000,\n export_timeout: getNumberFromEnv('OTEL_BSP_EXPORT_TIMEOUT') ?? 30000,\n max_queue_size: getNumberFromEnv('OTEL_BSP_MAX_QUEUE_SIZE') ?? 2048,\n max_export_batch_size:\n getNumberFromEnv('OTEL_BSP_MAX_EXPORT_BATCH_SIZE') ?? 512,\n };\n\n for (let i = 0; i < exportersType.length; i++) {\n const exporterType = exportersType[i];\n const batchInfo: BatchSpanProcessor = {\n ...batch,\n exporter: {},\n };\n if (exporterType === 'console') {\n const processor: SpanProcessor = {\n simple: { exporter: { console: {} } },\n };\n config.tracer_provider.processors!.push(processor);\n } else {\n const protocol =\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_PROTOCOL') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_PROTOCOL') ??\n 'http/protobuf';\n const certificateFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CERTIFICATE');\n const clientKeyFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CLIENT_KEY');\n const clientCertificateFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE');\n const compression =\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_COMPRESSION') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_COMPRESSION');\n const timeout =\n getNumberFromEnv('OTEL_EXPORTER_OTLP_TRACES_TIMEOUT') ??\n getNumberFromEnv('OTEL_EXPORTER_OTLP_TIMEOUT') ??\n 10000;\n const headersList =\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_HEADERS') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_HEADERS');\n\n if (protocol === 'grpc') {\n const tls = getGrpcTlsConfig(\n certificateFile,\n clientKeyFile,\n clientCertificateFile\n );\n const otlpGrpc: NonNullable<SpanExporter['otlp_grpc']> = {\n endpoint:\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT') ??\n 'http://localhost:4317',\n timeout,\n ...(tls !== undefined && { tls }),\n ...(compression !== undefined && { compression }),\n ...(headersList !== undefined && { headers_list: headersList }),\n };\n batchInfo.exporter = { otlp_grpc: otlpGrpc };\n } else {\n const tls = getHttpTlsConfig(\n certificateFile,\n clientKeyFile,\n clientCertificateFile\n );\n const encoding =\n protocol === 'http/json'\n ? 'json'\n : protocol === 'http/protobuf'\n ? 'protobuf'\n : undefined;\n const otlpHttp: NonNullable<SpanExporter['otlp_http']> = {\n endpoint:\n getStringFromEnv('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT') ??\n (getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT')\n ? `${getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT')}/v1/traces`\n : 'http://localhost:4318/v1/traces'),\n timeout,\n ...(tls !== undefined && { tls }),\n ...(compression !== undefined && { compression }),\n ...(headersList !== undefined && { headers_list: headersList }),\n ...(encoding !== undefined && { encoding }),\n };\n batchInfo.exporter = { otlp_http: otlpHttp };\n }\n\n const processor: SpanProcessor = { batch: batchInfo };\n config.tracer_provider.processors!.push(processor);\n }\n }\n}\n\nexport function setMeterProvider(config: ConfigurationModel): void {\n const exportersType = Array.from(\n new Set(getStringListFromEnv('OTEL_METRICS_EXPORTER'))\n );\n if (exportersType.length === 0) {\n return;\n }\n if (exportersType.includes('none')) {\n diag.info(\n 'OTEL_METRICS_EXPORTER contains \"none\". Meter provider will not be initialized.'\n );\n return;\n }\n config.meter_provider = initializeDefaultMeterProviderConfiguration();\n\n const interval = getNumberFromEnv('OTEL_METRIC_EXPORT_INTERVAL') ?? 60000;\n for (let i = 0; i < exportersType.length; i++) {\n const exporterType = exportersType[i];\n if (exporterType === 'prometheus') {\n const pullReader = {\n exporter: {\n 'prometheus/development': {\n host:\n getStringFromEnv('OTEL_EXPORTER_PROMETHEUS_HOST') ?? 'localhost',\n port: getNumberFromEnv('OTEL_EXPORTER_PROMETHEUS_PORT') ?? 9464,\n without_scope_info: false,\n 'without_target_info/development': false,\n },\n },\n };\n config.meter_provider.readers!.push({ pull: pullReader });\n continue;\n }\n\n const readerPeriodicInfo: PeriodicMetricReader = {\n interval,\n timeout: getNumberFromEnv('OTEL_METRIC_EXPORT_TIMEOUT') ?? 30000,\n exporter: {},\n };\n\n if (exporterType === 'console') {\n readerPeriodicInfo.exporter = { console: {} };\n } else {\n const protocol =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_PROTOCOL') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_PROTOCOL') ??\n 'http/protobuf';\n const certificateFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CERTIFICATE');\n const clientKeyFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CLIENT_KEY');\n const clientCertificateFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE');\n const compression =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_COMPRESSION') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_COMPRESSION');\n const timeoutExporter =\n getNumberFromEnv('OTEL_EXPORTER_OTLP_METRICS_TIMEOUT') ??\n getNumberFromEnv('OTEL_EXPORTER_OTLP_TIMEOUT') ??\n 10000;\n const headersList =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_HEADERS') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_HEADERS');\n const rawTemporality =\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE') ??\n 'cumulative';\n const validTemporalities = ['cumulative', 'delta', 'low_memory'];\n const temporalityPreference = validTemporalities.includes(rawTemporality)\n ? rawTemporality\n : 'cumulative';\n const rawHistogramAgg =\n getStringFromEnv(\n 'OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION'\n ) ?? 'explicit_bucket_histogram';\n const validHistogramAggs = [\n 'explicit_bucket_histogram',\n 'base2_exponential_bucket_histogram',\n ];\n const defaultHistogramAggregation = validHistogramAggs.includes(\n rawHistogramAgg\n )\n ? rawHistogramAgg\n : 'explicit_bucket_histogram';\n\n if (protocol === 'grpc') {\n const tls = getGrpcTlsConfig(\n certificateFile,\n clientKeyFile,\n clientCertificateFile\n );\n const otlpGrpc: NonNullable<PushMetricExporter['otlp_grpc']> = {\n endpoint:\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_ENDPOINT') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT') ??\n 'http://localhost:4317',\n timeout: timeoutExporter,\n temporality_preference:\n temporalityPreference as ExporterTemporalityPreference,\n default_histogram_aggregation:\n defaultHistogramAggregation as ExporterDefaultHistogramAggregation,\n ...(tls !== undefined && { tls }),\n ...(compression !== undefined && { compression }),\n ...(headersList !== undefined && { headers_list: headersList }),\n };\n readerPeriodicInfo.exporter = { otlp_grpc: otlpGrpc };\n } else {\n const tls = getHttpTlsConfig(\n certificateFile,\n clientKeyFile,\n clientCertificateFile\n );\n const encoding =\n protocol === 'http/json'\n ? 'json'\n : protocol === 'http/protobuf'\n ? 'protobuf'\n : undefined;\n const otlpHttp: NonNullable<PushMetricExporter['otlp_http']> = {\n endpoint:\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_ENDPOINT') ??\n (getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT')\n ? `${getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT')}/v1/metrics`\n : 'http://localhost:4318/v1/metrics'),\n timeout: timeoutExporter,\n temporality_preference:\n temporalityPreference as ExporterTemporalityPreference,\n default_histogram_aggregation:\n defaultHistogramAggregation as ExporterDefaultHistogramAggregation,\n ...(tls !== undefined && { tls }),\n ...(compression !== undefined && { compression }),\n ...(headersList !== undefined && { headers_list: headersList }),\n ...(encoding !== undefined && { encoding }),\n };\n readerPeriodicInfo.exporter = { otlp_http: otlpHttp };\n }\n }\n config.meter_provider.readers!.push({ periodic: readerPeriodicInfo });\n }\n\n const rawExemplarFilter =\n getStringFromEnv('OTEL_METRICS_EXEMPLAR_FILTER') ?? 'trace_based';\n config.meter_provider.exemplar_filter =\n rawExemplarFilter === 'default'\n ? 'trace_based'\n : (rawExemplarFilter as ExemplarFilter);\n}\n\nexport function setLoggerProvider(config: ConfigurationModel): void {\n const exportersType = Array.from(\n new Set(getStringListFromEnv('OTEL_LOGS_EXPORTER'))\n );\n if (exportersType.length === 0) {\n return;\n }\n if (exportersType.includes('none')) {\n diag.info(\n 'OTEL_LOGS_EXPORTER contains \"none\". Logger provider will not be initialized.'\n );\n return;\n }\n config.logger_provider = initializeDefaultLoggerProviderConfiguration();\n\n const attributeValueLengthLimit = getNumberFromEnv(\n 'OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT'\n );\n const attributeCountLimit = getNumberFromEnv(\n 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT'\n );\n if (attributeValueLengthLimit || attributeCountLimit) {\n if (attributeValueLengthLimit) {\n config.logger_provider.limits!.attribute_value_length_limit =\n attributeValueLengthLimit;\n }\n\n if (attributeCountLimit) {\n config.logger_provider.limits!.attribute_count_limit =\n attributeCountLimit;\n }\n }\n\n const batch: BatchLogRecordProcessor = {\n exporter: {},\n schedule_delay: getNumberFromEnv('OTEL_BLRP_SCHEDULE_DELAY') ?? 1000,\n export_timeout: getNumberFromEnv('OTEL_BLRP_EXPORT_TIMEOUT') ?? 30000,\n max_queue_size: getNumberFromEnv('OTEL_BLRP_MAX_QUEUE_SIZE') ?? 2048,\n max_export_batch_size:\n getNumberFromEnv('OTEL_BLRP_MAX_EXPORT_BATCH_SIZE') ?? 512,\n };\n\n for (let i = 0; i < exportersType.length; i++) {\n const exporterType = exportersType[i];\n const batchInfo: BatchLogRecordProcessor = {\n ...batch,\n exporter: {},\n };\n if (exporterType === 'console') {\n const processor: LogRecordProcessor = {\n simple: { exporter: { console: {} } },\n };\n config.logger_provider.processors!.push(processor);\n } else {\n const protocol =\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_PROTOCOL') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_PROTOCOL') ??\n 'http/protobuf';\n const certificateFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CERTIFICATE');\n const clientKeyFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CLIENT_KEY');\n const clientCertificateFile =\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE');\n const compression =\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_COMPRESSION') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_COMPRESSION');\n const timeout =\n getNumberFromEnv('OTEL_EXPORTER_OTLP_LOGS_TIMEOUT') ??\n getNumberFromEnv('OTEL_EXPORTER_OTLP_TIMEOUT') ??\n 10000;\n const headersList =\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_HEADERS') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_HEADERS');\n\n if (protocol === 'grpc') {\n const tls = getGrpcTlsConfig(\n certificateFile,\n clientKeyFile,\n clientCertificateFile\n );\n const otlpGrpc: NonNullable<LogRecordExporter['otlp_grpc']> = {\n endpoint:\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_ENDPOINT') ??\n getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT') ??\n 'http://localhost:4317',\n timeout,\n ...(tls !== undefined && { tls }),\n ...(compression !== undefined && { compression }),\n ...(headersList !== undefined && { headers_list: headersList }),\n };\n batchInfo.exporter = { otlp_grpc: otlpGrpc };\n } else {\n const tls = getHttpTlsConfig(\n certificateFile,\n clientKeyFile,\n clientCertificateFile\n );\n const encoding =\n protocol === 'http/json'\n ? 'json'\n : protocol === 'http/protobuf'\n ? 'protobuf'\n : undefined;\n const otlpHttp: NonNullable<LogRecordExporter['otlp_http']> = {\n endpoint:\n getStringFromEnv('OTEL_EXPORTER_OTLP_LOGS_ENDPOINT') ??\n (getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT')\n ? `${getStringFromEnv('OTEL_EXPORTER_OTLP_ENDPOINT')}/v1/logs`\n : 'http://localhost:4318/v1/logs'),\n timeout,\n ...(tls !== undefined && { tls }),\n ...(compression !== undefined && { compression }),\n ...(headersList !== undefined && { headers_list: headersList }),\n ...(encoding !== undefined && { encoding }),\n };\n batchInfo.exporter = { otlp_http: otlpHttp };\n }\n const processor: LogRecordProcessor = { batch: batchInfo };\n config.logger_provider.processors!.push(processor);\n }\n }\n}\n"]}

@@ -29,5 +29,5 @@ "use strict";

const file = fs.readFileSync(configFile, 'utf8');
// Apply env var substitution to all string values before schema parsing
const rawParsed = yaml.parse(file);
const processed = substituteEnvVars(rawParsed);
const doc = yaml.parseDocument(file, { version: '1.2' });
(0, utils_1.substituteEnvVars)(doc);
const processed = doc.toJS();
const fileFormat = processed?.file_format;

@@ -37,4 +37,2 @@ if (!fileFormat || !supportedFileVersionPattern.test(String(fileFormat))) {

}
// Normalize YAML null type-tag values to {} before validation
normalizeYamlNulls(processed);
const valid = validateConfig(processed);

@@ -63,9 +61,2 @@ if (!valid) {

delete data['file_format'];
// The generated TypeScript types omit `| null` from unions (see
// generate-config.js) because consumers expect `T | undefined`, not
// `T | null`. To match, we delete any properties still set to `null`
// after YAML parsing so that accessing them returns `undefined`.
// Runs after normalizeYamlNulls, which has already converted type-tag
// nulls (e.g. `console:`) to `{}`.
stripNulls(processed);
applyConfigDefaults(data);

@@ -209,145 +200,2 @@ mergeAttributesList(data);

}
/**
* Recursively delete object properties whose value is `null`.
*
* YAML `key:` (no value) parses to `{ key: null }`. The generated TypeScript
* types use `?: T` (not `T | null`) because downstream consumers like sdk-node
* assign config values to interfaces that only accept `T | undefined`. The
* codegen script (generate-config.js) strips `| null` from type unions; this
* function makes the runtime data match by deleting null-valued keys so that
* property access returns `undefined` instead of `null`.
*
* Must run AFTER normalizeYamlNulls, which converts type-tag nulls
* (e.g. `console: null` → `console: {}`) — those are already `{}` by the
* time this function runs and won't be affected.
*/
function stripNulls(value) {
if (value == null || typeof value !== 'object')
return;
if (Array.isArray(value)) {
for (const item of value) {
stripNulls(item);
}
}
else {
for (const [key, val] of Object.entries(value)) {
if (val === null) {
delete value[key];
}
else {
stripNulls(val);
}
}
}
}
/**
* Object type-tag keys that may appear as nested (non-array-element) properties.
* YAML `console:` (no value) parses to `{ console: null }`, but the SDK checks
* `if (exporter.console)` — truthy — so null must become {}.
*
* We exclude keys that are also used as nullable primitives in other contexts
* (e.g. `host` is a string field in prometheus config; detectors use it as a
* type-tag but only as array elements, which are already handled below).
*/
const NESTED_OBJECT_TYPE_TAGS = new Set([
// Exporter type discriminators (nested inside simple/batch processor or reader)
'console',
'otlp_http',
'otlp_grpc',
// Sampler type discriminators (nested inside tracer_provider.sampler)
'always_on',
'always_off',
'trace_id_ratio_based',
'parent_based',
'jaeger_remote',
// Propagator type discriminators (array elements, but covered here for completeness)
'tracecontext',
'baggage',
'b3',
'b3multi',
'xray',
// Telemetry producer type discriminators
'opencensus',
]);
/**
* Normalizes YAML null values to empty objects for discriminated-union type-tag fields.
*
* YAML `key:` (no value) parses to `{ key: null }`, but the SDK checks `if (obj.key)`
* to determine which type to instantiate — null fails that check. Two cases:
*
* 1. Array element properties: convert ALL null-valued keys to {} (handles detectors,
* composite propagators, and most exporter/processor discriminators).
* 2. Nested NESTED_OBJECT_TYPE_TAGS: convert known type-discriminator keys to {} when
* encountered anywhere in the tree (handles sampler types, console exporter nested
* inside simple/batch, etc.).
*
* Top-level nullable primitive fields (disabled, log_level, endpoint, ca_file, etc.)
* are NOT in NESTED_OBJECT_TYPE_TAGS and are left as-is; applyConfigDefaults()
* handles the boolean/string ones that need defaults.
*/
function normalizeYamlNulls(value) {
if (value == null || typeof value !== 'object')
return;
if (Array.isArray(value)) {
for (const item of value) {
if (item != null && typeof item === 'object' && !Array.isArray(item)) {
// All null-valued properties of array elements are type-tag discriminators.
for (const key of Object.keys(item)) {
if (item[key] === null) {
item[key] = {};
}
}
}
normalizeYamlNulls(item);
}
}
else {
for (const [key, val] of Object.entries(value)) {
if (val === null &&
// Known type-tag keys, or slash-qualified experimental type-tags
// (e.g. otlp_file/development, prometheus/development)
(NESTED_OBJECT_TYPE_TAGS.has(key) || key.includes('/'))) {
value[key] = {};
}
else {
normalizeYamlNulls(val);
}
}
}
}
const ENV_VAR_PATTERN = /\$\{[^}]+\}/;
function substituteEnvVars(obj) {
if (typeof obj === 'string') {
// Only coerce if the string contained env var substitution syntax,
// so that plain YAML strings (e.g. quoted "1234") are not type-coerced.
const hasSubstitution = ENV_VAR_PATTERN.test(obj);
const substituted = (0, utils_1.envVariableSubstitution)(obj);
return hasSubstitution ? yamlCoerce(substituted) : substituted;
}
if (Array.isArray(obj)) {
return obj.map(substituteEnvVars);
}
if (typeof obj === 'object' && obj !== null) {
return Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, substituteEnvVars(v)]));
}
return obj;
}
/**
* Re-coerce a string value to its YAML-equivalent primitive type.
* Env var substitution always returns strings; this converts them back
* to booleans/numbers/null where the schema expects those types.
*/
function yamlCoerce(value) {
if (value === 'true')
return true;
if (value === 'false')
return false;
if (value === 'null' || value === '')
return null;
if (/^-?\d+$/.test(value))
return parseInt(value, 10);
if (/^-?\d+\.\d+$/.test(value))
return parseFloat(value);
return value;
}
//# sourceMappingURL=FileConfigFactory.js.map

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

{"version":3,"file":"FileConfigFactory.js","sourceRoot":"","sources":["../../src/FileConfigFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,8CAAuD;AAEvD,yBAAyB;AACzB,6BAA6B;AAC7B,mCAAkD;AAQlD,oFAAoF;AACpF,2EAA2E;AAC3E,wDAAwD;AAExD,MAAa,iBAAiB;IACpB,OAAO,CAAqB;IAEpC;QACE,IAAI,CAAC,OAAO,GAAG,eAAe,EAAE,CAAC;IACnC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAVD,8CAUC;AAED,SAAgB,eAAe;IAC7B,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IAC7C,MAAM,UAAU,GAAG,IAAA,uBAAgB,EAAC,kBAAkB,CAAC,IAAI,EAAE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,iBAAiB,CAAC,CAAC;KACnC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE;QAC3C,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAC/D,CAAC;KACH;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAClC,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAClD,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACtD,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;IACzD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport type { ConfigFactory } from './IConfigFactory';\nimport * as fs from 'fs';\nimport * as yaml from 'yaml';\nimport { envVariableSubstitution } from './utils';\nimport type {\n BatchLogRecordProcessor,\n BatchSpanProcessor,\n CardinalityLimits,\n ConfigurationModel,\n PeriodicMetricReader,\n} from './generated/types';\n// Pre-compiled ajv validator — eliminates runtime schema compilation on cold start.\n// Generated by `npm run generate:config`; do not import ajv directly here.\nimport * as validateConfig from './generated/validator';\n\nexport class FileConfigFactory implements ConfigFactory {\n private _config: ConfigurationModel;\n\n constructor() {\n this._config = parseConfigFile();\n }\n\n getConfigModel(): ConfigurationModel {\n return this._config;\n }\n}\n\nexport function parseConfigFile(): ConfigurationModel {\n const supportedFileVersionPattern = /^1\\.0$/;\n const configFile = getStringFromEnv('OTEL_CONFIG_FILE') || '';\n const file = fs.readFileSync(configFile, 'utf8');\n\n // Apply env var substitution to all string values before schema parsing\n const rawParsed = yaml.parse(file) as Record<string, unknown>;\n const processed = substituteEnvVars(rawParsed) as Record<string, unknown>;\n\n const fileFormat = processed?.file_format;\n if (!fileFormat || !supportedFileVersionPattern.test(String(fileFormat))) {\n throw new Error(\n `${configFile}: Unsupported file_format: \"${fileFormat}\". Must match ${supportedFileVersionPattern}.`\n );\n }\n\n // Normalize YAML null type-tag values to {} before validation\n normalizeYamlNulls(processed);\n\n const valid = validateConfig(processed);\n if (!valid) {\n let detail: string;\n if (!validateConfig.errors) {\n detail = 'unknown error';\n } else if (validateConfig.errors.length === 1) {\n const err = validateConfig.errors[0];\n detail = `${err.instancePath} ${err.message}`;\n } else {\n const sep = '\\n ';\n detail =\n sep +\n validateConfig.errors\n .map(e => `${e.instancePath} ${e.message}`)\n .join(sep);\n }\n throw new Error(\n `Invalid OpenTelemetry config file: ${configFile}: ${detail}`\n );\n }\n\n const data = processed as unknown as ConfigurationModel;\n\n // Strip file_format from output — it's a meta-field, not a config value\n delete (data as Record<string, unknown>)['file_format'];\n\n // The generated TypeScript types omit `| null` from unions (see\n // generate-config.js) because consumers expect `T | undefined`, not\n // `T | null`. To match, we delete any properties still set to `null`\n // after YAML parsing so that accessing them returns `undefined`.\n // Runs after normalizeYamlNulls, which has already converted type-tag\n // nulls (e.g. `console:`) to `{}`.\n stripNulls(processed);\n\n applyConfigDefaults(data);\n mergeAttributesList(data);\n mergeCompositeList(data);\n applyBatchProcessorDefaults(data);\n applyPeriodicReaderDefaults(data);\n applyOtlpHttpEncodingDefaults(data);\n\n return data;\n}\n\n/**\n * Apply default encoding ('protobuf') to all otlp_http exporters in the config\n * where encoding was not explicitly specified. The spec defines protobuf as the\n * default encoding for OTLP HTTP exporters.\n */\nfunction applyOtlpHttpEncodingDefaults(data: ConfigurationModel): void {\n const applyEncoding = (\n exporter: { encoding?: string | null } | null | undefined\n ) => {\n if (exporter && exporter.encoding == null) {\n exporter.encoding = 'protobuf';\n }\n };\n\n for (const processor of data.tracer_provider?.processors ?? []) {\n applyEncoding(processor.batch?.exporter?.otlp_http);\n applyEncoding(processor.simple?.exporter?.otlp_http);\n }\n\n for (const reader of data.meter_provider?.readers ?? []) {\n applyEncoding(reader.periodic?.exporter?.otlp_http);\n }\n\n for (const processor of data.logger_provider?.processors ?? []) {\n applyEncoding(processor.batch?.exporter?.otlp_http);\n applyEncoding(processor.simple?.exporter?.otlp_http);\n }\n}\n\n/**\n * Merge resource.attributes_list (comma-separated key=value pairs) into\n * resource.attributes, with entries already in attributes taking precedence.\n */\nfunction mergeAttributesList(data: ConfigurationModel): void {\n const resource = data.resource;\n const list = resource?.attributes_list;\n if (typeof list !== 'string' || !list.trim()) return;\n\n if (resource!.attributes == null) {\n resource!.attributes = [];\n }\n\n const existingKeys = new Set(\n resource!.attributes.map((a: { name: string }) => a.name)\n );\n\n for (const pair of list.split(',')) {\n const eqIdx = pair.indexOf('=');\n if (eqIdx > 0) {\n const key = pair.slice(0, eqIdx).trim();\n const value = pair.slice(eqIdx + 1).trim();\n if (key && !existingKeys.has(key)) {\n resource!.attributes.push({ name: key, value, type: 'string' });\n }\n }\n }\n}\n\n/**\n * Merge propagator.composite_list (comma-separated propagator names) into\n * propagator.composite, with entries already in composite taking precedence.\n */\nfunction mergeCompositeList(data: ConfigurationModel): void {\n const propagator = data.propagator;\n const list = propagator?.composite_list;\n if (typeof list !== 'string' || !list.trim()) return;\n\n if (propagator!.composite == null) {\n propagator!.composite = [];\n }\n\n const existingNames = new Set(\n (propagator!.composite as Array<Record<string, unknown>>).map(\n entry => Object.keys(entry)[0]\n )\n );\n\n for (const name of list.split(',')) {\n const trimmed = name.trim();\n if (trimmed && !existingNames.has(trimmed)) {\n (propagator!.composite as Array<Record<string, unknown>>).push({\n [trimmed]: {},\n });\n }\n }\n}\n\n/**\n * Apply spec-defined defaults for batch span/log-record processor fields that\n * are not encoded in the JSON schema.\n */\nfunction applyBatchProcessorDefaults(data: ConfigurationModel): void {\n const applyDefaults = (\n batch: BatchSpanProcessor | BatchLogRecordProcessor\n ) => {\n if (batch.schedule_delay == null) batch.schedule_delay = 5000;\n if (batch.export_timeout == null) batch.export_timeout = 30000;\n if (batch.max_queue_size == null) batch.max_queue_size = 2048;\n if (batch.max_export_batch_size == null) batch.max_export_batch_size = 512;\n };\n\n for (const processor of data.tracer_provider?.processors ?? []) {\n if (processor.batch) applyDefaults(processor.batch);\n }\n for (const processor of data.logger_provider?.processors ?? []) {\n if (processor.batch) applyDefaults(processor.batch);\n }\n}\n\n/**\n * Apply spec-defined defaults for periodic metric reader fields.\n */\nfunction applyPeriodicReaderDefaults(data: ConfigurationModel): void {\n for (const reader of data.meter_provider?.readers ?? []) {\n const periodic = reader.periodic as PeriodicMetricReader | undefined;\n if (!periodic) continue;\n if (periodic.interval == null) periodic.interval = 60000;\n if (periodic.timeout == null) periodic.timeout = 30000;\n if (periodic.cardinality_limits == null) {\n periodic.cardinality_limits = { default: 2000 } as CardinalityLimits;\n }\n }\n}\n\n/**\n * Apply spec-defined defaults that are not encoded in the JSON schema.\n * Both FileConfigFactory and EnvironmentConfigFactory apply the same defaults\n * so consumers see consistent behaviour regardless of config source.\n */\nfunction applyConfigDefaults(data: ConfigurationModel): void {\n if (data.disabled == null) {\n data.disabled = false;\n }\n if (data.log_level == null) {\n data.log_level = 'info';\n }\n if (data.attribute_limits == null) {\n data.attribute_limits = { attribute_count_limit: 128 };\n } else if (data.attribute_limits.attribute_count_limit == null) {\n data.attribute_limits.attribute_count_limit = 128;\n }\n}\n\n/**\n * Recursively delete object properties whose value is `null`.\n *\n * YAML `key:` (no value) parses to `{ key: null }`. The generated TypeScript\n * types use `?: T` (not `T | null`) because downstream consumers like sdk-node\n * assign config values to interfaces that only accept `T | undefined`. The\n * codegen script (generate-config.js) strips `| null` from type unions; this\n * function makes the runtime data match by deleting null-valued keys so that\n * property access returns `undefined` instead of `null`.\n *\n * Must run AFTER normalizeYamlNulls, which converts type-tag nulls\n * (e.g. `console: null` → `console: {}`) — those are already `{}` by the\n * time this function runs and won't be affected.\n */\nfunction stripNulls(value: unknown): void {\n if (value == null || typeof value !== 'object') return;\n if (Array.isArray(value)) {\n for (const item of value) {\n stripNulls(item);\n }\n } else {\n for (const [key, val] of Object.entries(value as Record<string, unknown>)) {\n if (val === null) {\n delete (value as Record<string, unknown>)[key];\n } else {\n stripNulls(val);\n }\n }\n }\n}\n\n/**\n * Object type-tag keys that may appear as nested (non-array-element) properties.\n * YAML `console:` (no value) parses to `{ console: null }`, but the SDK checks\n * `if (exporter.console)` — truthy — so null must become {}.\n *\n * We exclude keys that are also used as nullable primitives in other contexts\n * (e.g. `host` is a string field in prometheus config; detectors use it as a\n * type-tag but only as array elements, which are already handled below).\n */\nconst NESTED_OBJECT_TYPE_TAGS = new Set([\n // Exporter type discriminators (nested inside simple/batch processor or reader)\n 'console',\n 'otlp_http',\n 'otlp_grpc',\n // Sampler type discriminators (nested inside tracer_provider.sampler)\n 'always_on',\n 'always_off',\n 'trace_id_ratio_based',\n 'parent_based',\n 'jaeger_remote',\n // Propagator type discriminators (array elements, but covered here for completeness)\n 'tracecontext',\n 'baggage',\n 'b3',\n 'b3multi',\n 'xray',\n // Telemetry producer type discriminators\n 'opencensus',\n]);\n\n/**\n * Normalizes YAML null values to empty objects for discriminated-union type-tag fields.\n *\n * YAML `key:` (no value) parses to `{ key: null }`, but the SDK checks `if (obj.key)`\n * to determine which type to instantiate — null fails that check. Two cases:\n *\n * 1. Array element properties: convert ALL null-valued keys to {} (handles detectors,\n * composite propagators, and most exporter/processor discriminators).\n * 2. Nested NESTED_OBJECT_TYPE_TAGS: convert known type-discriminator keys to {} when\n * encountered anywhere in the tree (handles sampler types, console exporter nested\n * inside simple/batch, etc.).\n *\n * Top-level nullable primitive fields (disabled, log_level, endpoint, ca_file, etc.)\n * are NOT in NESTED_OBJECT_TYPE_TAGS and are left as-is; applyConfigDefaults()\n * handles the boolean/string ones that need defaults.\n */\nfunction normalizeYamlNulls(value: unknown): void {\n if (value == null || typeof value !== 'object') return;\n if (Array.isArray(value)) {\n for (const item of value) {\n if (item != null && typeof item === 'object' && !Array.isArray(item)) {\n // All null-valued properties of array elements are type-tag discriminators.\n for (const key of Object.keys(item as object)) {\n if ((item as Record<string, unknown>)[key] === null) {\n (item as Record<string, unknown>)[key] = {};\n }\n }\n }\n normalizeYamlNulls(item);\n }\n } else {\n for (const [key, val] of Object.entries(value as Record<string, unknown>)) {\n if (\n val === null &&\n // Known type-tag keys, or slash-qualified experimental type-tags\n // (e.g. otlp_file/development, prometheus/development)\n (NESTED_OBJECT_TYPE_TAGS.has(key) || key.includes('/'))\n ) {\n (value as Record<string, unknown>)[key] = {};\n } else {\n normalizeYamlNulls(val);\n }\n }\n }\n}\n\nconst ENV_VAR_PATTERN = /\\$\\{[^}]+\\}/;\n\nfunction substituteEnvVars(obj: unknown): unknown {\n if (typeof obj === 'string') {\n // Only coerce if the string contained env var substitution syntax,\n // so that plain YAML strings (e.g. quoted \"1234\") are not type-coerced.\n const hasSubstitution = ENV_VAR_PATTERN.test(obj);\n const substituted = envVariableSubstitution(obj);\n return hasSubstitution ? yamlCoerce(substituted) : substituted;\n }\n if (Array.isArray(obj)) {\n return obj.map(substituteEnvVars);\n }\n if (typeof obj === 'object' && obj !== null) {\n return Object.fromEntries(\n Object.entries(obj).map(([k, v]) => [k, substituteEnvVars(v)])\n );\n }\n return obj;\n}\n\n/**\n * Re-coerce a string value to its YAML-equivalent primitive type.\n * Env var substitution always returns strings; this converts them back\n * to booleans/numbers/null where the schema expects those types.\n */\nfunction yamlCoerce(value: string): unknown {\n if (value === 'true') return true;\n if (value === 'false') return false;\n if (value === 'null' || value === '') return null;\n if (/^-?\\d+$/.test(value)) return parseInt(value, 10);\n if (/^-?\\d+\\.\\d+$/.test(value)) return parseFloat(value);\n return value;\n}\n"]}
{"version":3,"file":"FileConfigFactory.js","sourceRoot":"","sources":["../../src/FileConfigFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,8CAAuD;AACvD,yBAAyB;AACzB,6BAA6B;AAE7B,mCAA4C;AAQ5C,oFAAoF;AACpF,2EAA2E;AAC3E,wDAAwD;AAExD,MAAa,iBAAiB;IACpB,OAAO,CAAqB;IAEpC;QACE,IAAI,CAAC,OAAO,GAAG,eAAe,EAAE,CAAC;IACnC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAVD,8CAUC;AAED,SAAgB,eAAe;IAC7B,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IAC7C,MAAM,UAAU,GAAG,IAAA,uBAAgB,EAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;IAC9D,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAEjD,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IACzD,IAAA,yBAAiB,EAAC,GAAG,CAAC,CAAC;IACvB,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,EAA6B,CAAC;IAExD,MAAM,UAAU,GAAG,SAAS,EAAE,WAAW,CAAC;IAC1C,IAAI,CAAC,UAAU,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE;QACxE,MAAM,IAAI,KAAK,CACb,GAAG,UAAU,+BAA+B,UAAU,iBAAiB,2BAA2B,GAAG,CACtG,CAAC;KACH;IAED,MAAM,KAAK,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IACxC,IAAI,CAAC,KAAK,EAAE;QACV,IAA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CAAC;QACvD,IAAI,QAAQ,CAAC,kBAAkB,IAAI,IAAI,EAAE;YACvC,QAAQ,CAAC,kBAAkB,GAAG,EAAE,OAAO,EAAE,IAAI,EAAuB,CAAC;SACtE;KACF;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,mBAAmB,CAAC,IAAwB;IACnD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE;QACzB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;KACvB;IACD,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;QAC1B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;KACzB;IACD,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,EAAE;QACjC,IAAI,CAAC,gBAAgB,GAAG,EAAE,qBAAqB,EAAE,GAAG,EAAE,CAAC;KACxD;SAAM,IAAI,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,IAAI,IAAI,EAAE;QAC9D,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,GAAG,GAAG,CAAC;KACnD;AACH,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport * as fs from 'fs';\nimport * as yaml from 'yaml';\nimport type { ConfigFactory } from './IConfigFactory';\nimport { substituteEnvVars } from './utils';\nimport type {\n BatchLogRecordProcessor,\n BatchSpanProcessor,\n CardinalityLimits,\n ConfigurationModel,\n PeriodicMetricReader,\n} from './generated/types';\n// Pre-compiled ajv validator — eliminates runtime schema compilation on cold start.\n// Generated by `npm run generate:config`; do not import ajv directly here.\nimport * as validateConfig from './generated/validator';\n\nexport class FileConfigFactory implements ConfigFactory {\n private _config: ConfigurationModel;\n\n constructor() {\n this._config = parseConfigFile();\n }\n\n getConfigModel(): ConfigurationModel {\n return this._config;\n }\n}\n\nexport function parseConfigFile(): ConfigurationModel {\n const supportedFileVersionPattern = /^1\\.0$/;\n const configFile = getStringFromEnv('OTEL_CONFIG_FILE') || '';\n const file = fs.readFileSync(configFile, 'utf8');\n\n const doc = yaml.parseDocument(file, { version: '1.2' });\n substituteEnvVars(doc);\n const processed = doc.toJS() as Record<string, unknown>;\n\n const fileFormat = processed?.file_format;\n if (!fileFormat || !supportedFileVersionPattern.test(String(fileFormat))) {\n throw new Error(\n `${configFile}: Unsupported file_format: \"${fileFormat}\". Must match ${supportedFileVersionPattern}.`\n );\n }\n\n const valid = validateConfig(processed);\n if (!valid) {\n let detail: string;\n if (!validateConfig.errors) {\n detail = 'unknown error';\n } else if (validateConfig.errors.length === 1) {\n const err = validateConfig.errors[0];\n detail = `${err.instancePath} ${err.message}`;\n } else {\n const sep = '\\n ';\n detail =\n sep +\n validateConfig.errors\n .map(e => `${e.instancePath} ${e.message}`)\n .join(sep);\n }\n throw new Error(\n `Invalid OpenTelemetry config file: ${configFile}: ${detail}`\n );\n }\n\n const data = processed as unknown as ConfigurationModel;\n\n // Strip file_format from output — it's a meta-field, not a config value\n delete (data as Record<string, unknown>)['file_format'];\n\n applyConfigDefaults(data);\n mergeAttributesList(data);\n mergeCompositeList(data);\n applyBatchProcessorDefaults(data);\n applyPeriodicReaderDefaults(data);\n applyOtlpHttpEncodingDefaults(data);\n\n return data;\n}\n\n/**\n * Apply default encoding ('protobuf') to all otlp_http exporters in the config\n * where encoding was not explicitly specified. The spec defines protobuf as the\n * default encoding for OTLP HTTP exporters.\n */\nfunction applyOtlpHttpEncodingDefaults(data: ConfigurationModel): void {\n const applyEncoding = (\n exporter: { encoding?: string | null } | null | undefined\n ) => {\n if (exporter && exporter.encoding == null) {\n exporter.encoding = 'protobuf';\n }\n };\n\n for (const processor of data.tracer_provider?.processors ?? []) {\n applyEncoding(processor.batch?.exporter?.otlp_http);\n applyEncoding(processor.simple?.exporter?.otlp_http);\n }\n\n for (const reader of data.meter_provider?.readers ?? []) {\n applyEncoding(reader.periodic?.exporter?.otlp_http);\n }\n\n for (const processor of data.logger_provider?.processors ?? []) {\n applyEncoding(processor.batch?.exporter?.otlp_http);\n applyEncoding(processor.simple?.exporter?.otlp_http);\n }\n}\n\n/**\n * Merge resource.attributes_list (comma-separated key=value pairs) into\n * resource.attributes, with entries already in attributes taking precedence.\n */\nfunction mergeAttributesList(data: ConfigurationModel): void {\n const resource = data.resource;\n const list = resource?.attributes_list;\n if (typeof list !== 'string' || !list.trim()) return;\n\n if (resource!.attributes == null) {\n resource!.attributes = [];\n }\n\n const existingKeys = new Set(\n resource!.attributes.map((a: { name: string }) => a.name)\n );\n\n for (const pair of list.split(',')) {\n const eqIdx = pair.indexOf('=');\n if (eqIdx > 0) {\n const key = pair.slice(0, eqIdx).trim();\n const value = pair.slice(eqIdx + 1).trim();\n if (key && !existingKeys.has(key)) {\n resource!.attributes.push({ name: key, value, type: 'string' });\n }\n }\n }\n}\n\n/**\n * Merge propagator.composite_list (comma-separated propagator names) into\n * propagator.composite, with entries already in composite taking precedence.\n */\nfunction mergeCompositeList(data: ConfigurationModel): void {\n const propagator = data.propagator;\n const list = propagator?.composite_list;\n if (typeof list !== 'string' || !list.trim()) return;\n\n if (propagator!.composite == null) {\n propagator!.composite = [];\n }\n\n const existingNames = new Set(\n (propagator!.composite as Array<Record<string, unknown>>).map(\n entry => Object.keys(entry)[0]\n )\n );\n\n for (const name of list.split(',')) {\n const trimmed = name.trim();\n if (trimmed && !existingNames.has(trimmed)) {\n (propagator!.composite as Array<Record<string, unknown>>).push({\n [trimmed]: {},\n });\n }\n }\n}\n\n/**\n * Apply spec-defined defaults for batch span/log-record processor fields that\n * are not encoded in the JSON schema.\n */\nfunction applyBatchProcessorDefaults(data: ConfigurationModel): void {\n const applyDefaults = (\n batch: BatchSpanProcessor | BatchLogRecordProcessor\n ) => {\n if (batch.schedule_delay == null) batch.schedule_delay = 5000;\n if (batch.export_timeout == null) batch.export_timeout = 30000;\n if (batch.max_queue_size == null) batch.max_queue_size = 2048;\n if (batch.max_export_batch_size == null) batch.max_export_batch_size = 512;\n };\n\n for (const processor of data.tracer_provider?.processors ?? []) {\n if (processor.batch) applyDefaults(processor.batch);\n }\n for (const processor of data.logger_provider?.processors ?? []) {\n if (processor.batch) applyDefaults(processor.batch);\n }\n}\n\n/**\n * Apply spec-defined defaults for periodic metric reader fields.\n */\nfunction applyPeriodicReaderDefaults(data: ConfigurationModel): void {\n for (const reader of data.meter_provider?.readers ?? []) {\n const periodic = reader.periodic as PeriodicMetricReader | undefined;\n if (!periodic) continue;\n if (periodic.interval == null) periodic.interval = 60000;\n if (periodic.timeout == null) periodic.timeout = 30000;\n if (periodic.cardinality_limits == null) {\n periodic.cardinality_limits = { default: 2000 } as CardinalityLimits;\n }\n }\n}\n\n/**\n * Apply spec-defined defaults that are not encoded in the JSON schema.\n * Both FileConfigFactory and EnvironmentConfigFactory apply the same defaults\n * so consumers see consistent behaviour regardless of config source.\n */\nfunction applyConfigDefaults(data: ConfigurationModel): void {\n if (data.disabled == null) {\n data.disabled = false;\n }\n if (data.log_level == null) {\n data.log_level = 'info';\n }\n if (data.attribute_limits == null) {\n data.attribute_limits = { attribute_count_limit: 128 };\n } else if (data.attribute_limits.attribute_count_limit == null) {\n data.attribute_limits.attribute_count_limit = 128;\n }\n}\n"]}

@@ -30,4 +30,67 @@ /**

*/
export type SeverityNumber = 'trace' | 'trace2' | 'trace3' | 'trace4' | 'debug' | 'debug2' | 'debug3' | 'debug4' | 'info' | 'info2' | 'info3' | 'info4' | 'warn' | 'warn2' | 'warn3' | 'warn4' | 'error' | 'error2' | 'error3' | 'error4' | 'fatal' | 'fatal2' | 'fatal3' | 'fatal4';
export type SeverityNumber = ('trace' | 'trace2' | 'trace3' | 'trace4' | 'debug' | 'debug2' | 'debug3' | 'debug4' | 'info' | 'info2' | 'info3' | 'info4' | 'warn' | 'warn2' | 'warn3' | 'warn4' | 'error' | 'error2' | 'error3' | 'error4' | 'fatal' | 'fatal2' | 'fatal3' | 'fatal4') | null;
/**
* Configure exporter to be OTLP with HTTP transport.
* If omitted, ignore.
*/
export type OtlpHttpExporter = {
/**
* Configure endpoint, including the signal specific path.
* If omitted or null, the http://localhost:4318/v1/{signal} (where signal is 'traces', 'logs', or 'metrics') is used.
*/
endpoint?: string | null;
tls?: HttpTls;
/**
* Configure headers. Entries have higher priority than entries from .headers_list.
* If an entry's .value is null, the entry is ignored.
* If omitted, no headers are added.
*
* @minItems 1
*/
headers?: NameStringValuePair[];
/**
* Configure headers. Entries have lower priority than entries from .headers.
* The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.
* If omitted or null, no headers are added.
*/
headers_list?: string | null;
/**
* Configure compression.
* Known values include: gzip, none. Implementations may support other compression algorithms.
* If omitted or null, none is used.
*/
compression?: string | null;
/**
* Configure max time (in milliseconds) to wait for each export.
* Value must be non-negative. A value of 0 indicates no limit (infinity).
* If omitted or null, 10000 is used.
*/
timeout?: number | null;
encoding?: OtlpHttpEncoding;
} | null;
/**
* Configure TLS settings for the exporter.
* If omitted, system default TLS settings are used.
*/
export type HttpTls = {
/**
* Configure certificate used to verify a server's TLS credentials.
* Absolute path to certificate file in PEM format.
* If omitted or null, system default certificate verification is used for secure connections.
*/
ca_file?: string | null;
/**
* Configure mTLS private client key.
* Absolute path to client key file in PEM format. If set, .client_certificate must also be set.
* If omitted or null, mTLS is not used.
*/
key_file?: string | null;
/**
* Configure mTLS client certificate.
* Absolute path to client certificate file in PEM format. If set, .client_key must also be set.
* If omitted or null, mTLS is not used.
*/
cert_file?: string | null;
} | null;
/**
* Configure the encoding used for messages.

@@ -40,4 +103,130 @@ * Implementations may not support json.

*/
export type OtlpHttpEncoding = 'protobuf' | 'json';
export type OtlpHttpEncoding = ('protobuf' | 'json') | null;
/**
* Configure exporter to be OTLP with gRPC transport.
* If omitted, ignore.
*/
export type OtlpGrpcExporter = {
/**
* Configure endpoint.
* If omitted or null, http://localhost:4317 is used.
*/
endpoint?: string | null;
tls?: GrpcTls;
/**
* Configure headers. Entries have higher priority than entries from .headers_list.
* If an entry's .value is null, the entry is ignored.
* If omitted, no headers are added.
*
* @minItems 1
*/
headers?: NameStringValuePair[];
/**
* Configure headers. Entries have lower priority than entries from .headers.
* The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.
* If omitted or null, no headers are added.
*/
headers_list?: string | null;
/**
* Configure compression.
* Known values include: gzip, none. Implementations may support other compression algorithms.
* If omitted or null, none is used.
*/
compression?: string | null;
/**
* Configure max time (in milliseconds) to wait for each export.
* Value must be non-negative. A value of 0 indicates no limit (infinity).
* If omitted or null, 10000 is used.
*/
timeout?: number | null;
} | null;
/**
* Configure TLS settings for the exporter.
* If omitted, system default TLS settings are used.
*/
export type GrpcTls = {
/**
* Configure certificate used to verify a server's TLS credentials.
* Absolute path to certificate file in PEM format.
* If omitted or null, system default certificate verification is used for secure connections.
*/
ca_file?: string | null;
/**
* Configure mTLS private client key.
* Absolute path to client key file in PEM format. If set, .client_certificate must also be set.
* If omitted or null, mTLS is not used.
*/
key_file?: string | null;
/**
* Configure mTLS client certificate.
* Absolute path to client certificate file in PEM format. If set, .client_key must also be set.
* If omitted or null, mTLS is not used.
*/
cert_file?: string | null;
/**
* Configure client transport security for the exporter's connection.
* Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure.
* If omitted or null, false is used.
*/
insecure?: boolean | null;
} | null;
/**
* Configure exporter to be OTLP with file transport.
* If omitted, ignore.
*/
export type ExperimentalOtlpFileExporter = {
/**
* Configure output stream.
* Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.
* If omitted or null, stdout is used.
*/
output_stream?: string | null;
} | null;
/**
* Configure exporter to be console.
* If omitted, ignore.
*/
export type ConsoleExporter = {} | null;
/**
* Configure exporter to be OTLP with HTTP transport.
* If omitted, ignore.
*/
export type OtlpHttpMetricExporter = {
/**
* Configure endpoint.
* If omitted or null, http://localhost:4318/v1/metrics is used.
*/
endpoint?: string | null;
tls?: HttpTls;
/**
* Configure headers. Entries have higher priority than entries from .headers_list.
* If an entry's .value is null, the entry is ignored.
* If omitted, no headers are added.
*
* @minItems 1
*/
headers?: NameStringValuePair[];
/**
* Configure headers. Entries have lower priority than entries from .headers.
* The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.
* If omitted or null, no headers are added.
*/
headers_list?: string | null;
/**
* Configure compression.
* Known values include: gzip, none. Implementations may support other compression algorithms.
* If omitted or null, none is used.
*/
compression?: string | null;
/**
* Configure max time (in milliseconds) to wait for each export.
* Value must be non-negative. A value of 0 indicates no limit (infinity).
* If omitted or null, 10000 is used.
*/
timeout?: number | null;
encoding?: OtlpHttpEncoding;
temporality_preference?: ExporterTemporalityPreference;
default_histogram_aggregation?: ExporterDefaultHistogramAggregation;
} | null;
/**
* Configure temporality preference.

@@ -50,3 +239,3 @@ * Values include:

*/
export type ExporterTemporalityPreference = 'cumulative' | 'delta' | 'low_memory';
export type ExporterTemporalityPreference = ('cumulative' | 'delta' | 'low_memory') | null;
/**

@@ -59,4 +248,99 @@ * Configure default histogram aggregation.

*/
export type ExporterDefaultHistogramAggregation = 'explicit_bucket_histogram' | 'base2_exponential_bucket_histogram';
export type ExporterDefaultHistogramAggregation = ('explicit_bucket_histogram' | 'base2_exponential_bucket_histogram') | null;
/**
* Configure exporter to be OTLP with gRPC transport.
* If omitted, ignore.
*/
export type OtlpGrpcMetricExporter = {
/**
* Configure endpoint.
* If omitted or null, http://localhost:4317 is used.
*/
endpoint?: string | null;
tls?: GrpcTls;
/**
* Configure headers. Entries have higher priority than entries from .headers_list.
* If an entry's .value is null, the entry is ignored.
* If omitted, no headers are added.
*
* @minItems 1
*/
headers?: NameStringValuePair[];
/**
* Configure headers. Entries have lower priority than entries from .headers.
* The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.
* If omitted or null, no headers are added.
*/
headers_list?: string | null;
/**
* Configure compression.
* Known values include: gzip, none. Implementations may support other compression algorithms.
* If omitted or null, none is used.
*/
compression?: string | null;
/**
* Configure max time (in milliseconds) to wait for each export.
* Value must be non-negative. A value of 0 indicates no limit (infinity).
* If omitted or null, 10000 is used.
*/
timeout?: number | null;
temporality_preference?: ExporterTemporalityPreference;
default_histogram_aggregation?: ExporterDefaultHistogramAggregation;
} | null;
/**
* Configure exporter to be OTLP with file transport.
* If omitted, ignore.
*/
export type ExperimentalOtlpFileMetricExporter = {
/**
* Configure output stream.
* Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.
* If omitted or null, stdout is used.
*/
output_stream?: string | null;
temporality_preference?: ExporterTemporalityPreference;
default_histogram_aggregation?: ExporterDefaultHistogramAggregation;
} | null;
/**
* Configure exporter to be console.
* If omitted, ignore.
*/
export type ConsoleMetricExporter = {
temporality_preference?: ExporterTemporalityPreference;
default_histogram_aggregation?: ExporterDefaultHistogramAggregation;
} | null;
/**
* Configure metric producer to be opencensus.
* If omitted, ignore.
*/
export type OpenCensusMetricProducer = {} | null;
/**
* Configure exporter to be prometheus.
* If omitted, ignore.
*/
export type ExperimentalPrometheusMetricExporter = {
/**
* Configure host.
* If omitted or null, localhost is used.
*/
host?: string | null;
/**
* Configure port.
* If omitted or null, 9464 is used.
*/
port?: number | null;
/**
* Configure Prometheus Exporter to produce metrics without scope labels.
* If omitted or null, false is used.
*/
without_scope_info?: boolean | null;
/**
* Configure Prometheus Exporter to produce metrics without a target info metric for the resource.
* If omitted or null, false is used.
*/
'without_target_info/development'?: boolean | null;
with_resource_constant_labels?: IncludeExclude;
translation_strategy?: ExperimentalPrometheusTranslationStrategy;
} | null;
/**
* Configure how metric names are translated to Prometheus metric names.

@@ -70,3 +354,3 @@ * Values include:

*/
export type ExperimentalPrometheusTranslationStrategy = 'underscore_escaping_with_suffixes' | 'underscore_escaping_without_suffixes/development' | 'no_utf8_escaping_with_suffixes/development' | 'no_translation/development';
export type ExperimentalPrometheusTranslationStrategy = ('underscore_escaping_with_suffixes' | 'underscore_escaping_without_suffixes/development' | 'no_utf8_escaping_with_suffixes/development' | 'no_translation/development') | null;
/**

@@ -84,4 +368,63 @@ * Configure instrument type selection criteria.

*/
export type InstrumentType = 'counter' | 'gauge' | 'histogram' | 'observable_counter' | 'observable_gauge' | 'observable_up_down_counter' | 'up_down_counter';
export type InstrumentType = ('counter' | 'gauge' | 'histogram' | 'observable_counter' | 'observable_gauge' | 'observable_up_down_counter' | 'up_down_counter') | null;
/**
* Configures the stream to use the instrument kind to select an aggregation and advisory parameters to influence aggregation configuration parameters. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#default-aggregation for details.
* If omitted, ignore.
*/
export type DefaultAggregation = {} | null;
/**
* Configures the stream to ignore/drop all instrument measurements. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#drop-aggregation for details.
* If omitted, ignore.
*/
export type DropAggregation = {} | null;
/**
* Configures the stream to collect data for the histogram metric point using a set of explicit boundary values for histogram bucketing. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#explicit-bucket-histogram-aggregation for details
* If omitted, ignore.
*/
export type ExplicitBucketHistogramAggregation = {
/**
* Configure bucket boundaries.
* If omitted, [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000] is used.
*
* @minItems 0
*/
boundaries?: number[];
/**
* Configure record min and max.
* If omitted or null, true is used.
*/
record_min_max?: boolean | null;
} | null;
/**
* Configures the stream to collect data for the exponential histogram metric point, which uses a base-2 exponential formula to determine bucket boundaries and an integer scale parameter to control resolution. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#base2-exponential-bucket-histogram-aggregation for details.
* If omitted, ignore.
*/
export type Base2ExponentialBucketHistogramAggregation = {
/**
* Configure the max scale factor.
* If omitted or null, 20 is used.
*/
max_scale?: number | null;
/**
* Configure the maximum number of buckets in each of the positive and negative ranges, not counting the special zero bucket.
* If omitted or null, 160 is used.
*/
max_size?: number | null;
/**
* Configure whether or not to record min and max.
* If omitted or null, true is used.
*/
record_min_max?: boolean | null;
} | null;
/**
* Configures the stream to collect data using the last measurement. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#last-value-aggregation for details.
* If omitted, ignore.
*/
export type LastValueAggregation = {} | null;
/**
* Configures the stream to collect the arithmetic sum of measurement values. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#sum-aggregation for details.
* If omitted, ignore.
*/
export type SumAggregation = {} | null;
/**
* Configure the exemplar filter.

@@ -94,6 +437,123 @@ * Values include:

*/
export type ExemplarFilter = 'always_on' | 'always_off' | 'trace_based';
export type SpanKind = 'internal' | 'server' | 'client' | 'producer' | 'consumer';
export type ExperimentalSpanParent = 'none' | 'remote' | 'local';
export type ExemplarFilter = ('always_on' | 'always_off' | 'trace_based') | null;
/**
* Include the w3c trace context propagator.
* If omitted, ignore.
*/
export type TraceContextPropagator = {} | null;
/**
* Include the w3c baggage propagator.
* If omitted, ignore.
*/
export type BaggagePropagator = {} | null;
/**
* Include the zipkin b3 propagator.
* If omitted, ignore.
*/
export type B3Propagator = {} | null;
/**
* Include the zipkin b3 multi propagator.
* If omitted, ignore.
*/
export type B3MultiPropagator = {} | null;
/**
* Configure sampler to be always_off.
* If omitted, ignore.
*/
export type AlwaysOffSampler = {} | null;
/**
* Configure sampler to be always_on.
* If omitted, ignore.
*/
export type AlwaysOnSampler = {} | null;
/**
* Configure sampler to be always_off.
* If omitted, ignore.
*/
export type ExperimentalComposableAlwaysOffSampler = {} | null;
/**
* Configure sampler to be always_on.
* If omitted, ignore.
*/
export type ExperimentalComposableAlwaysOnSampler = {} | null;
/**
* Configure sampler to be probability.
* If omitted, ignore.
*/
export type ExperimentalComposableProbabilitySampler = {
/**
* Configure ratio.
* If omitted or null, 1.0 is used.
*/
ratio?: number | null;
} | null;
/**
* Configure sampler to be rule_based.
* If omitted, ignore.
*/
export type ExperimentalComposableRuleBasedSampler = {
/**
* The rules for the sampler, matched in order.
* Each rule can have multiple match conditions. All conditions must match for the rule to match.
* If no conditions are specified, the rule matches all spans that reach it.
* If no rules match, the span is not sampled.
* If omitted, no span is sampled.
*
* @minItems 1
*/
rules?: ExperimentalComposableRuleBasedSamplerRule[];
} | null;
export type SpanKind = ('internal' | 'server' | 'client' | 'producer' | 'consumer') | null;
export type ExperimentalSpanParent = ('none' | 'remote' | 'local') | null;
/**
* Configure sampler to be jaeger_remote.
* If omitted, ignore.
*/
export type ExperimentalJaegerRemoteSampler = {
/**
* Configure the endpoint of the jaeger remote sampling service.
* Property is required and must be non-null.
*/
endpoint: string;
/**
* Configure the polling interval (in milliseconds) to fetch from the remote sampling service.
* If omitted or null, 60000 is used.
*/
interval?: number | null;
initial_sampler: Sampler;
} | null;
/**
* Configure sampler to be parent_based.
* If omitted, ignore.
*/
export type ParentBasedSampler = {
root?: Sampler;
remote_parent_sampled?: Sampler;
remote_parent_not_sampled?: Sampler;
local_parent_sampled?: Sampler;
local_parent_not_sampled?: Sampler;
} | null;
/**
* Configure sampler to be probability.
* If omitted, ignore.
*/
export type ExperimentalProbabilitySampler = {
/**
* Configure ratio.
* If omitted or null, 1.0 is used.
*/
ratio?: number | null;
} | null;
/**
* Configure sampler to be trace_id_ratio_based.
* If omitted, ignore.
*/
export type TraceIdRatioBasedSampler = {
/**
* Configure trace_id_ratio.
* If omitted or null, 1.0 is used.
*/
ratio?: number | null;
} | null;
/**
* The attribute type.

@@ -111,3 +571,23 @@ * Values include:

*/
export type AttributeType = 'string' | 'bool' | 'int' | 'double' | 'string_array' | 'bool_array' | 'int_array' | 'double_array';
export type AttributeType = ('string' | 'bool' | 'int' | 'double' | 'string_array' | 'bool_array' | 'int_array' | 'double_array') | null;
/**
* Enable the container resource detector, which populates container.* attributes.
* If omitted, ignore.
*/
export type ExperimentalContainerResourceDetector = {} | null;
/**
* Enable the host resource detector, which populates host.* and os.* attributes.
* If omitted, ignore.
*/
export type ExperimentalHostResourceDetector = {} | null;
/**
* Enable the process resource detector, which populates process.* attributes.
* If omitted, ignore.
*/
export type ExperimentalProcessResourceDetector = {} | null;
/**
* Enable the service detector, which populates service.name based on the OTEL_SERVICE_NAME environment variable and service.instance.id.
* If omitted, ignore.
*/
export type ExperimentalServiceResourceDetector = {} | null;
export interface ConfigurationModel {

@@ -126,3 +606,3 @@ /**

*/
disabled?: boolean;
disabled?: boolean | null;
log_level?: SeverityNumber;

@@ -149,3 +629,3 @@ attribute_limits?: AttributeLimits;

*/
attribute_value_length_limit?: number;
attribute_value_length_limit?: number | null;
/**

@@ -156,3 +636,3 @@ * Configure max attribute count.

*/
attribute_count_limit?: number;
attribute_count_limit?: number | null;
}

@@ -177,3 +657,3 @@ /**

simple?: SimpleLogRecordProcessor;
[k: string]: object | undefined;
[k: string]: object | null | undefined;
}

@@ -190,3 +670,3 @@ /**

*/
schedule_delay?: number;
schedule_delay?: number | null;
/**

@@ -197,3 +677,3 @@ * Configure maximum allowed time (in milliseconds) to export data.

*/
export_timeout?: number;
export_timeout?: number | null;
/**

@@ -203,3 +683,3 @@ * Configure maximum queue size. Value must be positive.

*/
max_queue_size?: number;
max_queue_size?: number | null;
/**

@@ -209,3 +689,3 @@ * Configure maximum batch size. Value must be positive.

*/
max_export_batch_size?: number;
max_export_batch_size?: number | null;
exporter: LogRecordExporter;

@@ -222,67 +702,4 @@ }

console?: ConsoleExporter;
[k: string]: object | undefined;
[k: string]: object | null | undefined;
}
/**
* Configure exporter to be OTLP with HTTP transport.
* If omitted, ignore.
*/
export interface OtlpHttpExporter {
/**
* Configure endpoint, including the signal specific path.
* If omitted or null, the http://localhost:4318/v1/{signal} (where signal is 'traces', 'logs', or 'metrics') is used.
*/
endpoint?: string;
tls?: HttpTls;
/**
* Configure headers. Entries have higher priority than entries from .headers_list.
* If an entry's .value is null, the entry is ignored.
* If omitted, no headers are added.
*
* @minItems 1
*/
headers?: NameStringValuePair[];
/**
* Configure headers. Entries have lower priority than entries from .headers.
* The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.
* If omitted or null, no headers are added.
*/
headers_list?: string;
/**
* Configure compression.
* Known values include: gzip, none. Implementations may support other compression algorithms.
* If omitted or null, none is used.
*/
compression?: string;
/**
* Configure max time (in milliseconds) to wait for each export.
* Value must be non-negative. A value of 0 indicates no limit (infinity).
* If omitted or null, 10000 is used.
*/
timeout?: number;
encoding?: OtlpHttpEncoding;
}
/**
* Configure TLS settings for the exporter.
* If omitted, system default TLS settings are used.
*/
export interface HttpTls {
/**
* Configure certificate used to verify a server's TLS credentials.
* Absolute path to certificate file in PEM format.
* If omitted or null, system default certificate verification is used for secure connections.
*/
ca_file?: string;
/**
* Configure mTLS private client key.
* Absolute path to client key file in PEM format. If set, .client_certificate must also be set.
* If omitted or null, mTLS is not used.
*/
key_file?: string;
/**
* Configure mTLS client certificate.
* Absolute path to client certificate file in PEM format. If set, .client_key must also be set.
* If omitted or null, mTLS is not used.
*/
cert_file?: string;
}
export interface NameStringValuePair {

@@ -298,91 +715,5 @@ /**

*/
value: string;
value: string | null;
}
/**
* Configure exporter to be OTLP with gRPC transport.
* If omitted, ignore.
*/
export interface OtlpGrpcExporter {
/**
* Configure endpoint.
* If omitted or null, http://localhost:4317 is used.
*/
endpoint?: string;
tls?: GrpcTls;
/**
* Configure headers. Entries have higher priority than entries from .headers_list.
* If an entry's .value is null, the entry is ignored.
* If omitted, no headers are added.
*
* @minItems 1
*/
headers?: NameStringValuePair[];
/**
* Configure headers. Entries have lower priority than entries from .headers.
* The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.
* If omitted or null, no headers are added.
*/
headers_list?: string;
/**
* Configure compression.
* Known values include: gzip, none. Implementations may support other compression algorithms.
* If omitted or null, none is used.
*/
compression?: string;
/**
* Configure max time (in milliseconds) to wait for each export.
* Value must be non-negative. A value of 0 indicates no limit (infinity).
* If omitted or null, 10000 is used.
*/
timeout?: number;
}
/**
* Configure TLS settings for the exporter.
* If omitted, system default TLS settings are used.
*/
export interface GrpcTls {
/**
* Configure certificate used to verify a server's TLS credentials.
* Absolute path to certificate file in PEM format.
* If omitted or null, system default certificate verification is used for secure connections.
*/
ca_file?: string;
/**
* Configure mTLS private client key.
* Absolute path to client key file in PEM format. If set, .client_certificate must also be set.
* If omitted or null, mTLS is not used.
*/
key_file?: string;
/**
* Configure mTLS client certificate.
* Absolute path to client certificate file in PEM format. If set, .client_key must also be set.
* If omitted or null, mTLS is not used.
*/
cert_file?: string;
/**
* Configure client transport security for the exporter's connection.
* Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure.
* If omitted or null, false is used.
*/
insecure?: boolean;
}
/**
* Configure exporter to be OTLP with file transport.
* If omitted, ignore.
*/
export interface ExperimentalOtlpFileExporter {
/**
* Configure output stream.
* Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.
* If omitted or null, stdout is used.
*/
output_stream?: string;
}
/**
* Configure exporter to be console.
* If omitted, ignore.
*/
export interface ConsoleExporter {
}
/**
* Configure a simple log record processor.

@@ -404,3 +735,3 @@ * If omitted, ignore.

*/
attribute_value_length_limit?: number;
attribute_value_length_limit?: number | null;
/**

@@ -411,3 +742,3 @@ * Configure max attribute count. Overrides .attribute_limits.attribute_count_limit.

*/
attribute_count_limit?: number;
attribute_count_limit?: number | null;
}

@@ -437,3 +768,3 @@ /**

*/
enabled?: boolean;
enabled?: boolean | null;
minimum_severity?: SeverityNumber;

@@ -445,3 +776,3 @@ /**

*/
trace_based?: boolean;
trace_based?: boolean | null;
}

@@ -496,3 +827,3 @@ export interface ExperimentalLoggerMatcherAndConfig {

*/
interval?: number;
interval?: number | null;
/**

@@ -503,3 +834,3 @@ * Configure maximum allowed time (in milliseconds) to export data.

*/
timeout?: number;
timeout?: number | null;
exporter: PushMetricExporter;

@@ -524,118 +855,9 @@ /**

console?: ConsoleMetricExporter;
[k: string]: object | undefined;
[k: string]: object | null | undefined;
}
/**
* Configure exporter to be OTLP with HTTP transport.
* If omitted, ignore.
*/
export interface OtlpHttpMetricExporter {
/**
* Configure endpoint.
* If omitted or null, http://localhost:4318/v1/metrics is used.
*/
endpoint?: string;
tls?: HttpTls;
/**
* Configure headers. Entries have higher priority than entries from .headers_list.
* If an entry's .value is null, the entry is ignored.
* If omitted, no headers are added.
*
* @minItems 1
*/
headers?: NameStringValuePair[];
/**
* Configure headers. Entries have lower priority than entries from .headers.
* The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.
* If omitted or null, no headers are added.
*/
headers_list?: string;
/**
* Configure compression.
* Known values include: gzip, none. Implementations may support other compression algorithms.
* If omitted or null, none is used.
*/
compression?: string;
/**
* Configure max time (in milliseconds) to wait for each export.
* Value must be non-negative. A value of 0 indicates no limit (infinity).
* If omitted or null, 10000 is used.
*/
timeout?: number;
encoding?: OtlpHttpEncoding;
temporality_preference?: ExporterTemporalityPreference;
default_histogram_aggregation?: ExporterDefaultHistogramAggregation;
}
/**
* Configure exporter to be OTLP with gRPC transport.
* If omitted, ignore.
*/
export interface OtlpGrpcMetricExporter {
/**
* Configure endpoint.
* If omitted or null, http://localhost:4317 is used.
*/
endpoint?: string;
tls?: GrpcTls;
/**
* Configure headers. Entries have higher priority than entries from .headers_list.
* If an entry's .value is null, the entry is ignored.
* If omitted, no headers are added.
*
* @minItems 1
*/
headers?: NameStringValuePair[];
/**
* Configure headers. Entries have lower priority than entries from .headers.
* The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.
* If omitted or null, no headers are added.
*/
headers_list?: string;
/**
* Configure compression.
* Known values include: gzip, none. Implementations may support other compression algorithms.
* If omitted or null, none is used.
*/
compression?: string;
/**
* Configure max time (in milliseconds) to wait for each export.
* Value must be non-negative. A value of 0 indicates no limit (infinity).
* If omitted or null, 10000 is used.
*/
timeout?: number;
temporality_preference?: ExporterTemporalityPreference;
default_histogram_aggregation?: ExporterDefaultHistogramAggregation;
}
/**
* Configure exporter to be OTLP with file transport.
* If omitted, ignore.
*/
export interface ExperimentalOtlpFileMetricExporter {
/**
* Configure output stream.
* Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.
* If omitted or null, stdout is used.
*/
output_stream?: string;
temporality_preference?: ExporterTemporalityPreference;
default_histogram_aggregation?: ExporterDefaultHistogramAggregation;
}
/**
* Configure exporter to be console.
* If omitted, ignore.
*/
export interface ConsoleMetricExporter {
temporality_preference?: ExporterTemporalityPreference;
default_histogram_aggregation?: ExporterDefaultHistogramAggregation;
}
export interface MetricProducer {
opencensus?: OpenCensusMetricProducer;
[k: string]: object | undefined;
[k: string]: object | null | undefined;
}
/**
* Configure metric producer to be opencensus.
* If omitted, ignore.
*/
export interface OpenCensusMetricProducer {
}
/**
* Configure cardinality limits.

@@ -650,3 +872,3 @@ * If omitted, default values as described in CardinalityLimits are used.

*/
default?: number;
default?: number | null;
/**

@@ -656,3 +878,3 @@ * Configure default cardinality limit for counter instruments.

*/
counter?: number;
counter?: number | null;
/**

@@ -662,3 +884,3 @@ * Configure default cardinality limit for gauge instruments.

*/
gauge?: number;
gauge?: number | null;
/**

@@ -668,3 +890,3 @@ * Configure default cardinality limit for histogram instruments.

*/
histogram?: number;
histogram?: number | null;
/**

@@ -674,3 +896,3 @@ * Configure default cardinality limit for observable_counter instruments.

*/
observable_counter?: number;
observable_counter?: number | null;
/**

@@ -680,3 +902,3 @@ * Configure default cardinality limit for observable_gauge instruments.

*/
observable_gauge?: number;
observable_gauge?: number | null;
/**

@@ -686,3 +908,3 @@ * Configure default cardinality limit for observable_up_down_counter instruments.

*/
observable_up_down_counter?: number;
observable_up_down_counter?: number | null;
/**

@@ -692,3 +914,3 @@ * Configure default cardinality limit for up_down_counter instruments.

*/
up_down_counter?: number;
up_down_counter?: number | null;
}

@@ -716,33 +938,5 @@ /**

'prometheus/development'?: ExperimentalPrometheusMetricExporter;
[k: string]: object | undefined;
[k: string]: object | null | undefined;
}
/**
* Configure exporter to be prometheus.
* If omitted, ignore.
*/
export interface ExperimentalPrometheusMetricExporter {
/**
* Configure host.
* If omitted or null, localhost is used.
*/
host?: string;
/**
* Configure port.
* If omitted or null, 9464 is used.
*/
port?: number;
/**
* Configure Prometheus Exporter to produce metrics without scope labels.
* If omitted or null, false is used.
*/
without_scope_info?: boolean;
/**
* Configure Prometheus Exporter to produce metrics without a target info metric for the resource.
* If omitted or null, false is used.
*/
'without_target_info/development'?: boolean;
with_resource_constant_labels?: IncludeExclude;
translation_strategy?: ExperimentalPrometheusTranslationStrategy;
}
/**
* Configure Prometheus Exporter to add resource attributes as metrics attributes, where the resource attribute keys match the patterns.

@@ -787,3 +981,3 @@ * If omitted, no resource attributes are added.

*/
instrument_name?: string;
instrument_name?: string | null;
instrument_type?: InstrumentType;

@@ -794,3 +988,3 @@ /**

*/
unit?: string;
unit?: string | null;
/**

@@ -800,3 +994,3 @@ * Configure meter name selection criteria.

*/
meter_name?: string;
meter_name?: string | null;
/**

@@ -806,3 +1000,3 @@ * Configure meter version selection criteria.

*/
meter_version?: string;
meter_version?: string | null;
/**

@@ -812,3 +1006,3 @@ * Configure meter schema url selection criteria.

*/
meter_schema_url?: string;
meter_schema_url?: string | null;
}

@@ -824,3 +1018,3 @@ /**

*/
name?: string;
name?: string | null;
/**

@@ -830,3 +1024,3 @@ * Configure metric description of the resulting stream(s).

*/
description?: string;
description?: string | null;
aggregation?: Aggregation;

@@ -837,3 +1031,3 @@ /**

*/
aggregation_cardinality_limit?: number;
aggregation_cardinality_limit?: number | null;
attribute_keys?: IncludeExclude;

@@ -854,65 +1048,2 @@ }

/**
* Configures the stream to use the instrument kind to select an aggregation and advisory parameters to influence aggregation configuration parameters. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#default-aggregation for details.
* If omitted, ignore.
*/
export interface DefaultAggregation {
}
/**
* Configures the stream to ignore/drop all instrument measurements. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#drop-aggregation for details.
* If omitted, ignore.
*/
export interface DropAggregation {
}
/**
* Configures the stream to collect data for the histogram metric point using a set of explicit boundary values for histogram bucketing. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#explicit-bucket-histogram-aggregation for details
* If omitted, ignore.
*/
export interface ExplicitBucketHistogramAggregation {
/**
* Configure bucket boundaries.
* If omitted, [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000] is used.
*
* @minItems 0
*/
boundaries?: number[];
/**
* Configure record min and max.
* If omitted or null, true is used.
*/
record_min_max?: boolean;
}
/**
* Configures the stream to collect data for the exponential histogram metric point, which uses a base-2 exponential formula to determine bucket boundaries and an integer scale parameter to control resolution. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#base2-exponential-bucket-histogram-aggregation for details.
* If omitted, ignore.
*/
export interface Base2ExponentialBucketHistogramAggregation {
/**
* Configure the max scale factor.
* If omitted or null, 20 is used.
*/
max_scale?: number;
/**
* Configure the maximum number of buckets in each of the positive and negative ranges, not counting the special zero bucket.
* If omitted or null, 160 is used.
*/
max_size?: number;
/**
* Configure whether or not to record min and max.
* If omitted or null, true is used.
*/
record_min_max?: boolean;
}
/**
* Configures the stream to collect data using the last measurement. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#last-value-aggregation for details.
* If omitted, ignore.
*/
export interface LastValueAggregation {
}
/**
* Configures the stream to collect the arithmetic sum of measurement values. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#sum-aggregation for details.
* If omitted, ignore.
*/
export interface SumAggregation {
}
/**
* Configure meters.

@@ -972,3 +1103,3 @@ * If omitted, all meters use default values as described in ExperimentalMeterConfig.

*/
composite_list?: string;
composite_list?: string | null;
}

@@ -980,29 +1111,5 @@ export interface TextMapPropagator {

b3multi?: B3MultiPropagator;
[k: string]: object | undefined;
[k: string]: object | null | undefined;
}
/**
* Include the w3c trace context propagator.
* If omitted, ignore.
*/
export interface TraceContextPropagator {
}
/**
* Include the w3c baggage propagator.
* If omitted, ignore.
*/
export interface BaggagePropagator {
}
/**
* Include the zipkin b3 propagator.
* If omitted, ignore.
*/
export interface B3Propagator {
}
/**
* Include the zipkin b3 multi propagator.
* If omitted, ignore.
*/
export interface B3MultiPropagator {
}
/**
* Configure tracer provider.

@@ -1026,3 +1133,3 @@ * If omitted, a noop tracer provider is used.

simple?: SimpleSpanProcessor;
[k: string]: object | undefined;
[k: string]: object | null | undefined;
}

@@ -1039,3 +1146,3 @@ /**

*/
schedule_delay?: number;
schedule_delay?: number | null;
/**

@@ -1046,3 +1153,3 @@ * Configure maximum allowed time (in milliseconds) to export data.

*/
export_timeout?: number;
export_timeout?: number | null;
/**

@@ -1052,3 +1159,3 @@ * Configure maximum queue size. Value must be positive.

*/
max_queue_size?: number;
max_queue_size?: number | null;
/**

@@ -1058,3 +1165,3 @@ * Configure maximum batch size. Value must be positive.

*/
max_export_batch_size?: number;
max_export_batch_size?: number | null;
exporter: SpanExporter;

@@ -1071,3 +1178,3 @@ }

console?: ConsoleExporter;
[k: string]: object | undefined;
[k: string]: object | null | undefined;
}

@@ -1091,3 +1198,3 @@ /**

*/
attribute_value_length_limit?: number;
attribute_value_length_limit?: number | null;
/**

@@ -1098,3 +1205,3 @@ * Configure max attribute count. Overrides .attribute_limits.attribute_count_limit.

*/
attribute_count_limit?: number;
attribute_count_limit?: number | null;
/**

@@ -1105,3 +1212,3 @@ * Configure max span event count.

*/
event_count_limit?: number;
event_count_limit?: number | null;
/**

@@ -1112,3 +1219,3 @@ * Configure max span link count.

*/
link_count_limit?: number;
link_count_limit?: number | null;
/**

@@ -1119,3 +1226,3 @@ * Configure max attributes per span event.

*/
event_attribute_count_limit?: number;
event_attribute_count_limit?: number | null;
/**

@@ -1126,3 +1233,3 @@ * Configure max attributes per span link.

*/
link_attribute_count_limit?: number;
link_attribute_count_limit?: number | null;
}

@@ -1141,17 +1248,5 @@ /**

trace_id_ratio_based?: TraceIdRatioBasedSampler;
[k: string]: object | undefined;
[k: string]: object | null | undefined;
}
/**
* Configure sampler to be always_off.
* If omitted, ignore.
*/
export interface AlwaysOffSampler {
}
/**
* Configure sampler to be always_on.
* If omitted, ignore.
*/
export interface AlwaysOnSampler {
}
/**
* Configure sampler to be composite.

@@ -1166,17 +1261,5 @@ * If omitted, ignore.

rule_based?: ExperimentalComposableRuleBasedSampler;
[k: string]: object | undefined;
[k: string]: object | null | undefined;
}
/**
* Configure sampler to be always_off.
* If omitted, ignore.
*/
export interface ExperimentalComposableAlwaysOffSampler {
}
/**
* Configure sampler to be always_on.
* If omitted, ignore.
*/
export interface ExperimentalComposableAlwaysOnSampler {
}
/**
* Configure sampler to be parent_threshold.

@@ -1189,29 +1272,2 @@ * If omitted, ignore.

/**
* Configure sampler to be probability.
* If omitted, ignore.
*/
export interface ExperimentalComposableProbabilitySampler {
/**
* Configure ratio.
* If omitted or null, 1.0 is used.
*/
ratio?: number;
}
/**
* Configure sampler to be rule_based.
* If omitted, ignore.
*/
export interface ExperimentalComposableRuleBasedSampler {
/**
* The rules for the sampler, matched in order.
* Each rule can have multiple match conditions. All conditions must match for the rule to match.
* If no conditions are specified, the rule matches all spans that reach it.
* If no rules match, the span is not sampled.
* If omitted, no span is sampled.
*
* @minItems 1
*/
rules?: ExperimentalComposableRuleBasedSamplerRule[];
}
/**
* A rule for ExperimentalComposableRuleBasedSampler. A rule can have multiple match conditions - the sampler will be applied if all match.

@@ -1303,52 +1359,2 @@ * If no conditions are specified, the rule matches all spans that reach it.

/**
* Configure sampler to be jaeger_remote.
* If omitted, ignore.
*/
export interface ExperimentalJaegerRemoteSampler {
/**
* Configure the endpoint of the jaeger remote sampling service.
* Property is required and must be non-null.
*/
endpoint: string;
/**
* Configure the polling interval (in milliseconds) to fetch from the remote sampling service.
* If omitted or null, 60000 is used.
*/
interval?: number;
initial_sampler: Sampler;
}
/**
* Configure sampler to be parent_based.
* If omitted, ignore.
*/
export interface ParentBasedSampler {
root?: Sampler;
remote_parent_sampled?: Sampler;
remote_parent_not_sampled?: Sampler;
local_parent_sampled?: Sampler;
local_parent_not_sampled?: Sampler;
}
/**
* Configure sampler to be probability.
* If omitted, ignore.
*/
export interface ExperimentalProbabilitySampler {
/**
* Configure ratio.
* If omitted or null, 1.0 is used.
*/
ratio?: number;
}
/**
* Configure sampler to be trace_id_ratio_based.
* If omitted, ignore.
*/
export interface TraceIdRatioBasedSampler {
/**
* Configure trace_id_ratio.
* If omitted or null, 1.0 is used.
*/
ratio?: number;
}
/**
* Configure tracers.

@@ -1406,3 +1412,3 @@ * If omitted, all tracers use default values as described in ExperimentalTracerConfig.

*/
schema_url?: string;
schema_url?: string | null;
/**

@@ -1413,3 +1419,3 @@ * Configure resource attributes. Entries have lower priority than entries from .resource.attributes.

*/
attributes_list?: string;
attributes_list?: string | null;
}

@@ -1427,3 +1433,3 @@ export interface AttributeNameValue {

*/
value: string | number | boolean | string[] | boolean[] | number[];
value: string | number | boolean | null | string[] | boolean[] | number[];
type?: AttributeType;

@@ -1451,29 +1457,5 @@ }

service?: ExperimentalServiceResourceDetector;
[k: string]: object | undefined;
[k: string]: object | null | undefined;
}
/**
* Enable the container resource detector, which populates container.* attributes.
* If omitted, ignore.
*/
export interface ExperimentalContainerResourceDetector {
}
/**
* Enable the host resource detector, which populates host.* and os.* attributes.
* If omitted, ignore.
*/
export interface ExperimentalHostResourceDetector {
}
/**
* Enable the process resource detector, which populates process.* attributes.
* If omitted, ignore.
*/
export interface ExperimentalProcessResourceDetector {
}
/**
* Enable the service detector, which populates service.name based on the OTEL_SERVICE_NAME environment variable and service.instance.id.
* If omitted, ignore.
*/
export interface ExperimentalServiceResourceDetector {
}
/**
* Configure instrumentation.

@@ -1539,3 +1521,3 @@ * If omitted, instrumentation defaults are used.

*/
stability_opt_in_list?: string;
stability_opt_in_list?: string | null;
}

@@ -1565,3 +1547,3 @@ /**

*/
version?: number;
version?: number | null;
/**

@@ -1571,3 +1553,3 @@ * Use latest experimental semantic conventions (before stable is available or to enable experimental features on top of stable conventions).

*/
experimental?: boolean;
experimental?: boolean | null;
/**

@@ -1580,3 +1562,3 @@ * When true, also emit the previous major version alongside the target version.

*/
dual_emit?: boolean;
dual_emit?: boolean | null;
}

@@ -1583,0 +1565,0 @@ /**

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

{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/generated/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,EAAE;AACF,+BAA+B;AAC/B,wDAAwD;AACxD,8CAA8C;AAC9C,EAAE;AACF,gGAAgG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n//\n// AUTO-GENERATED — do not edit\n// Generated from opentelemetry-configuration.git v1.0.0\n// Run `npm run generate:config` to regenerate\n//\n/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-empty-object-type */\n\n/**\n * Configure the log level of the internal logger used by the SDK.\n * Values include:\n * * debug: debug, severity number 5.\n * * debug2: debug2, severity number 6.\n * * debug3: debug3, severity number 7.\n * * debug4: debug4, severity number 8.\n * * error: error, severity number 17.\n * * error2: error2, severity number 18.\n * * error3: error3, severity number 19.\n * * error4: error4, severity number 20.\n * * fatal: fatal, severity number 21.\n * * fatal2: fatal2, severity number 22.\n * * fatal3: fatal3, severity number 23.\n * * fatal4: fatal4, severity number 24.\n * * info: info, severity number 9.\n * * info2: info2, severity number 10.\n * * info3: info3, severity number 11.\n * * info4: info4, severity number 12.\n * * trace: trace, severity number 1.\n * * trace2: trace2, severity number 2.\n * * trace3: trace3, severity number 3.\n * * trace4: trace4, severity number 4.\n * * warn: warn, severity number 13.\n * * warn2: warn2, severity number 14.\n * * warn3: warn3, severity number 15.\n * * warn4: warn4, severity number 16.\n * If omitted, INFO is used.\n */\nexport type SeverityNumber =\n | 'trace'\n | 'trace2'\n | 'trace3'\n | 'trace4'\n | 'debug'\n | 'debug2'\n | 'debug3'\n | 'debug4'\n | 'info'\n | 'info2'\n | 'info3'\n | 'info4'\n | 'warn'\n | 'warn2'\n | 'warn3'\n | 'warn4'\n | 'error'\n | 'error2'\n | 'error3'\n | 'error4'\n | 'fatal'\n | 'fatal2'\n | 'fatal3'\n | 'fatal4';\n\n/**\n * Configure the encoding used for messages.\n * Implementations may not support json.\n * Values include:\n * * json: Protobuf JSON encoding.\n * * protobuf: Protobuf binary encoding.\n * If omitted, protobuf is used.\n */\nexport type OtlpHttpEncoding = 'protobuf' | 'json';\n\n/**\n * Configure temporality preference.\n * Values include:\n * * cumulative: Use cumulative aggregation temporality for all instrument types.\n * * delta: Use delta aggregation for all instrument types except up down counter and asynchronous up down counter.\n * * low_memory: Use delta aggregation temporality for counter and histogram instrument types. Use cumulative aggregation temporality for all other instrument types.\n * If omitted, cumulative is used.\n */\nexport type ExporterTemporalityPreference =\n | 'cumulative'\n | 'delta'\n | 'low_memory';\n\n/**\n * Configure default histogram aggregation.\n * Values include:\n * * base2_exponential_bucket_histogram: Use base2 exponential histogram as the default aggregation for histogram instruments.\n * * explicit_bucket_histogram: Use explicit bucket histogram as the default aggregation for histogram instruments.\n * If omitted, explicit_bucket_histogram is used.\n */\nexport type ExporterDefaultHistogramAggregation =\n | 'explicit_bucket_histogram'\n | 'base2_exponential_bucket_histogram';\n\n/**\n * Configure how metric names are translated to Prometheus metric names.\n * Values include:\n * * no_translation/development: Special character escaping is disabled. Type and unit suffixes are disabled. Metric names are unaltered.\n * * no_utf8_escaping_with_suffixes/development: Special character escaping is disabled. Type and unit suffixes are enabled.\n * * underscore_escaping_with_suffixes: Special character escaping is enabled. Type and unit suffixes are enabled.\n * * underscore_escaping_without_suffixes/development: Special character escaping is enabled. Type and unit suffixes are disabled. This represents classic Prometheus metric name compatibility.\n * If omitted, underscore_escaping_with_suffixes is used.\n */\nexport type ExperimentalPrometheusTranslationStrategy =\n | 'underscore_escaping_with_suffixes'\n | 'underscore_escaping_without_suffixes/development'\n | 'no_utf8_escaping_with_suffixes/development'\n | 'no_translation/development';\n\n/**\n * Configure instrument type selection criteria.\n * Values include:\n * * counter: Synchronous counter instruments.\n * * gauge: Synchronous gauge instruments.\n * * histogram: Synchronous histogram instruments.\n * * observable_counter: Asynchronous counter instruments.\n * * observable_gauge: Asynchronous gauge instruments.\n * * observable_up_down_counter: Asynchronous up down counter instruments.\n * * up_down_counter: Synchronous up down counter instruments.\n * If omitted, all instrument types match.\n */\nexport type InstrumentType =\n | 'counter'\n | 'gauge'\n | 'histogram'\n | 'observable_counter'\n | 'observable_gauge'\n | 'observable_up_down_counter'\n | 'up_down_counter';\n\n/**\n * Configure the exemplar filter.\n * Values include:\n * * always_off: ExemplarFilter which makes no measurements eligible for being an Exemplar.\n * * always_on: ExemplarFilter which makes all measurements eligible for being an Exemplar.\n * * trace_based: ExemplarFilter which makes measurements recorded in the context of a sampled parent span eligible for being an Exemplar.\n * If omitted, trace_based is used.\n */\nexport type ExemplarFilter = 'always_on' | 'always_off' | 'trace_based';\n\nexport type SpanKind =\n | 'internal'\n | 'server'\n | 'client'\n | 'producer'\n | 'consumer';\n\nexport type ExperimentalSpanParent = 'none' | 'remote' | 'local';\n\n/**\n * The attribute type.\n * Values include:\n * * bool: Boolean attribute value.\n * * bool_array: Boolean array attribute value.\n * * double: Double attribute value.\n * * double_array: Double array attribute value.\n * * int: Integer attribute value.\n * * int_array: Integer array attribute value.\n * * string: String attribute value.\n * * string_array: String array attribute value.\n * If omitted, string is used.\n */\nexport type AttributeType =\n | 'string'\n | 'bool'\n | 'int'\n | 'double'\n | 'string_array'\n | 'bool_array'\n | 'int_array'\n | 'double_array';\n\nexport interface ConfigurationModel {\n /**\n * The file format version.\n * Represented as a string including the semver major, minor version numbers (and optionally the meta tag). For example: \"0.4\", \"1.0-rc.2\", \"1.0\" (after stable release).\n * See https://github.com/open-telemetry/opentelemetry-configuration/blob/main/VERSIONING.md for more details.\n * The yaml format is documented at https://github.com/open-telemetry/opentelemetry-configuration/tree/main/schema\n * Property is required and must be non-null.\n */\n file_format?: string;\n /**\n * Configure if the SDK is disabled or not.\n * If omitted or null, false is used.\n */\n disabled?: boolean;\n log_level?: SeverityNumber;\n attribute_limits?: AttributeLimits;\n logger_provider?: LoggerProvider;\n meter_provider?: MeterProvider;\n propagator?: Propagator;\n tracer_provider?: TracerProvider;\n resource?: Resource;\n 'instrumentation/development'?: ExperimentalInstrumentation;\n distribution?: Distribution;\n [k: string]: any;\n}\n\n/**\n * Configure general attribute limits. See also tracer_provider.limits, logger_provider.limits.\n * If omitted, default values as described in AttributeLimits are used.\n */\nexport interface AttributeLimits {\n /**\n * Configure max attribute value size.\n * Value must be non-negative.\n * If omitted or null, there is no limit.\n */\n attribute_value_length_limit?: number;\n /**\n * Configure max attribute count.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n attribute_count_limit?: number;\n}\n\n/**\n * Configure logger provider.\n * If omitted, a noop logger provider is used.\n */\nexport interface LoggerProvider {\n /**\n * Configure log record processors.\n * Property is required and must be non-null.\n *\n * @minItems 1\n */\n processors: LogRecordProcessor[];\n limits?: LogRecordLimits;\n 'logger_configurator/development'?: ExperimentalLoggerConfigurator;\n}\n\nexport interface LogRecordProcessor {\n batch?: BatchLogRecordProcessor;\n simple?: SimpleLogRecordProcessor;\n [k: string]: object | undefined;\n}\n\n/**\n * Configure a batch log record processor.\n * If omitted, ignore.\n */\nexport interface BatchLogRecordProcessor {\n /**\n * Configure delay interval (in milliseconds) between two consecutive exports.\n * Value must be non-negative.\n * If omitted or null, 1000 is used.\n */\n schedule_delay?: number;\n /**\n * Configure maximum allowed time (in milliseconds) to export data.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 30000 is used.\n */\n export_timeout?: number;\n /**\n * Configure maximum queue size. Value must be positive.\n * If omitted or null, 2048 is used.\n */\n max_queue_size?: number;\n /**\n * Configure maximum batch size. Value must be positive.\n * If omitted or null, 512 is used.\n */\n max_export_batch_size?: number;\n exporter: LogRecordExporter;\n}\n\n/**\n * Configure exporter.\n * Property is required and must be non-null.\n */\nexport interface LogRecordExporter {\n otlp_http?: OtlpHttpExporter;\n otlp_grpc?: OtlpGrpcExporter;\n 'otlp_file/development'?: ExperimentalOtlpFileExporter;\n console?: ConsoleExporter;\n [k: string]: object | undefined;\n}\n\n/**\n * Configure exporter to be OTLP with HTTP transport.\n * If omitted, ignore.\n */\nexport interface OtlpHttpExporter {\n /**\n * Configure endpoint, including the signal specific path.\n * If omitted or null, the http://localhost:4318/v1/{signal} (where signal is 'traces', 'logs', or 'metrics') is used.\n */\n endpoint?: string;\n tls?: HttpTls;\n /**\n * Configure headers. Entries have higher priority than entries from .headers_list.\n * If an entry's .value is null, the entry is ignored.\n * If omitted, no headers are added.\n *\n * @minItems 1\n */\n headers?: NameStringValuePair[];\n /**\n * Configure headers. Entries have lower priority than entries from .headers.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.\n * If omitted or null, no headers are added.\n */\n headers_list?: string;\n /**\n * Configure compression.\n * Known values include: gzip, none. Implementations may support other compression algorithms.\n * If omitted or null, none is used.\n */\n compression?: string;\n /**\n * Configure max time (in milliseconds) to wait for each export.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 10000 is used.\n */\n timeout?: number;\n encoding?: OtlpHttpEncoding;\n}\n\n/**\n * Configure TLS settings for the exporter.\n * If omitted, system default TLS settings are used.\n */\nexport interface HttpTls {\n /**\n * Configure certificate used to verify a server's TLS credentials.\n * Absolute path to certificate file in PEM format.\n * If omitted or null, system default certificate verification is used for secure connections.\n */\n ca_file?: string;\n /**\n * Configure mTLS private client key.\n * Absolute path to client key file in PEM format. If set, .client_certificate must also be set.\n * If omitted or null, mTLS is not used.\n */\n key_file?: string;\n /**\n * Configure mTLS client certificate.\n * Absolute path to client certificate file in PEM format. If set, .client_key must also be set.\n * If omitted or null, mTLS is not used.\n */\n cert_file?: string;\n}\n\nexport interface NameStringValuePair {\n /**\n * The name of the pair.\n * Property is required and must be non-null.\n */\n name: string;\n /**\n * The value of the pair.\n * Property must be present, but if null the behavior is dependent on usage context.\n */\n value: string;\n}\n\n/**\n * Configure exporter to be OTLP with gRPC transport.\n * If omitted, ignore.\n */\nexport interface OtlpGrpcExporter {\n /**\n * Configure endpoint.\n * If omitted or null, http://localhost:4317 is used.\n */\n endpoint?: string;\n tls?: GrpcTls;\n /**\n * Configure headers. Entries have higher priority than entries from .headers_list.\n * If an entry's .value is null, the entry is ignored.\n * If omitted, no headers are added.\n *\n * @minItems 1\n */\n headers?: NameStringValuePair[];\n /**\n * Configure headers. Entries have lower priority than entries from .headers.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.\n * If omitted or null, no headers are added.\n */\n headers_list?: string;\n /**\n * Configure compression.\n * Known values include: gzip, none. Implementations may support other compression algorithms.\n * If omitted or null, none is used.\n */\n compression?: string;\n /**\n * Configure max time (in milliseconds) to wait for each export.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 10000 is used.\n */\n timeout?: number;\n}\n\n/**\n * Configure TLS settings for the exporter.\n * If omitted, system default TLS settings are used.\n */\nexport interface GrpcTls {\n /**\n * Configure certificate used to verify a server's TLS credentials.\n * Absolute path to certificate file in PEM format.\n * If omitted or null, system default certificate verification is used for secure connections.\n */\n ca_file?: string;\n /**\n * Configure mTLS private client key.\n * Absolute path to client key file in PEM format. If set, .client_certificate must also be set.\n * If omitted or null, mTLS is not used.\n */\n key_file?: string;\n /**\n * Configure mTLS client certificate.\n * Absolute path to client certificate file in PEM format. If set, .client_key must also be set.\n * If omitted or null, mTLS is not used.\n */\n cert_file?: string;\n /**\n * Configure client transport security for the exporter's connection.\n * Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure.\n * If omitted or null, false is used.\n */\n insecure?: boolean;\n}\n\n/**\n * Configure exporter to be OTLP with file transport.\n * If omitted, ignore.\n */\nexport interface ExperimentalOtlpFileExporter {\n /**\n * Configure output stream.\n * Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.\n * If omitted or null, stdout is used.\n */\n output_stream?: string;\n}\n\n/**\n * Configure exporter to be console.\n * If omitted, ignore.\n */\nexport interface ConsoleExporter {}\n\n/**\n * Configure a simple log record processor.\n * If omitted, ignore.\n */\nexport interface SimpleLogRecordProcessor {\n exporter: LogRecordExporter;\n}\n\n/**\n * Configure log record limits. See also attribute_limits.\n * If omitted, default values as described in LogRecordLimits are used.\n */\nexport interface LogRecordLimits {\n /**\n * Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit.\n * Value must be non-negative.\n * If omitted or null, there is no limit.\n */\n attribute_value_length_limit?: number;\n /**\n * Configure max attribute count. Overrides .attribute_limits.attribute_count_limit.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n attribute_count_limit?: number;\n}\n\n/**\n * Configure loggers.\n * If omitted, all loggers use default values as described in ExperimentalLoggerConfig.\n */\nexport interface ExperimentalLoggerConfigurator {\n default_config?: ExperimentalLoggerConfig;\n /**\n * Configure loggers.\n * If omitted, all loggers use .default_config.\n *\n * @minItems 1\n */\n loggers?: ExperimentalLoggerMatcherAndConfig[];\n}\n\n/**\n * Configure the default logger config used there is no matching entry in .logger_configurator/development.loggers.\n * If omitted, unmatched .loggers use default values as described in ExperimentalLoggerConfig.\n */\nexport interface ExperimentalLoggerConfig {\n /**\n * Configure if the logger is enabled or not.\n * If omitted or null, true is used.\n */\n enabled?: boolean;\n minimum_severity?: SeverityNumber;\n /**\n * Configure trace based filtering.\n * If true, log records associated with unsampled trace contexts traces are not processed. If false, or if a log record is not associated with a trace context, trace based filtering is not applied.\n * If omitted or null, trace based filtering is not applied.\n */\n trace_based?: boolean;\n}\n\nexport interface ExperimentalLoggerMatcherAndConfig {\n /**\n * Configure logger names to match, evaluated as follows:\n *\n * * If the logger name exactly matches.\n * * If the logger name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * Property is required and must be non-null.\n */\n name: string;\n config: ExperimentalLoggerConfig;\n}\n\n/**\n * Configure meter provider.\n * If omitted, a noop meter provider is used.\n */\nexport interface MeterProvider {\n /**\n * Configure metric readers.\n * Property is required and must be non-null.\n *\n * @minItems 1\n */\n readers: MetricReader[];\n /**\n * Configure views.\n * Each view has a selector which determines the instrument(s) it applies to, and a configuration for the resulting stream(s).\n * If omitted, no views are registered.\n *\n * @minItems 1\n */\n views?: View[];\n exemplar_filter?: ExemplarFilter;\n 'meter_configurator/development'?: ExperimentalMeterConfigurator;\n}\n\nexport interface MetricReader {\n periodic?: PeriodicMetricReader;\n pull?: PullMetricReader;\n}\n\n/**\n * Configure a periodic metric reader.\n * If omitted, ignore.\n */\nexport interface PeriodicMetricReader {\n /**\n * Configure delay interval (in milliseconds) between start of two consecutive exports.\n * Value must be non-negative.\n * If omitted or null, 60000 is used.\n */\n interval?: number;\n /**\n * Configure maximum allowed time (in milliseconds) to export data.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 30000 is used.\n */\n timeout?: number;\n exporter: PushMetricExporter;\n /**\n * Configure metric producers.\n * If omitted, no metric producers are added.\n *\n * @minItems 1\n */\n producers?: MetricProducer[];\n cardinality_limits?: CardinalityLimits;\n}\n\n/**\n * Configure exporter.\n * Property is required and must be non-null.\n */\nexport interface PushMetricExporter {\n otlp_http?: OtlpHttpMetricExporter;\n otlp_grpc?: OtlpGrpcMetricExporter;\n 'otlp_file/development'?: ExperimentalOtlpFileMetricExporter;\n console?: ConsoleMetricExporter;\n [k: string]: object | undefined;\n}\n\n/**\n * Configure exporter to be OTLP with HTTP transport.\n * If omitted, ignore.\n */\nexport interface OtlpHttpMetricExporter {\n /**\n * Configure endpoint.\n * If omitted or null, http://localhost:4318/v1/metrics is used.\n */\n endpoint?: string;\n tls?: HttpTls;\n /**\n * Configure headers. Entries have higher priority than entries from .headers_list.\n * If an entry's .value is null, the entry is ignored.\n * If omitted, no headers are added.\n *\n * @minItems 1\n */\n headers?: NameStringValuePair[];\n /**\n * Configure headers. Entries have lower priority than entries from .headers.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.\n * If omitted or null, no headers are added.\n */\n headers_list?: string;\n /**\n * Configure compression.\n * Known values include: gzip, none. Implementations may support other compression algorithms.\n * If omitted or null, none is used.\n */\n compression?: string;\n /**\n * Configure max time (in milliseconds) to wait for each export.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 10000 is used.\n */\n timeout?: number;\n encoding?: OtlpHttpEncoding;\n temporality_preference?: ExporterTemporalityPreference;\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n}\n\n/**\n * Configure exporter to be OTLP with gRPC transport.\n * If omitted, ignore.\n */\nexport interface OtlpGrpcMetricExporter {\n /**\n * Configure endpoint.\n * If omitted or null, http://localhost:4317 is used.\n */\n endpoint?: string;\n tls?: GrpcTls;\n /**\n * Configure headers. Entries have higher priority than entries from .headers_list.\n * If an entry's .value is null, the entry is ignored.\n * If omitted, no headers are added.\n *\n * @minItems 1\n */\n headers?: NameStringValuePair[];\n /**\n * Configure headers. Entries have lower priority than entries from .headers.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.\n * If omitted or null, no headers are added.\n */\n headers_list?: string;\n /**\n * Configure compression.\n * Known values include: gzip, none. Implementations may support other compression algorithms.\n * If omitted or null, none is used.\n */\n compression?: string;\n /**\n * Configure max time (in milliseconds) to wait for each export.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 10000 is used.\n */\n timeout?: number;\n temporality_preference?: ExporterTemporalityPreference;\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n}\n\n/**\n * Configure exporter to be OTLP with file transport.\n * If omitted, ignore.\n */\nexport interface ExperimentalOtlpFileMetricExporter {\n /**\n * Configure output stream.\n * Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.\n * If omitted or null, stdout is used.\n */\n output_stream?: string;\n temporality_preference?: ExporterTemporalityPreference;\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n}\n\n/**\n * Configure exporter to be console.\n * If omitted, ignore.\n */\nexport interface ConsoleMetricExporter {\n temporality_preference?: ExporterTemporalityPreference;\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n}\n\nexport interface MetricProducer {\n opencensus?: OpenCensusMetricProducer;\n [k: string]: object | undefined;\n}\n\n/**\n * Configure metric producer to be opencensus.\n * If omitted, ignore.\n */\nexport interface OpenCensusMetricProducer {}\n\n/**\n * Configure cardinality limits.\n * If omitted, default values as described in CardinalityLimits are used.\n */\nexport interface CardinalityLimits {\n /**\n * Configure default cardinality limit for all instrument types.\n * Instrument-specific cardinality limits take priority.\n * If omitted or null, 2000 is used.\n */\n default?: number;\n /**\n * Configure default cardinality limit for counter instruments.\n * If omitted or null, the value from .default is used.\n */\n counter?: number;\n /**\n * Configure default cardinality limit for gauge instruments.\n * If omitted or null, the value from .default is used.\n */\n gauge?: number;\n /**\n * Configure default cardinality limit for histogram instruments.\n * If omitted or null, the value from .default is used.\n */\n histogram?: number;\n /**\n * Configure default cardinality limit for observable_counter instruments.\n * If omitted or null, the value from .default is used.\n */\n observable_counter?: number;\n /**\n * Configure default cardinality limit for observable_gauge instruments.\n * If omitted or null, the value from .default is used.\n */\n observable_gauge?: number;\n /**\n * Configure default cardinality limit for observable_up_down_counter instruments.\n * If omitted or null, the value from .default is used.\n */\n observable_up_down_counter?: number;\n /**\n * Configure default cardinality limit for up_down_counter instruments.\n * If omitted or null, the value from .default is used.\n */\n up_down_counter?: number;\n}\n\n/**\n * Configure a pull based metric reader.\n * If omitted, ignore.\n */\nexport interface PullMetricReader {\n exporter: PullMetricExporter;\n /**\n * Configure metric producers.\n * If omitted, no metric producers are added.\n *\n * @minItems 1\n */\n producers?: MetricProducer[];\n cardinality_limits?: CardinalityLimits;\n}\n\n/**\n * Configure exporter.\n * Property is required and must be non-null.\n */\nexport interface PullMetricExporter {\n 'prometheus/development'?: ExperimentalPrometheusMetricExporter;\n [k: string]: object | undefined;\n}\n\n/**\n * Configure exporter to be prometheus.\n * If omitted, ignore.\n */\nexport interface ExperimentalPrometheusMetricExporter {\n /**\n * Configure host.\n * If omitted or null, localhost is used.\n */\n host?: string;\n /**\n * Configure port.\n * If omitted or null, 9464 is used.\n */\n port?: number;\n /**\n * Configure Prometheus Exporter to produce metrics without scope labels.\n * If omitted or null, false is used.\n */\n without_scope_info?: boolean;\n /**\n * Configure Prometheus Exporter to produce metrics without a target info metric for the resource.\n * If omitted or null, false is used.\n */\n 'without_target_info/development'?: boolean;\n with_resource_constant_labels?: IncludeExclude;\n translation_strategy?: ExperimentalPrometheusTranslationStrategy;\n}\n\n/**\n * Configure Prometheus Exporter to add resource attributes as metrics attributes, where the resource attribute keys match the patterns.\n * If omitted, no resource attributes are added.\n */\nexport interface IncludeExclude {\n /**\n * Configure list of value patterns to include.\n * Values are evaluated to match as follows:\n * * If the value exactly matches.\n * * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * If omitted, all values are included.\n *\n * @minItems 1\n */\n included?: string[];\n /**\n * Configure list of value patterns to exclude. Applies after .included (i.e. excluded has higher priority than included).\n * Values are evaluated to match as follows:\n * * If the value exactly matches.\n * * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * If omitted, .included attributes are included.\n *\n * @minItems 1\n */\n excluded?: string[];\n}\n\nexport interface View {\n selector: ViewSelector;\n stream: ViewStream;\n}\n\n/**\n * Configure view selector.\n * Selection criteria is additive as described in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#instrument-selection-criteria.\n * Property is required and must be non-null.\n */\nexport interface ViewSelector {\n /**\n * Configure instrument name selection criteria.\n * If omitted or null, all instrument names match.\n */\n instrument_name?: string;\n instrument_type?: InstrumentType;\n /**\n * Configure the instrument unit selection criteria.\n * If omitted or null, all instrument units match.\n */\n unit?: string;\n /**\n * Configure meter name selection criteria.\n * If omitted or null, all meter names match.\n */\n meter_name?: string;\n /**\n * Configure meter version selection criteria.\n * If omitted or null, all meter versions match.\n */\n meter_version?: string;\n /**\n * Configure meter schema url selection criteria.\n * If omitted or null, all meter schema URLs match.\n */\n meter_schema_url?: string;\n}\n\n/**\n * Configure view stream.\n * Property is required and must be non-null.\n */\nexport interface ViewStream {\n /**\n * Configure metric name of the resulting stream(s).\n * If omitted or null, the instrument's original name is used.\n */\n name?: string;\n /**\n * Configure metric description of the resulting stream(s).\n * If omitted or null, the instrument's origin description is used.\n */\n description?: string;\n aggregation?: Aggregation;\n /**\n * Configure the aggregation cardinality limit.\n * If omitted or null, the metric reader's default cardinality limit is used.\n */\n aggregation_cardinality_limit?: number;\n attribute_keys?: IncludeExclude;\n}\n\n/**\n * Configure aggregation of the resulting stream(s).\n * If omitted, default is used.\n */\nexport interface Aggregation {\n default?: DefaultAggregation;\n drop?: DropAggregation;\n explicit_bucket_histogram?: ExplicitBucketHistogramAggregation;\n base2_exponential_bucket_histogram?: Base2ExponentialBucketHistogramAggregation;\n last_value?: LastValueAggregation;\n sum?: SumAggregation;\n}\n\n/**\n * Configures the stream to use the instrument kind to select an aggregation and advisory parameters to influence aggregation configuration parameters. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#default-aggregation for details.\n * If omitted, ignore.\n */\nexport interface DefaultAggregation {}\n\n/**\n * Configures the stream to ignore/drop all instrument measurements. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#drop-aggregation for details.\n * If omitted, ignore.\n */\nexport interface DropAggregation {}\n\n/**\n * Configures the stream to collect data for the histogram metric point using a set of explicit boundary values for histogram bucketing. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#explicit-bucket-histogram-aggregation for details\n * If omitted, ignore.\n */\nexport interface ExplicitBucketHistogramAggregation {\n /**\n * Configure bucket boundaries.\n * If omitted, [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000] is used.\n *\n * @minItems 0\n */\n boundaries?: number[];\n /**\n * Configure record min and max.\n * If omitted or null, true is used.\n */\n record_min_max?: boolean;\n}\n\n/**\n * Configures the stream to collect data for the exponential histogram metric point, which uses a base-2 exponential formula to determine bucket boundaries and an integer scale parameter to control resolution. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#base2-exponential-bucket-histogram-aggregation for details.\n * If omitted, ignore.\n */\nexport interface Base2ExponentialBucketHistogramAggregation {\n /**\n * Configure the max scale factor.\n * If omitted or null, 20 is used.\n */\n max_scale?: number;\n /**\n * Configure the maximum number of buckets in each of the positive and negative ranges, not counting the special zero bucket.\n * If omitted or null, 160 is used.\n */\n max_size?: number;\n /**\n * Configure whether or not to record min and max.\n * If omitted or null, true is used.\n */\n record_min_max?: boolean;\n}\n\n/**\n * Configures the stream to collect data using the last measurement. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#last-value-aggregation for details.\n * If omitted, ignore.\n */\nexport interface LastValueAggregation {}\n\n/**\n * Configures the stream to collect the arithmetic sum of measurement values. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#sum-aggregation for details.\n * If omitted, ignore.\n */\nexport interface SumAggregation {}\n\n/**\n * Configure meters.\n * If omitted, all meters use default values as described in ExperimentalMeterConfig.\n */\nexport interface ExperimentalMeterConfigurator {\n default_config?: ExperimentalMeterConfig;\n /**\n * Configure meters.\n * If omitted, all meters used .default_config.\n *\n * @minItems 1\n */\n meters?: ExperimentalMeterMatcherAndConfig[];\n}\n\n/**\n * Configure the default meter config used there is no matching entry in .meter_configurator/development.meters.\n * If omitted, unmatched .meters use default values as described in ExperimentalMeterConfig.\n */\nexport interface ExperimentalMeterConfig {\n /**\n * Configure if the meter is enabled or not.\n * If omitted, true is used.\n */\n enabled?: boolean;\n}\n\nexport interface ExperimentalMeterMatcherAndConfig {\n /**\n * Configure meter names to match, evaluated as follows:\n *\n * * If the meter name exactly matches.\n * * If the meter name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * Property is required and must be non-null.\n */\n name: string;\n config: ExperimentalMeterConfig;\n}\n\n/**\n * Configure text map context propagators.\n * If omitted, a noop propagator is used.\n */\nexport interface Propagator {\n /**\n * Configure the propagators in the composite text map propagator. Entries from .composite_list are appended to the list here with duplicates filtered out.\n * Built-in propagator keys include: tracecontext, baggage, b3, b3multi. Known third party keys include: xray.\n * If omitted, and .composite_list is omitted or null, a noop propagator is used.\n *\n * @minItems 1\n */\n composite?: TextMapPropagator[];\n /**\n * Configure the propagators in the composite text map propagator. Entries are appended to .composite with duplicates filtered out.\n * The value is a comma separated list of propagator identifiers matching the format of OTEL_PROPAGATORS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details.\n * Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi. Known third party identifiers include: xray.\n * If omitted or null, and .composite is omitted or null, a noop propagator is used.\n */\n composite_list?: string;\n}\n\nexport interface TextMapPropagator {\n tracecontext?: TraceContextPropagator;\n baggage?: BaggagePropagator;\n b3?: B3Propagator;\n b3multi?: B3MultiPropagator;\n [k: string]: object | undefined;\n}\n\n/**\n * Include the w3c trace context propagator.\n * If omitted, ignore.\n */\nexport interface TraceContextPropagator {}\n\n/**\n * Include the w3c baggage propagator.\n * If omitted, ignore.\n */\nexport interface BaggagePropagator {}\n\n/**\n * Include the zipkin b3 propagator.\n * If omitted, ignore.\n */\nexport interface B3Propagator {}\n\n/**\n * Include the zipkin b3 multi propagator.\n * If omitted, ignore.\n */\nexport interface B3MultiPropagator {}\n\n/**\n * Configure tracer provider.\n * If omitted, a noop tracer provider is used.\n */\nexport interface TracerProvider {\n /**\n * Configure span processors.\n * Property is required and must be non-null.\n *\n * @minItems 1\n */\n processors: SpanProcessor[];\n limits?: SpanLimits;\n sampler?: Sampler;\n 'tracer_configurator/development'?: ExperimentalTracerConfigurator;\n}\n\nexport interface SpanProcessor {\n batch?: BatchSpanProcessor;\n simple?: SimpleSpanProcessor;\n [k: string]: object | undefined;\n}\n\n/**\n * Configure a batch span processor.\n * If omitted, ignore.\n */\nexport interface BatchSpanProcessor {\n /**\n * Configure delay interval (in milliseconds) between two consecutive exports.\n * Value must be non-negative.\n * If omitted or null, 5000 is used.\n */\n schedule_delay?: number;\n /**\n * Configure maximum allowed time (in milliseconds) to export data.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 30000 is used.\n */\n export_timeout?: number;\n /**\n * Configure maximum queue size. Value must be positive.\n * If omitted or null, 2048 is used.\n */\n max_queue_size?: number;\n /**\n * Configure maximum batch size. Value must be positive.\n * If omitted or null, 512 is used.\n */\n max_export_batch_size?: number;\n exporter: SpanExporter;\n}\n\n/**\n * Configure exporter.\n * Property is required and must be non-null.\n */\nexport interface SpanExporter {\n otlp_http?: OtlpHttpExporter;\n otlp_grpc?: OtlpGrpcExporter;\n 'otlp_file/development'?: ExperimentalOtlpFileExporter;\n console?: ConsoleExporter;\n [k: string]: object | undefined;\n}\n\n/**\n * Configure a simple span processor.\n * If omitted, ignore.\n */\nexport interface SimpleSpanProcessor {\n exporter: SpanExporter;\n}\n\n/**\n * Configure span limits. See also attribute_limits.\n * If omitted, default values as described in SpanLimits are used.\n */\nexport interface SpanLimits {\n /**\n * Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit.\n * Value must be non-negative.\n * If omitted or null, there is no limit.\n */\n attribute_value_length_limit?: number;\n /**\n * Configure max attribute count. Overrides .attribute_limits.attribute_count_limit.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n attribute_count_limit?: number;\n /**\n * Configure max span event count.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n event_count_limit?: number;\n /**\n * Configure max span link count.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n link_count_limit?: number;\n /**\n * Configure max attributes per span event.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n event_attribute_count_limit?: number;\n /**\n * Configure max attributes per span link.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n link_attribute_count_limit?: number;\n}\n\n/**\n * Configure the sampler.\n * If omitted, parent based sampler with a root of always_on is used.\n */\nexport interface Sampler {\n always_off?: AlwaysOffSampler;\n always_on?: AlwaysOnSampler;\n 'composite/development'?: ExperimentalComposableSampler;\n 'jaeger_remote/development'?: ExperimentalJaegerRemoteSampler;\n parent_based?: ParentBasedSampler;\n 'probability/development'?: ExperimentalProbabilitySampler;\n trace_id_ratio_based?: TraceIdRatioBasedSampler;\n [k: string]: object | undefined;\n}\n\n/**\n * Configure sampler to be always_off.\n * If omitted, ignore.\n */\nexport interface AlwaysOffSampler {}\n\n/**\n * Configure sampler to be always_on.\n * If omitted, ignore.\n */\nexport interface AlwaysOnSampler {}\n\n/**\n * Configure sampler to be composite.\n * If omitted, ignore.\n */\nexport interface ExperimentalComposableSampler {\n always_off?: ExperimentalComposableAlwaysOffSampler;\n always_on?: ExperimentalComposableAlwaysOnSampler;\n parent_threshold?: ExperimentalComposableParentThresholdSampler;\n probability?: ExperimentalComposableProbabilitySampler;\n rule_based?: ExperimentalComposableRuleBasedSampler;\n [k: string]: object | undefined;\n}\n\n/**\n * Configure sampler to be always_off.\n * If omitted, ignore.\n */\nexport interface ExperimentalComposableAlwaysOffSampler {}\n\n/**\n * Configure sampler to be always_on.\n * If omitted, ignore.\n */\nexport interface ExperimentalComposableAlwaysOnSampler {}\n\n/**\n * Configure sampler to be parent_threshold.\n * If omitted, ignore.\n */\nexport interface ExperimentalComposableParentThresholdSampler {\n root: ExperimentalComposableSampler;\n}\n\n/**\n * Configure sampler to be probability.\n * If omitted, ignore.\n */\nexport interface ExperimentalComposableProbabilitySampler {\n /**\n * Configure ratio.\n * If omitted or null, 1.0 is used.\n */\n ratio?: number;\n}\n\n/**\n * Configure sampler to be rule_based.\n * If omitted, ignore.\n */\nexport interface ExperimentalComposableRuleBasedSampler {\n /**\n * The rules for the sampler, matched in order.\n * Each rule can have multiple match conditions. All conditions must match for the rule to match.\n * If no conditions are specified, the rule matches all spans that reach it.\n * If no rules match, the span is not sampled.\n * If omitted, no span is sampled.\n *\n * @minItems 1\n */\n rules?: ExperimentalComposableRuleBasedSamplerRule[];\n}\n\n/**\n * A rule for ExperimentalComposableRuleBasedSampler. A rule can have multiple match conditions - the sampler will be applied if all match.\n * If no conditions are specified, the rule matches all spans that reach it.\n */\nexport interface ExperimentalComposableRuleBasedSamplerRule {\n attribute_values?: ExperimentalComposableRuleBasedSamplerRuleAttributeValues;\n attribute_patterns?: ExperimentalComposableRuleBasedSamplerRuleAttributePatterns;\n /**\n * The span kinds to match. If the span's kind matches any of these, it matches.\n * Values include:\n * * client: client, a client span.\n * * consumer: consumer, a consumer span.\n * * internal: internal, an internal span.\n * * producer: producer, a producer span.\n * * server: server, a server span.\n * If omitted, ignore.\n *\n * @minItems 1\n */\n span_kinds?: SpanKind[];\n /**\n * The parent span types to match.\n * Values include:\n * * local: local, a local parent.\n * * none: none, no parent, i.e., the trace root.\n * * remote: remote, a remote parent.\n * If omitted, ignore.\n *\n * @minItems 1\n */\n parent?: ExperimentalSpanParent[];\n sampler: ExperimentalComposableSampler;\n}\n\n/**\n * Values to match against a single attribute. Non-string attributes are matched using their string representation:\n * for example, a value of \"404\" would match the http.response.status_code 404. For array attributes, if any\n * item matches, it is considered a match.\n * If omitted, ignore.\n */\nexport interface ExperimentalComposableRuleBasedSamplerRuleAttributeValues {\n /**\n * The attribute key to match against.\n * Property is required and must be non-null.\n */\n key: string;\n /**\n * The attribute values to match against. If the attribute's value matches any of these, it matches.\n * Property is required and must be non-null.\n *\n * @minItems 1\n */\n values: string[];\n}\n\n/**\n * Patterns to match against a single attribute. Non-string attributes are matched using their string representation:\n * for example, a pattern of \"4*\" would match any http.response.status_code in 400-499. For array attributes, if any\n * item matches, it is considered a match.\n * If omitted, ignore.\n */\nexport interface ExperimentalComposableRuleBasedSamplerRuleAttributePatterns {\n /**\n * The attribute key to match against.\n * Property is required and must be non-null.\n */\n key: string;\n /**\n * Configure list of value patterns to include.\n * Values are evaluated to match as follows:\n * * If the value exactly matches.\n * * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * If omitted, all values are included.\n *\n * @minItems 1\n */\n included?: string[];\n /**\n * Configure list of value patterns to exclude. Applies after .included (i.e. excluded has higher priority than included).\n * Values are evaluated to match as follows:\n * * If the value exactly matches.\n * * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * If omitted, .included attributes are included.\n *\n * @minItems 1\n */\n excluded?: string[];\n}\n\n/**\n * Configure sampler to be jaeger_remote.\n * If omitted, ignore.\n */\nexport interface ExperimentalJaegerRemoteSampler {\n /**\n * Configure the endpoint of the jaeger remote sampling service.\n * Property is required and must be non-null.\n */\n endpoint: string;\n /**\n * Configure the polling interval (in milliseconds) to fetch from the remote sampling service.\n * If omitted or null, 60000 is used.\n */\n interval?: number;\n initial_sampler: Sampler;\n}\n\n/**\n * Configure sampler to be parent_based.\n * If omitted, ignore.\n */\nexport interface ParentBasedSampler {\n root?: Sampler;\n remote_parent_sampled?: Sampler;\n remote_parent_not_sampled?: Sampler;\n local_parent_sampled?: Sampler;\n local_parent_not_sampled?: Sampler;\n}\n\n/**\n * Configure sampler to be probability.\n * If omitted, ignore.\n */\nexport interface ExperimentalProbabilitySampler {\n /**\n * Configure ratio.\n * If omitted or null, 1.0 is used.\n */\n ratio?: number;\n}\n\n/**\n * Configure sampler to be trace_id_ratio_based.\n * If omitted, ignore.\n */\nexport interface TraceIdRatioBasedSampler {\n /**\n * Configure trace_id_ratio.\n * If omitted or null, 1.0 is used.\n */\n ratio?: number;\n}\n\n/**\n * Configure tracers.\n * If omitted, all tracers use default values as described in ExperimentalTracerConfig.\n */\nexport interface ExperimentalTracerConfigurator {\n default_config?: ExperimentalTracerConfig;\n /**\n * Configure tracers.\n * If omitted, all tracers use .default_config.\n *\n * @minItems 1\n */\n tracers?: ExperimentalTracerMatcherAndConfig[];\n}\n\n/**\n * Configure the default tracer config used there is no matching entry in .tracer_configurator/development.tracers.\n * If omitted, unmatched .tracers use default values as described in ExperimentalTracerConfig.\n */\nexport interface ExperimentalTracerConfig {\n /**\n * Configure if the tracer is enabled or not.\n * If omitted, true is used.\n */\n enabled?: boolean;\n}\n\nexport interface ExperimentalTracerMatcherAndConfig {\n /**\n * Configure tracer names to match, evaluated as follows:\n *\n * * If the tracer name exactly matches.\n * * If the tracer name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * Property is required and must be non-null.\n */\n name: string;\n config: ExperimentalTracerConfig;\n}\n\n/**\n * Configure resource for all signals.\n * If omitted, the default resource is used.\n */\nexport interface Resource {\n /**\n * Configure resource attributes. Entries have higher priority than entries from .resource.attributes_list.\n * If omitted, no resource attributes are added.\n *\n * @minItems 1\n */\n attributes?: AttributeNameValue[];\n 'detection/development'?: ExperimentalResourceDetection;\n /**\n * Configure resource schema URL.\n * If omitted or null, no schema URL is used.\n */\n schema_url?: string;\n /**\n * Configure resource attributes. Entries have lower priority than entries from .resource.attributes.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_RESOURCE_ATTRIBUTES. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details.\n * If omitted or null, no resource attributes are added.\n */\n attributes_list?: string;\n}\n\nexport interface AttributeNameValue {\n /**\n * The attribute name.\n * Property is required and must be non-null.\n */\n name: string;\n /**\n * The attribute value.\n * The type of value must match .type.\n * Property is required and must be non-null.\n */\n value: string | number | boolean | string[] | boolean[] | number[];\n type?: AttributeType;\n}\n\n/**\n * Configure resource detection.\n * If omitted, resource detection is disabled.\n */\nexport interface ExperimentalResourceDetection {\n attributes?: IncludeExclude;\n /**\n * Configure resource detectors.\n * Resource detector names are dependent on the SDK language ecosystem. Please consult documentation for each respective language.\n * If omitted, no resource detectors are enabled.\n *\n * @minItems 1\n */\n detectors?: ExperimentalResourceDetector[];\n}\n\nexport interface ExperimentalResourceDetector {\n container?: ExperimentalContainerResourceDetector;\n host?: ExperimentalHostResourceDetector;\n process?: ExperimentalProcessResourceDetector;\n service?: ExperimentalServiceResourceDetector;\n [k: string]: object | undefined;\n}\n\n/**\n * Enable the container resource detector, which populates container.* attributes.\n * If omitted, ignore.\n */\nexport interface ExperimentalContainerResourceDetector {}\n\n/**\n * Enable the host resource detector, which populates host.* and os.* attributes.\n * If omitted, ignore.\n */\nexport interface ExperimentalHostResourceDetector {}\n\n/**\n * Enable the process resource detector, which populates process.* attributes.\n * If omitted, ignore.\n */\nexport interface ExperimentalProcessResourceDetector {}\n\n/**\n * Enable the service detector, which populates service.name based on the OTEL_SERVICE_NAME environment variable and service.instance.id.\n * If omitted, ignore.\n */\nexport interface ExperimentalServiceResourceDetector {}\n\n/**\n * Configure instrumentation.\n * If omitted, instrumentation defaults are used.\n */\nexport interface ExperimentalInstrumentation {\n general?: ExperimentalGeneralInstrumentation;\n cpp?: ExperimentalLanguageSpecificInstrumentation;\n dotnet?: ExperimentalLanguageSpecificInstrumentation;\n erlang?: ExperimentalLanguageSpecificInstrumentation;\n go?: ExperimentalLanguageSpecificInstrumentation;\n java?: ExperimentalLanguageSpecificInstrumentation;\n js?: ExperimentalLanguageSpecificInstrumentation;\n php?: ExperimentalLanguageSpecificInstrumentation;\n python?: ExperimentalLanguageSpecificInstrumentation;\n ruby?: ExperimentalLanguageSpecificInstrumentation;\n rust?: ExperimentalLanguageSpecificInstrumentation;\n swift?: ExperimentalLanguageSpecificInstrumentation;\n}\n\n/**\n * Configure general SemConv options that may apply to multiple languages and instrumentations.\n * Instrumenation may merge general config options with the language specific configuration at .instrumentation.<language>.\n * If omitted, default values as described in ExperimentalGeneralInstrumentation are used.\n */\nexport interface ExperimentalGeneralInstrumentation {\n http?: ExperimentalHttpInstrumentation;\n code?: ExperimentalCodeInstrumentation;\n db?: ExperimentalDbInstrumentation;\n gen_ai?: ExperimentalGenAiInstrumentation;\n messaging?: ExperimentalMessagingInstrumentation;\n rpc?: ExperimentalRpcInstrumentation;\n sanitization?: ExperimentalSanitization;\n /**\n * Configure semantic convention stability opt-in as a comma-separated list.\n * This property follows the format and semantics of the OTEL_SEMCONV_STABILITY_OPT_IN environment variable.\n * Controls the emission of stable vs. experimental semantic conventions for instrumentation.\n * This setting is only intended for migrating from experimental to stable semantic conventions.\n *\n * Known values include:\n * - http: Emit stable HTTP and networking conventions only\n * - http/dup: Emit both old and stable HTTP and networking conventions (for phased migration)\n * - database: Emit stable database conventions only\n * - database/dup: Emit both old and stable database conventions (for phased migration)\n * - rpc: Emit stable RPC conventions only\n * - rpc/dup: Emit both experimental and stable RPC conventions (for phased migration)\n * - messaging: Emit stable messaging conventions only\n * - messaging/dup: Emit both old and stable messaging conventions (for phased migration)\n * - code: Emit stable code conventions only\n * - code/dup: Emit both old and stable code conventions (for phased migration)\n *\n * Multiple values can be specified as a comma-separated list (e.g., \"http,database/dup\").\n * Additional signal types may be supported in future versions.\n *\n * Domain-specific semconv properties (e.g., .instrumentation/development.general.db.semconv) take precedence over this general setting.\n *\n * See:\n * - HTTP migration: https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/\n * - Database migration: https://opentelemetry.io/docs/specs/semconv/database/\n * - RPC: https://opentelemetry.io/docs/specs/semconv/rpc/\n * - Messaging: https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/\n * If omitted or null, no opt-in is configured and instrumentations continue emitting their default semantic convention version.\n */\n stability_opt_in_list?: string;\n}\n\n/**\n * Configure instrumentations following the http semantic conventions.\n * See http semantic conventions: https://opentelemetry.io/docs/specs/semconv/http/\n * If omitted, defaults as described in ExperimentalHttpInstrumentation are used.\n */\nexport interface ExperimentalHttpInstrumentation {\n semconv?: ExperimentalSemconvConfig;\n client?: ExperimentalHttpClientInstrumentation;\n server?: ExperimentalHttpServerInstrumentation;\n}\n\n/**\n * Configure HTTP semantic convention version and migration behavior.\n *\n * This property takes precedence over the .instrumentation/development.general.stability_opt_in_list setting.\n *\n * See HTTP migration: https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/\n * If omitted, uses the general stability_opt_in_list setting, or instrumentations continue emitting their default semantic convention version if not set.\n */\nexport interface ExperimentalSemconvConfig {\n /**\n * The target semantic convention version for this domain (e.g., 1).\n * If omitted or null, the latest stable version is used, or if no stable version is available and .experimental is true then the latest experimental version is used.\n */\n version?: number;\n /**\n * Use latest experimental semantic conventions (before stable is available or to enable experimental features on top of stable conventions).\n * If omitted or null, false is used.\n */\n experimental?: boolean;\n /**\n * When true, also emit the previous major version alongside the target version.\n * For version=1, the previous version refers to the pre-stable conventions that the instrumentation emitted before the first stable semantic convention version was defined.\n * For version=2 and above, the previous version is the prior stable major version (e.g., version=2, dual_emit=true emits both v2 and v1).\n * Enables dual-emit for phased migration between versions.\n * If omitted or null, false is used.\n */\n dual_emit?: boolean;\n}\n\n/**\n * Configure instrumentations following the http client semantic conventions.\n * If omitted, defaults as described in ExperimentalHttpClientInstrumentation are used.\n */\nexport interface ExperimentalHttpClientInstrumentation {\n /**\n * Configure headers to capture for outbound http requests.\n * If omitted, no outbound request headers are captured.\n *\n * @minItems 1\n */\n request_captured_headers?: string[];\n /**\n * Configure headers to capture for inbound http responses.\n * If omitted, no inbound response headers are captured.\n *\n * @minItems 1\n */\n response_captured_headers?: string[];\n /**\n * Override the default list of known HTTP methods.\n * Known methods are case-sensitive.\n * This is a full override of the default known methods, not a list of known methods in addition to the defaults.\n * If omitted, HTTP methods GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH are known.\n *\n * @minItems 0\n */\n known_methods?: string[];\n}\n\n/**\n * Configure instrumentations following the http server semantic conventions.\n * If omitted, defaults as described in ExperimentalHttpServerInstrumentation are used.\n */\nexport interface ExperimentalHttpServerInstrumentation {\n /**\n * Configure headers to capture for inbound http requests.\n * If omitted, no request headers are captured.\n *\n * @minItems 1\n */\n request_captured_headers?: string[];\n /**\n * Configure headers to capture for outbound http responses.\n * If omitted, no response headers are captures.\n *\n * @minItems 1\n */\n response_captured_headers?: string[];\n /**\n * Override the default list of known HTTP methods.\n * Known methods are case-sensitive.\n * This is a full override of the default known methods, not a list of known methods in addition to the defaults.\n * If omitted, HTTP methods GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH are known.\n *\n * @minItems 0\n */\n known_methods?: string[];\n}\n\n/**\n * Configure instrumentations following the code semantic conventions.\n * See code semantic conventions: https://opentelemetry.io/docs/specs/semconv/registry/attributes/code/\n * If omitted, defaults as described in ExperimentalCodeInstrumentation are used.\n */\nexport interface ExperimentalCodeInstrumentation {\n semconv?: ExperimentalSemconvConfig;\n}\n\n/**\n * Configure instrumentations following the database semantic conventions.\n * See database semantic conventions: https://opentelemetry.io/docs/specs/semconv/database/\n * If omitted, defaults as described in ExperimentalDbInstrumentation are used.\n */\nexport interface ExperimentalDbInstrumentation {\n semconv?: ExperimentalSemconvConfig;\n}\n\n/**\n * Configure instrumentations following the GenAI semantic conventions.\n * See GenAI semantic conventions: https://opentelemetry.io/docs/specs/semconv/gen-ai/\n * If omitted, defaults as described in ExperimentalGenAiInstrumentation are used.\n */\nexport interface ExperimentalGenAiInstrumentation {\n semconv?: ExperimentalSemconvConfig;\n}\n\n/**\n * Configure instrumentations following the messaging semantic conventions.\n * See messaging semantic conventions: https://opentelemetry.io/docs/specs/semconv/messaging/\n * If omitted, defaults as described in ExperimentalMessagingInstrumentation are used.\n */\nexport interface ExperimentalMessagingInstrumentation {\n semconv?: ExperimentalSemconvConfig;\n}\n\n/**\n * Configure instrumentations following the RPC semantic conventions.\n * See RPC semantic conventions: https://opentelemetry.io/docs/specs/semconv/rpc/\n * If omitted, defaults as described in ExperimentalRpcInstrumentation are used.\n */\nexport interface ExperimentalRpcInstrumentation {\n semconv?: ExperimentalSemconvConfig;\n}\n\n/**\n * Configure general sanitization options.\n * If omitted, defaults as described in ExperimentalSanitization are used.\n */\nexport interface ExperimentalSanitization {\n url?: ExperimentalUrlSanitization;\n}\n\n/**\n * Configure URL sanitization options.\n * If omitted, defaults as described in ExperimentalUrlSanitization are used.\n */\nexport interface ExperimentalUrlSanitization {\n /**\n * List of query parameter names whose values should be redacted from URLs.\n * Query parameter names are case-sensitive.\n * This is a full override of the default sensitive query parameter keys, it is not a list of keys in addition to the defaults.\n * Set to an empty array to disable query parameter redaction.\n * If omitted, the default sensitive query parameter list as defined by the url semantic conventions (https://github.com/open-telemetry/semantic-conventions/blob/main/docs/registry/attributes/url.md) is used.\n *\n * @minItems 0\n */\n sensitive_query_parameters?: string[];\n}\n\n/**\n * Configure C++ language-specific instrumentation libraries.\n * If omitted, instrumentation defaults are used.\n */\nexport interface ExperimentalLanguageSpecificInstrumentation {\n [k: string]: object;\n}\n\n/**\n * Defines configuration parameters specific to a particular OpenTelemetry distribution or vendor.\n * This section provides a standardized location for distribution-specific settings\n * that are not part of the OpenTelemetry configuration model.\n * It allows vendors to expose their own extensions and general configuration options.\n * If omitted, distribution defaults are used.\n */\nexport interface Distribution {\n [k: string]: object;\n}\n"]}
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/generated/types.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,EAAE;AACF,+BAA+B;AAC/B,wDAAwD;AACxD,8CAA8C;AAC9C,EAAE;AACF,gGAAgG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n//\n// AUTO-GENERATED — do not edit\n// Generated from opentelemetry-configuration.git v1.0.0\n// Run `npm run generate:config` to regenerate\n//\n/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-empty-object-type */\n\n/**\n * Configure the log level of the internal logger used by the SDK.\n * Values include:\n * * debug: debug, severity number 5.\n * * debug2: debug2, severity number 6.\n * * debug3: debug3, severity number 7.\n * * debug4: debug4, severity number 8.\n * * error: error, severity number 17.\n * * error2: error2, severity number 18.\n * * error3: error3, severity number 19.\n * * error4: error4, severity number 20.\n * * fatal: fatal, severity number 21.\n * * fatal2: fatal2, severity number 22.\n * * fatal3: fatal3, severity number 23.\n * * fatal4: fatal4, severity number 24.\n * * info: info, severity number 9.\n * * info2: info2, severity number 10.\n * * info3: info3, severity number 11.\n * * info4: info4, severity number 12.\n * * trace: trace, severity number 1.\n * * trace2: trace2, severity number 2.\n * * trace3: trace3, severity number 3.\n * * trace4: trace4, severity number 4.\n * * warn: warn, severity number 13.\n * * warn2: warn2, severity number 14.\n * * warn3: warn3, severity number 15.\n * * warn4: warn4, severity number 16.\n * If omitted, INFO is used.\n */\nexport type SeverityNumber =\n | (\n | 'trace'\n | 'trace2'\n | 'trace3'\n | 'trace4'\n | 'debug'\n | 'debug2'\n | 'debug3'\n | 'debug4'\n | 'info'\n | 'info2'\n | 'info3'\n | 'info4'\n | 'warn'\n | 'warn2'\n | 'warn3'\n | 'warn4'\n | 'error'\n | 'error2'\n | 'error3'\n | 'error4'\n | 'fatal'\n | 'fatal2'\n | 'fatal3'\n | 'fatal4'\n )\n | null;\n\n/**\n * Configure exporter to be OTLP with HTTP transport.\n * If omitted, ignore.\n */\nexport type OtlpHttpExporter = {\n /**\n * Configure endpoint, including the signal specific path.\n * If omitted or null, the http://localhost:4318/v1/{signal} (where signal is 'traces', 'logs', or 'metrics') is used.\n */\n endpoint?: string | null;\n tls?: HttpTls;\n /**\n * Configure headers. Entries have higher priority than entries from .headers_list.\n * If an entry's .value is null, the entry is ignored.\n * If omitted, no headers are added.\n *\n * @minItems 1\n */\n headers?: NameStringValuePair[];\n /**\n * Configure headers. Entries have lower priority than entries from .headers.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.\n * If omitted or null, no headers are added.\n */\n headers_list?: string | null;\n /**\n * Configure compression.\n * Known values include: gzip, none. Implementations may support other compression algorithms.\n * If omitted or null, none is used.\n */\n compression?: string | null;\n /**\n * Configure max time (in milliseconds) to wait for each export.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 10000 is used.\n */\n timeout?: number | null;\n encoding?: OtlpHttpEncoding;\n} | null;\n\n/**\n * Configure TLS settings for the exporter.\n * If omitted, system default TLS settings are used.\n */\nexport type HttpTls = {\n /**\n * Configure certificate used to verify a server's TLS credentials.\n * Absolute path to certificate file in PEM format.\n * If omitted or null, system default certificate verification is used for secure connections.\n */\n ca_file?: string | null;\n /**\n * Configure mTLS private client key.\n * Absolute path to client key file in PEM format. If set, .client_certificate must also be set.\n * If omitted or null, mTLS is not used.\n */\n key_file?: string | null;\n /**\n * Configure mTLS client certificate.\n * Absolute path to client certificate file in PEM format. If set, .client_key must also be set.\n * If omitted or null, mTLS is not used.\n */\n cert_file?: string | null;\n} | null;\n\n/**\n * Configure the encoding used for messages.\n * Implementations may not support json.\n * Values include:\n * * json: Protobuf JSON encoding.\n * * protobuf: Protobuf binary encoding.\n * If omitted, protobuf is used.\n */\nexport type OtlpHttpEncoding = ('protobuf' | 'json') | null;\n\n/**\n * Configure exporter to be OTLP with gRPC transport.\n * If omitted, ignore.\n */\nexport type OtlpGrpcExporter = {\n /**\n * Configure endpoint.\n * If omitted or null, http://localhost:4317 is used.\n */\n endpoint?: string | null;\n tls?: GrpcTls;\n /**\n * Configure headers. Entries have higher priority than entries from .headers_list.\n * If an entry's .value is null, the entry is ignored.\n * If omitted, no headers are added.\n *\n * @minItems 1\n */\n headers?: NameStringValuePair[];\n /**\n * Configure headers. Entries have lower priority than entries from .headers.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.\n * If omitted or null, no headers are added.\n */\n headers_list?: string | null;\n /**\n * Configure compression.\n * Known values include: gzip, none. Implementations may support other compression algorithms.\n * If omitted or null, none is used.\n */\n compression?: string | null;\n /**\n * Configure max time (in milliseconds) to wait for each export.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 10000 is used.\n */\n timeout?: number | null;\n} | null;\n\n/**\n * Configure TLS settings for the exporter.\n * If omitted, system default TLS settings are used.\n */\nexport type GrpcTls = {\n /**\n * Configure certificate used to verify a server's TLS credentials.\n * Absolute path to certificate file in PEM format.\n * If omitted or null, system default certificate verification is used for secure connections.\n */\n ca_file?: string | null;\n /**\n * Configure mTLS private client key.\n * Absolute path to client key file in PEM format. If set, .client_certificate must also be set.\n * If omitted or null, mTLS is not used.\n */\n key_file?: string | null;\n /**\n * Configure mTLS client certificate.\n * Absolute path to client certificate file in PEM format. If set, .client_key must also be set.\n * If omitted or null, mTLS is not used.\n */\n cert_file?: string | null;\n /**\n * Configure client transport security for the exporter's connection.\n * Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure.\n * If omitted or null, false is used.\n */\n insecure?: boolean | null;\n} | null;\n\n/**\n * Configure exporter to be OTLP with file transport.\n * If omitted, ignore.\n */\nexport type ExperimentalOtlpFileExporter = {\n /**\n * Configure output stream.\n * Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.\n * If omitted or null, stdout is used.\n */\n output_stream?: string | null;\n} | null;\n\n/**\n * Configure exporter to be console.\n * If omitted, ignore.\n */\nexport type ConsoleExporter = {} | null;\n\n/**\n * Configure exporter to be OTLP with HTTP transport.\n * If omitted, ignore.\n */\nexport type OtlpHttpMetricExporter = {\n /**\n * Configure endpoint.\n * If omitted or null, http://localhost:4318/v1/metrics is used.\n */\n endpoint?: string | null;\n tls?: HttpTls;\n /**\n * Configure headers. Entries have higher priority than entries from .headers_list.\n * If an entry's .value is null, the entry is ignored.\n * If omitted, no headers are added.\n *\n * @minItems 1\n */\n headers?: NameStringValuePair[];\n /**\n * Configure headers. Entries have lower priority than entries from .headers.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.\n * If omitted or null, no headers are added.\n */\n headers_list?: string | null;\n /**\n * Configure compression.\n * Known values include: gzip, none. Implementations may support other compression algorithms.\n * If omitted or null, none is used.\n */\n compression?: string | null;\n /**\n * Configure max time (in milliseconds) to wait for each export.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 10000 is used.\n */\n timeout?: number | null;\n encoding?: OtlpHttpEncoding;\n temporality_preference?: ExporterTemporalityPreference;\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n} | null;\n\n/**\n * Configure temporality preference.\n * Values include:\n * * cumulative: Use cumulative aggregation temporality for all instrument types.\n * * delta: Use delta aggregation for all instrument types except up down counter and asynchronous up down counter.\n * * low_memory: Use delta aggregation temporality for counter and histogram instrument types. Use cumulative aggregation temporality for all other instrument types.\n * If omitted, cumulative is used.\n */\nexport type ExporterTemporalityPreference =\n | ('cumulative' | 'delta' | 'low_memory')\n | null;\n\n/**\n * Configure default histogram aggregation.\n * Values include:\n * * base2_exponential_bucket_histogram: Use base2 exponential histogram as the default aggregation for histogram instruments.\n * * explicit_bucket_histogram: Use explicit bucket histogram as the default aggregation for histogram instruments.\n * If omitted, explicit_bucket_histogram is used.\n */\nexport type ExporterDefaultHistogramAggregation =\n | ('explicit_bucket_histogram' | 'base2_exponential_bucket_histogram')\n | null;\n\n/**\n * Configure exporter to be OTLP with gRPC transport.\n * If omitted, ignore.\n */\nexport type OtlpGrpcMetricExporter = {\n /**\n * Configure endpoint.\n * If omitted or null, http://localhost:4317 is used.\n */\n endpoint?: string | null;\n tls?: GrpcTls;\n /**\n * Configure headers. Entries have higher priority than entries from .headers_list.\n * If an entry's .value is null, the entry is ignored.\n * If omitted, no headers are added.\n *\n * @minItems 1\n */\n headers?: NameStringValuePair[];\n /**\n * Configure headers. Entries have lower priority than entries from .headers.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.\n * If omitted or null, no headers are added.\n */\n headers_list?: string | null;\n /**\n * Configure compression.\n * Known values include: gzip, none. Implementations may support other compression algorithms.\n * If omitted or null, none is used.\n */\n compression?: string | null;\n /**\n * Configure max time (in milliseconds) to wait for each export.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 10000 is used.\n */\n timeout?: number | null;\n temporality_preference?: ExporterTemporalityPreference;\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n} | null;\n\n/**\n * Configure exporter to be OTLP with file transport.\n * If omitted, ignore.\n */\nexport type ExperimentalOtlpFileMetricExporter = {\n /**\n * Configure output stream.\n * Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.\n * If omitted or null, stdout is used.\n */\n output_stream?: string | null;\n temporality_preference?: ExporterTemporalityPreference;\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n} | null;\n\n/**\n * Configure exporter to be console.\n * If omitted, ignore.\n */\nexport type ConsoleMetricExporter = {\n temporality_preference?: ExporterTemporalityPreference;\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n} | null;\n\n/**\n * Configure metric producer to be opencensus.\n * If omitted, ignore.\n */\nexport type OpenCensusMetricProducer = {} | null;\n\n/**\n * Configure exporter to be prometheus.\n * If omitted, ignore.\n */\nexport type ExperimentalPrometheusMetricExporter = {\n /**\n * Configure host.\n * If omitted or null, localhost is used.\n */\n host?: string | null;\n /**\n * Configure port.\n * If omitted or null, 9464 is used.\n */\n port?: number | null;\n /**\n * Configure Prometheus Exporter to produce metrics without scope labels.\n * If omitted or null, false is used.\n */\n without_scope_info?: boolean | null;\n /**\n * Configure Prometheus Exporter to produce metrics without a target info metric for the resource.\n * If omitted or null, false is used.\n */\n 'without_target_info/development'?: boolean | null;\n with_resource_constant_labels?: IncludeExclude;\n translation_strategy?: ExperimentalPrometheusTranslationStrategy;\n} | null;\n\n/**\n * Configure how metric names are translated to Prometheus metric names.\n * Values include:\n * * no_translation/development: Special character escaping is disabled. Type and unit suffixes are disabled. Metric names are unaltered.\n * * no_utf8_escaping_with_suffixes/development: Special character escaping is disabled. Type and unit suffixes are enabled.\n * * underscore_escaping_with_suffixes: Special character escaping is enabled. Type and unit suffixes are enabled.\n * * underscore_escaping_without_suffixes/development: Special character escaping is enabled. Type and unit suffixes are disabled. This represents classic Prometheus metric name compatibility.\n * If omitted, underscore_escaping_with_suffixes is used.\n */\nexport type ExperimentalPrometheusTranslationStrategy =\n | (\n | 'underscore_escaping_with_suffixes'\n | 'underscore_escaping_without_suffixes/development'\n | 'no_utf8_escaping_with_suffixes/development'\n | 'no_translation/development'\n )\n | null;\n\n/**\n * Configure instrument type selection criteria.\n * Values include:\n * * counter: Synchronous counter instruments.\n * * gauge: Synchronous gauge instruments.\n * * histogram: Synchronous histogram instruments.\n * * observable_counter: Asynchronous counter instruments.\n * * observable_gauge: Asynchronous gauge instruments.\n * * observable_up_down_counter: Asynchronous up down counter instruments.\n * * up_down_counter: Synchronous up down counter instruments.\n * If omitted, all instrument types match.\n */\nexport type InstrumentType =\n | (\n | 'counter'\n | 'gauge'\n | 'histogram'\n | 'observable_counter'\n | 'observable_gauge'\n | 'observable_up_down_counter'\n | 'up_down_counter'\n )\n | null;\n\n/**\n * Configures the stream to use the instrument kind to select an aggregation and advisory parameters to influence aggregation configuration parameters. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#default-aggregation for details.\n * If omitted, ignore.\n */\nexport type DefaultAggregation = {} | null;\n\n/**\n * Configures the stream to ignore/drop all instrument measurements. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#drop-aggregation for details.\n * If omitted, ignore.\n */\nexport type DropAggregation = {} | null;\n\n/**\n * Configures the stream to collect data for the histogram metric point using a set of explicit boundary values for histogram bucketing. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#explicit-bucket-histogram-aggregation for details\n * If omitted, ignore.\n */\nexport type ExplicitBucketHistogramAggregation = {\n /**\n * Configure bucket boundaries.\n * If omitted, [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000] is used.\n *\n * @minItems 0\n */\n boundaries?: number[];\n /**\n * Configure record min and max.\n * If omitted or null, true is used.\n */\n record_min_max?: boolean | null;\n} | null;\n\n/**\n * Configures the stream to collect data for the exponential histogram metric point, which uses a base-2 exponential formula to determine bucket boundaries and an integer scale parameter to control resolution. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#base2-exponential-bucket-histogram-aggregation for details.\n * If omitted, ignore.\n */\nexport type Base2ExponentialBucketHistogramAggregation = {\n /**\n * Configure the max scale factor.\n * If omitted or null, 20 is used.\n */\n max_scale?: number | null;\n /**\n * Configure the maximum number of buckets in each of the positive and negative ranges, not counting the special zero bucket.\n * If omitted or null, 160 is used.\n */\n max_size?: number | null;\n /**\n * Configure whether or not to record min and max.\n * If omitted or null, true is used.\n */\n record_min_max?: boolean | null;\n} | null;\n\n/**\n * Configures the stream to collect data using the last measurement. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#last-value-aggregation for details.\n * If omitted, ignore.\n */\nexport type LastValueAggregation = {} | null;\n\n/**\n * Configures the stream to collect the arithmetic sum of measurement values. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#sum-aggregation for details.\n * If omitted, ignore.\n */\nexport type SumAggregation = {} | null;\n\n/**\n * Configure the exemplar filter.\n * Values include:\n * * always_off: ExemplarFilter which makes no measurements eligible for being an Exemplar.\n * * always_on: ExemplarFilter which makes all measurements eligible for being an Exemplar.\n * * trace_based: ExemplarFilter which makes measurements recorded in the context of a sampled parent span eligible for being an Exemplar.\n * If omitted, trace_based is used.\n */\nexport type ExemplarFilter =\n | ('always_on' | 'always_off' | 'trace_based')\n | null;\n\n/**\n * Include the w3c trace context propagator.\n * If omitted, ignore.\n */\nexport type TraceContextPropagator = {} | null;\n\n/**\n * Include the w3c baggage propagator.\n * If omitted, ignore.\n */\nexport type BaggagePropagator = {} | null;\n\n/**\n * Include the zipkin b3 propagator.\n * If omitted, ignore.\n */\nexport type B3Propagator = {} | null;\n\n/**\n * Include the zipkin b3 multi propagator.\n * If omitted, ignore.\n */\nexport type B3MultiPropagator = {} | null;\n\n/**\n * Configure sampler to be always_off.\n * If omitted, ignore.\n */\nexport type AlwaysOffSampler = {} | null;\n\n/**\n * Configure sampler to be always_on.\n * If omitted, ignore.\n */\nexport type AlwaysOnSampler = {} | null;\n\n/**\n * Configure sampler to be always_off.\n * If omitted, ignore.\n */\nexport type ExperimentalComposableAlwaysOffSampler = {} | null;\n\n/**\n * Configure sampler to be always_on.\n * If omitted, ignore.\n */\nexport type ExperimentalComposableAlwaysOnSampler = {} | null;\n\n/**\n * Configure sampler to be probability.\n * If omitted, ignore.\n */\nexport type ExperimentalComposableProbabilitySampler = {\n /**\n * Configure ratio.\n * If omitted or null, 1.0 is used.\n */\n ratio?: number | null;\n} | null;\n\n/**\n * Configure sampler to be rule_based.\n * If omitted, ignore.\n */\nexport type ExperimentalComposableRuleBasedSampler = {\n /**\n * The rules for the sampler, matched in order.\n * Each rule can have multiple match conditions. All conditions must match for the rule to match.\n * If no conditions are specified, the rule matches all spans that reach it.\n * If no rules match, the span is not sampled.\n * If omitted, no span is sampled.\n *\n * @minItems 1\n */\n rules?: ExperimentalComposableRuleBasedSamplerRule[];\n} | null;\n\nexport type SpanKind =\n | ('internal' | 'server' | 'client' | 'producer' | 'consumer')\n | null;\n\nexport type ExperimentalSpanParent = ('none' | 'remote' | 'local') | null;\n\n/**\n * Configure sampler to be jaeger_remote.\n * If omitted, ignore.\n */\nexport type ExperimentalJaegerRemoteSampler = {\n /**\n * Configure the endpoint of the jaeger remote sampling service.\n * Property is required and must be non-null.\n */\n endpoint: string;\n /**\n * Configure the polling interval (in milliseconds) to fetch from the remote sampling service.\n * If omitted or null, 60000 is used.\n */\n interval?: number | null;\n initial_sampler: Sampler;\n} | null;\n\n/**\n * Configure sampler to be parent_based.\n * If omitted, ignore.\n */\nexport type ParentBasedSampler = {\n root?: Sampler;\n remote_parent_sampled?: Sampler;\n remote_parent_not_sampled?: Sampler;\n local_parent_sampled?: Sampler;\n local_parent_not_sampled?: Sampler;\n} | null;\n\n/**\n * Configure sampler to be probability.\n * If omitted, ignore.\n */\nexport type ExperimentalProbabilitySampler = {\n /**\n * Configure ratio.\n * If omitted or null, 1.0 is used.\n */\n ratio?: number | null;\n} | null;\n\n/**\n * Configure sampler to be trace_id_ratio_based.\n * If omitted, ignore.\n */\nexport type TraceIdRatioBasedSampler = {\n /**\n * Configure trace_id_ratio.\n * If omitted or null, 1.0 is used.\n */\n ratio?: number | null;\n} | null;\n\n/**\n * The attribute type.\n * Values include:\n * * bool: Boolean attribute value.\n * * bool_array: Boolean array attribute value.\n * * double: Double attribute value.\n * * double_array: Double array attribute value.\n * * int: Integer attribute value.\n * * int_array: Integer array attribute value.\n * * string: String attribute value.\n * * string_array: String array attribute value.\n * If omitted, string is used.\n */\nexport type AttributeType =\n | (\n | 'string'\n | 'bool'\n | 'int'\n | 'double'\n | 'string_array'\n | 'bool_array'\n | 'int_array'\n | 'double_array'\n )\n | null;\n\n/**\n * Enable the container resource detector, which populates container.* attributes.\n * If omitted, ignore.\n */\nexport type ExperimentalContainerResourceDetector = {} | null;\n\n/**\n * Enable the host resource detector, which populates host.* and os.* attributes.\n * If omitted, ignore.\n */\nexport type ExperimentalHostResourceDetector = {} | null;\n\n/**\n * Enable the process resource detector, which populates process.* attributes.\n * If omitted, ignore.\n */\nexport type ExperimentalProcessResourceDetector = {} | null;\n\n/**\n * Enable the service detector, which populates service.name based on the OTEL_SERVICE_NAME environment variable and service.instance.id.\n * If omitted, ignore.\n */\nexport type ExperimentalServiceResourceDetector = {} | null;\n\nexport interface ConfigurationModel {\n /**\n * The file format version.\n * Represented as a string including the semver major, minor version numbers (and optionally the meta tag). For example: \"0.4\", \"1.0-rc.2\", \"1.0\" (after stable release).\n * See https://github.com/open-telemetry/opentelemetry-configuration/blob/main/VERSIONING.md for more details.\n * The yaml format is documented at https://github.com/open-telemetry/opentelemetry-configuration/tree/main/schema\n * Property is required and must be non-null.\n */\n file_format?: string;\n /**\n * Configure if the SDK is disabled or not.\n * If omitted or null, false is used.\n */\n disabled?: boolean | null;\n log_level?: SeverityNumber;\n attribute_limits?: AttributeLimits;\n logger_provider?: LoggerProvider;\n meter_provider?: MeterProvider;\n propagator?: Propagator;\n tracer_provider?: TracerProvider;\n resource?: Resource;\n 'instrumentation/development'?: ExperimentalInstrumentation;\n distribution?: Distribution;\n [k: string]: any;\n}\n\n/**\n * Configure general attribute limits. See also tracer_provider.limits, logger_provider.limits.\n * If omitted, default values as described in AttributeLimits are used.\n */\nexport interface AttributeLimits {\n /**\n * Configure max attribute value size.\n * Value must be non-negative.\n * If omitted or null, there is no limit.\n */\n attribute_value_length_limit?: number | null;\n /**\n * Configure max attribute count.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n attribute_count_limit?: number | null;\n}\n\n/**\n * Configure logger provider.\n * If omitted, a noop logger provider is used.\n */\nexport interface LoggerProvider {\n /**\n * Configure log record processors.\n * Property is required and must be non-null.\n *\n * @minItems 1\n */\n processors: LogRecordProcessor[];\n limits?: LogRecordLimits;\n 'logger_configurator/development'?: ExperimentalLoggerConfigurator;\n}\n\nexport interface LogRecordProcessor {\n batch?: BatchLogRecordProcessor;\n simple?: SimpleLogRecordProcessor;\n [k: string]: object | null | undefined;\n}\n\n/**\n * Configure a batch log record processor.\n * If omitted, ignore.\n */\nexport interface BatchLogRecordProcessor {\n /**\n * Configure delay interval (in milliseconds) between two consecutive exports.\n * Value must be non-negative.\n * If omitted or null, 1000 is used.\n */\n schedule_delay?: number | null;\n /**\n * Configure maximum allowed time (in milliseconds) to export data.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 30000 is used.\n */\n export_timeout?: number | null;\n /**\n * Configure maximum queue size. Value must be positive.\n * If omitted or null, 2048 is used.\n */\n max_queue_size?: number | null;\n /**\n * Configure maximum batch size. Value must be positive.\n * If omitted or null, 512 is used.\n */\n max_export_batch_size?: number | null;\n exporter: LogRecordExporter;\n}\n\n/**\n * Configure exporter.\n * Property is required and must be non-null.\n */\nexport interface LogRecordExporter {\n otlp_http?: OtlpHttpExporter;\n otlp_grpc?: OtlpGrpcExporter;\n 'otlp_file/development'?: ExperimentalOtlpFileExporter;\n console?: ConsoleExporter;\n [k: string]: object | null | undefined;\n}\n\nexport interface NameStringValuePair {\n /**\n * The name of the pair.\n * Property is required and must be non-null.\n */\n name: string;\n /**\n * The value of the pair.\n * Property must be present, but if null the behavior is dependent on usage context.\n */\n value: string | null;\n}\n\n/**\n * Configure a simple log record processor.\n * If omitted, ignore.\n */\nexport interface SimpleLogRecordProcessor {\n exporter: LogRecordExporter;\n}\n\n/**\n * Configure log record limits. See also attribute_limits.\n * If omitted, default values as described in LogRecordLimits are used.\n */\nexport interface LogRecordLimits {\n /**\n * Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit.\n * Value must be non-negative.\n * If omitted or null, there is no limit.\n */\n attribute_value_length_limit?: number | null;\n /**\n * Configure max attribute count. Overrides .attribute_limits.attribute_count_limit.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n attribute_count_limit?: number | null;\n}\n\n/**\n * Configure loggers.\n * If omitted, all loggers use default values as described in ExperimentalLoggerConfig.\n */\nexport interface ExperimentalLoggerConfigurator {\n default_config?: ExperimentalLoggerConfig;\n /**\n * Configure loggers.\n * If omitted, all loggers use .default_config.\n *\n * @minItems 1\n */\n loggers?: ExperimentalLoggerMatcherAndConfig[];\n}\n\n/**\n * Configure the default logger config used there is no matching entry in .logger_configurator/development.loggers.\n * If omitted, unmatched .loggers use default values as described in ExperimentalLoggerConfig.\n */\nexport interface ExperimentalLoggerConfig {\n /**\n * Configure if the logger is enabled or not.\n * If omitted or null, true is used.\n */\n enabled?: boolean | null;\n minimum_severity?: SeverityNumber;\n /**\n * Configure trace based filtering.\n * If true, log records associated with unsampled trace contexts traces are not processed. If false, or if a log record is not associated with a trace context, trace based filtering is not applied.\n * If omitted or null, trace based filtering is not applied.\n */\n trace_based?: boolean | null;\n}\n\nexport interface ExperimentalLoggerMatcherAndConfig {\n /**\n * Configure logger names to match, evaluated as follows:\n *\n * * If the logger name exactly matches.\n * * If the logger name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * Property is required and must be non-null.\n */\n name: string;\n config: ExperimentalLoggerConfig;\n}\n\n/**\n * Configure meter provider.\n * If omitted, a noop meter provider is used.\n */\nexport interface MeterProvider {\n /**\n * Configure metric readers.\n * Property is required and must be non-null.\n *\n * @minItems 1\n */\n readers: MetricReader[];\n /**\n * Configure views.\n * Each view has a selector which determines the instrument(s) it applies to, and a configuration for the resulting stream(s).\n * If omitted, no views are registered.\n *\n * @minItems 1\n */\n views?: View[];\n exemplar_filter?: ExemplarFilter;\n 'meter_configurator/development'?: ExperimentalMeterConfigurator;\n}\n\nexport interface MetricReader {\n periodic?: PeriodicMetricReader;\n pull?: PullMetricReader;\n}\n\n/**\n * Configure a periodic metric reader.\n * If omitted, ignore.\n */\nexport interface PeriodicMetricReader {\n /**\n * Configure delay interval (in milliseconds) between start of two consecutive exports.\n * Value must be non-negative.\n * If omitted or null, 60000 is used.\n */\n interval?: number | null;\n /**\n * Configure maximum allowed time (in milliseconds) to export data.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 30000 is used.\n */\n timeout?: number | null;\n exporter: PushMetricExporter;\n /**\n * Configure metric producers.\n * If omitted, no metric producers are added.\n *\n * @minItems 1\n */\n producers?: MetricProducer[];\n cardinality_limits?: CardinalityLimits;\n}\n\n/**\n * Configure exporter.\n * Property is required and must be non-null.\n */\nexport interface PushMetricExporter {\n otlp_http?: OtlpHttpMetricExporter;\n otlp_grpc?: OtlpGrpcMetricExporter;\n 'otlp_file/development'?: ExperimentalOtlpFileMetricExporter;\n console?: ConsoleMetricExporter;\n [k: string]: object | null | undefined;\n}\n\nexport interface MetricProducer {\n opencensus?: OpenCensusMetricProducer;\n [k: string]: object | null | undefined;\n}\n\n/**\n * Configure cardinality limits.\n * If omitted, default values as described in CardinalityLimits are used.\n */\nexport interface CardinalityLimits {\n /**\n * Configure default cardinality limit for all instrument types.\n * Instrument-specific cardinality limits take priority.\n * If omitted or null, 2000 is used.\n */\n default?: number | null;\n /**\n * Configure default cardinality limit for counter instruments.\n * If omitted or null, the value from .default is used.\n */\n counter?: number | null;\n /**\n * Configure default cardinality limit for gauge instruments.\n * If omitted or null, the value from .default is used.\n */\n gauge?: number | null;\n /**\n * Configure default cardinality limit for histogram instruments.\n * If omitted or null, the value from .default is used.\n */\n histogram?: number | null;\n /**\n * Configure default cardinality limit for observable_counter instruments.\n * If omitted or null, the value from .default is used.\n */\n observable_counter?: number | null;\n /**\n * Configure default cardinality limit for observable_gauge instruments.\n * If omitted or null, the value from .default is used.\n */\n observable_gauge?: number | null;\n /**\n * Configure default cardinality limit for observable_up_down_counter instruments.\n * If omitted or null, the value from .default is used.\n */\n observable_up_down_counter?: number | null;\n /**\n * Configure default cardinality limit for up_down_counter instruments.\n * If omitted or null, the value from .default is used.\n */\n up_down_counter?: number | null;\n}\n\n/**\n * Configure a pull based metric reader.\n * If omitted, ignore.\n */\nexport interface PullMetricReader {\n exporter: PullMetricExporter;\n /**\n * Configure metric producers.\n * If omitted, no metric producers are added.\n *\n * @minItems 1\n */\n producers?: MetricProducer[];\n cardinality_limits?: CardinalityLimits;\n}\n\n/**\n * Configure exporter.\n * Property is required and must be non-null.\n */\nexport interface PullMetricExporter {\n 'prometheus/development'?: ExperimentalPrometheusMetricExporter;\n [k: string]: object | null | undefined;\n}\n\n/**\n * Configure Prometheus Exporter to add resource attributes as metrics attributes, where the resource attribute keys match the patterns.\n * If omitted, no resource attributes are added.\n */\nexport interface IncludeExclude {\n /**\n * Configure list of value patterns to include.\n * Values are evaluated to match as follows:\n * * If the value exactly matches.\n * * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * If omitted, all values are included.\n *\n * @minItems 1\n */\n included?: string[];\n /**\n * Configure list of value patterns to exclude. Applies after .included (i.e. excluded has higher priority than included).\n * Values are evaluated to match as follows:\n * * If the value exactly matches.\n * * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * If omitted, .included attributes are included.\n *\n * @minItems 1\n */\n excluded?: string[];\n}\n\nexport interface View {\n selector: ViewSelector;\n stream: ViewStream;\n}\n\n/**\n * Configure view selector.\n * Selection criteria is additive as described in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#instrument-selection-criteria.\n * Property is required and must be non-null.\n */\nexport interface ViewSelector {\n /**\n * Configure instrument name selection criteria.\n * If omitted or null, all instrument names match.\n */\n instrument_name?: string | null;\n instrument_type?: InstrumentType;\n /**\n * Configure the instrument unit selection criteria.\n * If omitted or null, all instrument units match.\n */\n unit?: string | null;\n /**\n * Configure meter name selection criteria.\n * If omitted or null, all meter names match.\n */\n meter_name?: string | null;\n /**\n * Configure meter version selection criteria.\n * If omitted or null, all meter versions match.\n */\n meter_version?: string | null;\n /**\n * Configure meter schema url selection criteria.\n * If omitted or null, all meter schema URLs match.\n */\n meter_schema_url?: string | null;\n}\n\n/**\n * Configure view stream.\n * Property is required and must be non-null.\n */\nexport interface ViewStream {\n /**\n * Configure metric name of the resulting stream(s).\n * If omitted or null, the instrument's original name is used.\n */\n name?: string | null;\n /**\n * Configure metric description of the resulting stream(s).\n * If omitted or null, the instrument's origin description is used.\n */\n description?: string | null;\n aggregation?: Aggregation;\n /**\n * Configure the aggregation cardinality limit.\n * If omitted or null, the metric reader's default cardinality limit is used.\n */\n aggregation_cardinality_limit?: number | null;\n attribute_keys?: IncludeExclude;\n}\n\n/**\n * Configure aggregation of the resulting stream(s).\n * If omitted, default is used.\n */\nexport interface Aggregation {\n default?: DefaultAggregation;\n drop?: DropAggregation;\n explicit_bucket_histogram?: ExplicitBucketHistogramAggregation;\n base2_exponential_bucket_histogram?: Base2ExponentialBucketHistogramAggregation;\n last_value?: LastValueAggregation;\n sum?: SumAggregation;\n}\n\n/**\n * Configure meters.\n * If omitted, all meters use default values as described in ExperimentalMeterConfig.\n */\nexport interface ExperimentalMeterConfigurator {\n default_config?: ExperimentalMeterConfig;\n /**\n * Configure meters.\n * If omitted, all meters used .default_config.\n *\n * @minItems 1\n */\n meters?: ExperimentalMeterMatcherAndConfig[];\n}\n\n/**\n * Configure the default meter config used there is no matching entry in .meter_configurator/development.meters.\n * If omitted, unmatched .meters use default values as described in ExperimentalMeterConfig.\n */\nexport interface ExperimentalMeterConfig {\n /**\n * Configure if the meter is enabled or not.\n * If omitted, true is used.\n */\n enabled?: boolean;\n}\n\nexport interface ExperimentalMeterMatcherAndConfig {\n /**\n * Configure meter names to match, evaluated as follows:\n *\n * * If the meter name exactly matches.\n * * If the meter name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * Property is required and must be non-null.\n */\n name: string;\n config: ExperimentalMeterConfig;\n}\n\n/**\n * Configure text map context propagators.\n * If omitted, a noop propagator is used.\n */\nexport interface Propagator {\n /**\n * Configure the propagators in the composite text map propagator. Entries from .composite_list are appended to the list here with duplicates filtered out.\n * Built-in propagator keys include: tracecontext, baggage, b3, b3multi. Known third party keys include: xray.\n * If omitted, and .composite_list is omitted or null, a noop propagator is used.\n *\n * @minItems 1\n */\n composite?: TextMapPropagator[];\n /**\n * Configure the propagators in the composite text map propagator. Entries are appended to .composite with duplicates filtered out.\n * The value is a comma separated list of propagator identifiers matching the format of OTEL_PROPAGATORS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details.\n * Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi. Known third party identifiers include: xray.\n * If omitted or null, and .composite is omitted or null, a noop propagator is used.\n */\n composite_list?: string | null;\n}\n\nexport interface TextMapPropagator {\n tracecontext?: TraceContextPropagator;\n baggage?: BaggagePropagator;\n b3?: B3Propagator;\n b3multi?: B3MultiPropagator;\n [k: string]: object | null | undefined;\n}\n\n/**\n * Configure tracer provider.\n * If omitted, a noop tracer provider is used.\n */\nexport interface TracerProvider {\n /**\n * Configure span processors.\n * Property is required and must be non-null.\n *\n * @minItems 1\n */\n processors: SpanProcessor[];\n limits?: SpanLimits;\n sampler?: Sampler;\n 'tracer_configurator/development'?: ExperimentalTracerConfigurator;\n}\n\nexport interface SpanProcessor {\n batch?: BatchSpanProcessor;\n simple?: SimpleSpanProcessor;\n [k: string]: object | null | undefined;\n}\n\n/**\n * Configure a batch span processor.\n * If omitted, ignore.\n */\nexport interface BatchSpanProcessor {\n /**\n * Configure delay interval (in milliseconds) between two consecutive exports.\n * Value must be non-negative.\n * If omitted or null, 5000 is used.\n */\n schedule_delay?: number | null;\n /**\n * Configure maximum allowed time (in milliseconds) to export data.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 30000 is used.\n */\n export_timeout?: number | null;\n /**\n * Configure maximum queue size. Value must be positive.\n * If omitted or null, 2048 is used.\n */\n max_queue_size?: number | null;\n /**\n * Configure maximum batch size. Value must be positive.\n * If omitted or null, 512 is used.\n */\n max_export_batch_size?: number | null;\n exporter: SpanExporter;\n}\n\n/**\n * Configure exporter.\n * Property is required and must be non-null.\n */\nexport interface SpanExporter {\n otlp_http?: OtlpHttpExporter;\n otlp_grpc?: OtlpGrpcExporter;\n 'otlp_file/development'?: ExperimentalOtlpFileExporter;\n console?: ConsoleExporter;\n [k: string]: object | null | undefined;\n}\n\n/**\n * Configure a simple span processor.\n * If omitted, ignore.\n */\nexport interface SimpleSpanProcessor {\n exporter: SpanExporter;\n}\n\n/**\n * Configure span limits. See also attribute_limits.\n * If omitted, default values as described in SpanLimits are used.\n */\nexport interface SpanLimits {\n /**\n * Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit.\n * Value must be non-negative.\n * If omitted or null, there is no limit.\n */\n attribute_value_length_limit?: number | null;\n /**\n * Configure max attribute count. Overrides .attribute_limits.attribute_count_limit.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n attribute_count_limit?: number | null;\n /**\n * Configure max span event count.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n event_count_limit?: number | null;\n /**\n * Configure max span link count.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n link_count_limit?: number | null;\n /**\n * Configure max attributes per span event.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n event_attribute_count_limit?: number | null;\n /**\n * Configure max attributes per span link.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n link_attribute_count_limit?: number | null;\n}\n\n/**\n * Configure the sampler.\n * If omitted, parent based sampler with a root of always_on is used.\n */\nexport interface Sampler {\n always_off?: AlwaysOffSampler;\n always_on?: AlwaysOnSampler;\n 'composite/development'?: ExperimentalComposableSampler;\n 'jaeger_remote/development'?: ExperimentalJaegerRemoteSampler;\n parent_based?: ParentBasedSampler;\n 'probability/development'?: ExperimentalProbabilitySampler;\n trace_id_ratio_based?: TraceIdRatioBasedSampler;\n [k: string]: object | null | undefined;\n}\n\n/**\n * Configure sampler to be composite.\n * If omitted, ignore.\n */\nexport interface ExperimentalComposableSampler {\n always_off?: ExperimentalComposableAlwaysOffSampler;\n always_on?: ExperimentalComposableAlwaysOnSampler;\n parent_threshold?: ExperimentalComposableParentThresholdSampler;\n probability?: ExperimentalComposableProbabilitySampler;\n rule_based?: ExperimentalComposableRuleBasedSampler;\n [k: string]: object | null | undefined;\n}\n\n/**\n * Configure sampler to be parent_threshold.\n * If omitted, ignore.\n */\nexport interface ExperimentalComposableParentThresholdSampler {\n root: ExperimentalComposableSampler;\n}\n\n/**\n * A rule for ExperimentalComposableRuleBasedSampler. A rule can have multiple match conditions - the sampler will be applied if all match.\n * If no conditions are specified, the rule matches all spans that reach it.\n */\nexport interface ExperimentalComposableRuleBasedSamplerRule {\n attribute_values?: ExperimentalComposableRuleBasedSamplerRuleAttributeValues;\n attribute_patterns?: ExperimentalComposableRuleBasedSamplerRuleAttributePatterns;\n /**\n * The span kinds to match. If the span's kind matches any of these, it matches.\n * Values include:\n * * client: client, a client span.\n * * consumer: consumer, a consumer span.\n * * internal: internal, an internal span.\n * * producer: producer, a producer span.\n * * server: server, a server span.\n * If omitted, ignore.\n *\n * @minItems 1\n */\n span_kinds?: SpanKind[];\n /**\n * The parent span types to match.\n * Values include:\n * * local: local, a local parent.\n * * none: none, no parent, i.e., the trace root.\n * * remote: remote, a remote parent.\n * If omitted, ignore.\n *\n * @minItems 1\n */\n parent?: ExperimentalSpanParent[];\n sampler: ExperimentalComposableSampler;\n}\n\n/**\n * Values to match against a single attribute. Non-string attributes are matched using their string representation:\n * for example, a value of \"404\" would match the http.response.status_code 404. For array attributes, if any\n * item matches, it is considered a match.\n * If omitted, ignore.\n */\nexport interface ExperimentalComposableRuleBasedSamplerRuleAttributeValues {\n /**\n * The attribute key to match against.\n * Property is required and must be non-null.\n */\n key: string;\n /**\n * The attribute values to match against. If the attribute's value matches any of these, it matches.\n * Property is required and must be non-null.\n *\n * @minItems 1\n */\n values: string[];\n}\n\n/**\n * Patterns to match against a single attribute. Non-string attributes are matched using their string representation:\n * for example, a pattern of \"4*\" would match any http.response.status_code in 400-499. For array attributes, if any\n * item matches, it is considered a match.\n * If omitted, ignore.\n */\nexport interface ExperimentalComposableRuleBasedSamplerRuleAttributePatterns {\n /**\n * The attribute key to match against.\n * Property is required and must be non-null.\n */\n key: string;\n /**\n * Configure list of value patterns to include.\n * Values are evaluated to match as follows:\n * * If the value exactly matches.\n * * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * If omitted, all values are included.\n *\n * @minItems 1\n */\n included?: string[];\n /**\n * Configure list of value patterns to exclude. Applies after .included (i.e. excluded has higher priority than included).\n * Values are evaluated to match as follows:\n * * If the value exactly matches.\n * * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * If omitted, .included attributes are included.\n *\n * @minItems 1\n */\n excluded?: string[];\n}\n\n/**\n * Configure tracers.\n * If omitted, all tracers use default values as described in ExperimentalTracerConfig.\n */\nexport interface ExperimentalTracerConfigurator {\n default_config?: ExperimentalTracerConfig;\n /**\n * Configure tracers.\n * If omitted, all tracers use .default_config.\n *\n * @minItems 1\n */\n tracers?: ExperimentalTracerMatcherAndConfig[];\n}\n\n/**\n * Configure the default tracer config used there is no matching entry in .tracer_configurator/development.tracers.\n * If omitted, unmatched .tracers use default values as described in ExperimentalTracerConfig.\n */\nexport interface ExperimentalTracerConfig {\n /**\n * Configure if the tracer is enabled or not.\n * If omitted, true is used.\n */\n enabled?: boolean;\n}\n\nexport interface ExperimentalTracerMatcherAndConfig {\n /**\n * Configure tracer names to match, evaluated as follows:\n *\n * * If the tracer name exactly matches.\n * * If the tracer name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * Property is required and must be non-null.\n */\n name: string;\n config: ExperimentalTracerConfig;\n}\n\n/**\n * Configure resource for all signals.\n * If omitted, the default resource is used.\n */\nexport interface Resource {\n /**\n * Configure resource attributes. Entries have higher priority than entries from .resource.attributes_list.\n * If omitted, no resource attributes are added.\n *\n * @minItems 1\n */\n attributes?: AttributeNameValue[];\n 'detection/development'?: ExperimentalResourceDetection;\n /**\n * Configure resource schema URL.\n * If omitted or null, no schema URL is used.\n */\n schema_url?: string | null;\n /**\n * Configure resource attributes. Entries have lower priority than entries from .resource.attributes.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_RESOURCE_ATTRIBUTES. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration for details.\n * If omitted or null, no resource attributes are added.\n */\n attributes_list?: string | null;\n}\n\nexport interface AttributeNameValue {\n /**\n * The attribute name.\n * Property is required and must be non-null.\n */\n name: string;\n /**\n * The attribute value.\n * The type of value must match .type.\n * Property is required and must be non-null.\n */\n value: string | number | boolean | null | string[] | boolean[] | number[];\n type?: AttributeType;\n}\n\n/**\n * Configure resource detection.\n * If omitted, resource detection is disabled.\n */\nexport interface ExperimentalResourceDetection {\n attributes?: IncludeExclude;\n /**\n * Configure resource detectors.\n * Resource detector names are dependent on the SDK language ecosystem. Please consult documentation for each respective language.\n * If omitted, no resource detectors are enabled.\n *\n * @minItems 1\n */\n detectors?: ExperimentalResourceDetector[];\n}\n\nexport interface ExperimentalResourceDetector {\n container?: ExperimentalContainerResourceDetector;\n host?: ExperimentalHostResourceDetector;\n process?: ExperimentalProcessResourceDetector;\n service?: ExperimentalServiceResourceDetector;\n [k: string]: object | null | undefined;\n}\n\n/**\n * Configure instrumentation.\n * If omitted, instrumentation defaults are used.\n */\nexport interface ExperimentalInstrumentation {\n general?: ExperimentalGeneralInstrumentation;\n cpp?: ExperimentalLanguageSpecificInstrumentation;\n dotnet?: ExperimentalLanguageSpecificInstrumentation;\n erlang?: ExperimentalLanguageSpecificInstrumentation;\n go?: ExperimentalLanguageSpecificInstrumentation;\n java?: ExperimentalLanguageSpecificInstrumentation;\n js?: ExperimentalLanguageSpecificInstrumentation;\n php?: ExperimentalLanguageSpecificInstrumentation;\n python?: ExperimentalLanguageSpecificInstrumentation;\n ruby?: ExperimentalLanguageSpecificInstrumentation;\n rust?: ExperimentalLanguageSpecificInstrumentation;\n swift?: ExperimentalLanguageSpecificInstrumentation;\n}\n\n/**\n * Configure general SemConv options that may apply to multiple languages and instrumentations.\n * Instrumenation may merge general config options with the language specific configuration at .instrumentation.<language>.\n * If omitted, default values as described in ExperimentalGeneralInstrumentation are used.\n */\nexport interface ExperimentalGeneralInstrumentation {\n http?: ExperimentalHttpInstrumentation;\n code?: ExperimentalCodeInstrumentation;\n db?: ExperimentalDbInstrumentation;\n gen_ai?: ExperimentalGenAiInstrumentation;\n messaging?: ExperimentalMessagingInstrumentation;\n rpc?: ExperimentalRpcInstrumentation;\n sanitization?: ExperimentalSanitization;\n /**\n * Configure semantic convention stability opt-in as a comma-separated list.\n * This property follows the format and semantics of the OTEL_SEMCONV_STABILITY_OPT_IN environment variable.\n * Controls the emission of stable vs. experimental semantic conventions for instrumentation.\n * This setting is only intended for migrating from experimental to stable semantic conventions.\n *\n * Known values include:\n * - http: Emit stable HTTP and networking conventions only\n * - http/dup: Emit both old and stable HTTP and networking conventions (for phased migration)\n * - database: Emit stable database conventions only\n * - database/dup: Emit both old and stable database conventions (for phased migration)\n * - rpc: Emit stable RPC conventions only\n * - rpc/dup: Emit both experimental and stable RPC conventions (for phased migration)\n * - messaging: Emit stable messaging conventions only\n * - messaging/dup: Emit both old and stable messaging conventions (for phased migration)\n * - code: Emit stable code conventions only\n * - code/dup: Emit both old and stable code conventions (for phased migration)\n *\n * Multiple values can be specified as a comma-separated list (e.g., \"http,database/dup\").\n * Additional signal types may be supported in future versions.\n *\n * Domain-specific semconv properties (e.g., .instrumentation/development.general.db.semconv) take precedence over this general setting.\n *\n * See:\n * - HTTP migration: https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/\n * - Database migration: https://opentelemetry.io/docs/specs/semconv/database/\n * - RPC: https://opentelemetry.io/docs/specs/semconv/rpc/\n * - Messaging: https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/\n * If omitted or null, no opt-in is configured and instrumentations continue emitting their default semantic convention version.\n */\n stability_opt_in_list?: string | null;\n}\n\n/**\n * Configure instrumentations following the http semantic conventions.\n * See http semantic conventions: https://opentelemetry.io/docs/specs/semconv/http/\n * If omitted, defaults as described in ExperimentalHttpInstrumentation are used.\n */\nexport interface ExperimentalHttpInstrumentation {\n semconv?: ExperimentalSemconvConfig;\n client?: ExperimentalHttpClientInstrumentation;\n server?: ExperimentalHttpServerInstrumentation;\n}\n\n/**\n * Configure HTTP semantic convention version and migration behavior.\n *\n * This property takes precedence over the .instrumentation/development.general.stability_opt_in_list setting.\n *\n * See HTTP migration: https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/\n * If omitted, uses the general stability_opt_in_list setting, or instrumentations continue emitting their default semantic convention version if not set.\n */\nexport interface ExperimentalSemconvConfig {\n /**\n * The target semantic convention version for this domain (e.g., 1).\n * If omitted or null, the latest stable version is used, or if no stable version is available and .experimental is true then the latest experimental version is used.\n */\n version?: number | null;\n /**\n * Use latest experimental semantic conventions (before stable is available or to enable experimental features on top of stable conventions).\n * If omitted or null, false is used.\n */\n experimental?: boolean | null;\n /**\n * When true, also emit the previous major version alongside the target version.\n * For version=1, the previous version refers to the pre-stable conventions that the instrumentation emitted before the first stable semantic convention version was defined.\n * For version=2 and above, the previous version is the prior stable major version (e.g., version=2, dual_emit=true emits both v2 and v1).\n * Enables dual-emit for phased migration between versions.\n * If omitted or null, false is used.\n */\n dual_emit?: boolean | null;\n}\n\n/**\n * Configure instrumentations following the http client semantic conventions.\n * If omitted, defaults as described in ExperimentalHttpClientInstrumentation are used.\n */\nexport interface ExperimentalHttpClientInstrumentation {\n /**\n * Configure headers to capture for outbound http requests.\n * If omitted, no outbound request headers are captured.\n *\n * @minItems 1\n */\n request_captured_headers?: string[];\n /**\n * Configure headers to capture for inbound http responses.\n * If omitted, no inbound response headers are captured.\n *\n * @minItems 1\n */\n response_captured_headers?: string[];\n /**\n * Override the default list of known HTTP methods.\n * Known methods are case-sensitive.\n * This is a full override of the default known methods, not a list of known methods in addition to the defaults.\n * If omitted, HTTP methods GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH are known.\n *\n * @minItems 0\n */\n known_methods?: string[];\n}\n\n/**\n * Configure instrumentations following the http server semantic conventions.\n * If omitted, defaults as described in ExperimentalHttpServerInstrumentation are used.\n */\nexport interface ExperimentalHttpServerInstrumentation {\n /**\n * Configure headers to capture for inbound http requests.\n * If omitted, no request headers are captured.\n *\n * @minItems 1\n */\n request_captured_headers?: string[];\n /**\n * Configure headers to capture for outbound http responses.\n * If omitted, no response headers are captures.\n *\n * @minItems 1\n */\n response_captured_headers?: string[];\n /**\n * Override the default list of known HTTP methods.\n * Known methods are case-sensitive.\n * This is a full override of the default known methods, not a list of known methods in addition to the defaults.\n * If omitted, HTTP methods GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH are known.\n *\n * @minItems 0\n */\n known_methods?: string[];\n}\n\n/**\n * Configure instrumentations following the code semantic conventions.\n * See code semantic conventions: https://opentelemetry.io/docs/specs/semconv/registry/attributes/code/\n * If omitted, defaults as described in ExperimentalCodeInstrumentation are used.\n */\nexport interface ExperimentalCodeInstrumentation {\n semconv?: ExperimentalSemconvConfig;\n}\n\n/**\n * Configure instrumentations following the database semantic conventions.\n * See database semantic conventions: https://opentelemetry.io/docs/specs/semconv/database/\n * If omitted, defaults as described in ExperimentalDbInstrumentation are used.\n */\nexport interface ExperimentalDbInstrumentation {\n semconv?: ExperimentalSemconvConfig;\n}\n\n/**\n * Configure instrumentations following the GenAI semantic conventions.\n * See GenAI semantic conventions: https://opentelemetry.io/docs/specs/semconv/gen-ai/\n * If omitted, defaults as described in ExperimentalGenAiInstrumentation are used.\n */\nexport interface ExperimentalGenAiInstrumentation {\n semconv?: ExperimentalSemconvConfig;\n}\n\n/**\n * Configure instrumentations following the messaging semantic conventions.\n * See messaging semantic conventions: https://opentelemetry.io/docs/specs/semconv/messaging/\n * If omitted, defaults as described in ExperimentalMessagingInstrumentation are used.\n */\nexport interface ExperimentalMessagingInstrumentation {\n semconv?: ExperimentalSemconvConfig;\n}\n\n/**\n * Configure instrumentations following the RPC semantic conventions.\n * See RPC semantic conventions: https://opentelemetry.io/docs/specs/semconv/rpc/\n * If omitted, defaults as described in ExperimentalRpcInstrumentation are used.\n */\nexport interface ExperimentalRpcInstrumentation {\n semconv?: ExperimentalSemconvConfig;\n}\n\n/**\n * Configure general sanitization options.\n * If omitted, defaults as described in ExperimentalSanitization are used.\n */\nexport interface ExperimentalSanitization {\n url?: ExperimentalUrlSanitization;\n}\n\n/**\n * Configure URL sanitization options.\n * If omitted, defaults as described in ExperimentalUrlSanitization are used.\n */\nexport interface ExperimentalUrlSanitization {\n /**\n * List of query parameter names whose values should be redacted from URLs.\n * Query parameter names are case-sensitive.\n * This is a full override of the default sensitive query parameter keys, it is not a list of keys in addition to the defaults.\n * Set to an empty array to disable query parameter redaction.\n * If omitted, the default sensitive query parameter list as defined by the url semantic conventions (https://github.com/open-telemetry/semantic-conventions/blob/main/docs/registry/attributes/url.md) is used.\n *\n * @minItems 0\n */\n sensitive_query_parameters?: string[];\n}\n\n/**\n * Configure C++ language-specific instrumentation libraries.\n * If omitted, instrumentation defaults are used.\n */\nexport interface ExperimentalLanguageSpecificInstrumentation {\n [k: string]: object;\n}\n\n/**\n * Defines configuration parameters specific to a particular OpenTelemetry distribution or vendor.\n * This section provides a standardized location for distribution-specific settings\n * that are not part of the OpenTelemetry configuration model.\n * It allows vendors to expose their own extensions and general configuration options.\n * If omitted, distribution defaults are used.\n */\nexport interface Distribution {\n [k: string]: object;\n}\n"]}
export type { ConfigFactory } from './IConfigFactory';
export type { ConfigurationModel, LogRecordExporter as LogRecordExporterConfigModel, PushMetricExporter as PushMetricExporterConfigModel, InstrumentType as InstrumentTypeConfigModel, Aggregation as AggregationConfigModel, PeriodicMetricReader as PeriodicMetricReaderConfigModel, Sampler as SamplerConfigModel, SpanExporter as SpanExporterConfigModel, SpanProcessor as SpanProcessorConfigModel, NameStringValuePair as NameStringValuePairConfigModel, HttpTls as HttpTlsConfigModel, SeverityNumber as SeverityNumberConfigModel, } from './generated/types';
export type { ConfigurationModel, LogRecordExporter as LogRecordExporterConfigModel, PushMetricExporter as PushMetricExporterConfigModel, InstrumentType as InstrumentTypeConfigModel, Aggregation as AggregationConfigModel, PeriodicMetricReader as PeriodicMetricReaderConfigModel, Sampler as SamplerConfigModel, SpanExporter as SpanExporterConfigModel, SpanProcessor as SpanProcessorConfigModel, MetricProducer as MetricProducerConfigModel, NameStringValuePair as NameStringValuePairConfigModel, HttpTls as HttpTlsConfigModel, GrpcTls as GrpcTlsConfigModel, SeverityNumber as SeverityNumberConfigModel, } from './generated/types';
export { createConfigFactory } from './ConfigFactory';
//# sourceMappingURL=index.d.ts.map

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

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiBH,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type { ConfigFactory } from './IConfigFactory';\nexport type {\n ConfigurationModel,\n LogRecordExporter as LogRecordExporterConfigModel,\n PushMetricExporter as PushMetricExporterConfigModel,\n InstrumentType as InstrumentTypeConfigModel,\n Aggregation as AggregationConfigModel,\n PeriodicMetricReader as PeriodicMetricReaderConfigModel,\n Sampler as SamplerConfigModel,\n SpanExporter as SpanExporterConfigModel,\n SpanProcessor as SpanProcessorConfigModel,\n NameStringValuePair as NameStringValuePairConfigModel,\n HttpTls as HttpTlsConfigModel,\n SeverityNumber as SeverityNumberConfigModel,\n} from './generated/types';\nexport { createConfigFactory } from './ConfigFactory';\n"]}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmBH,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport type { ConfigFactory } from './IConfigFactory';\nexport type {\n ConfigurationModel,\n LogRecordExporter as LogRecordExporterConfigModel,\n PushMetricExporter as PushMetricExporterConfigModel,\n InstrumentType as InstrumentTypeConfigModel,\n Aggregation as AggregationConfigModel,\n PeriodicMetricReader as PeriodicMetricReaderConfigModel,\n Sampler as SamplerConfigModel,\n SpanExporter as SpanExporterConfigModel,\n SpanProcessor as SpanProcessorConfigModel,\n MetricProducer as MetricProducerConfigModel,\n NameStringValuePair as NameStringValuePairConfigModel,\n HttpTls as HttpTlsConfigModel,\n GrpcTls as GrpcTlsConfigModel,\n SeverityNumber as SeverityNumberConfigModel,\n} from './generated/types';\nexport { createConfigFactory } from './ConfigFactory';\n"]}

@@ -0,3 +1,14 @@

import * as yaml from 'yaml';
import type { ConfigurationModel, GrpcTls, HttpTls } from './generated/types';
export declare function envVariableSubstitution(value: string): string;
/**
* Handle (Environment) variable substitution per
* https://opentelemetry.io/docs/specs/otel/configuration/data-model/#environment-variable-substitution
*
* This changes the yaml.Document in-place.
* This must work with a yaml.Document, rather than a raw JS object from
* `yaml.parse()`, to distinguish between `foo: ${BAR}` and `foo: "${BAR}"`.
*
* Exported for testing.
*/
export declare function substituteEnvVars(doc: yaml.Document): void;
export declare function getGrpcTlsConfig(certificateFile?: string, clientKeyFile?: string, clientCertificateFile?: string, insecure?: boolean): GrpcTls | undefined;

@@ -4,0 +15,0 @@ export declare function initializeDefaultConfiguration(): ConfigurationModel;

@@ -7,27 +7,101 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getHttpTlsConfig = exports.initializeDefaultLoggerProviderConfiguration = exports.initializeDefaultMeterProviderConfiguration = exports.initializeDefaultTracerProviderConfiguration = exports.initializeDefaultConfiguration = exports.getGrpcTlsConfig = exports.envVariableSubstitution = void 0;
exports.getHttpTlsConfig = exports.initializeDefaultLoggerProviderConfiguration = exports.initializeDefaultMeterProviderConfiguration = exports.initializeDefaultTracerProviderConfiguration = exports.initializeDefaultConfiguration = exports.getGrpcTlsConfig = exports.substituteEnvVars = void 0;
const yaml = require("yaml");
const core_1 = require("@opentelemetry/core");
function envVariableSubstitution(value) {
const str = String(value);
// Spec ABNF: $$ is a literal $; ${VAR}, ${VAR:-default}, ${env:VAR}, ${env:VAR:-default}
const TOKEN_RE = /\$\$|\$\{(?:env:)?([a-zA-Z_][a-zA-Z0-9_]*)(?::-(.*?))?\}/g;
let result = '';
let lastIndex = 0;
let match;
while ((match = TOKEN_RE.exec(str)) !== null) {
result += str.slice(lastIndex, match.index);
if (match[0] === '$$') {
result += '$';
/**
* Handle (Environment) variable substitution per
* https://opentelemetry.io/docs/specs/otel/configuration/data-model/#environment-variable-substitution
*
* This changes the yaml.Document in-place.
* This must work with a yaml.Document, rather than a raw JS object from
* `yaml.parse()`, to distinguish between `foo: ${BAR}` and `foo: "${BAR}"`.
*
* Exported for testing.
*/
function substituteEnvVars(doc) {
// Visit each scalar string value in the document. These are
// the candidates for env var substitution.
yaml.visit(doc, {
Scalar: (key, node, _path) => {
if (key === 'key')
return; // skip mapping keys
if (typeof node.value !== 'string')
return;
let subbed = envVarSubst(node.value);
if (subbed !== node.value && node.type === yaml.Scalar.PLAIN) {
// "PLAIN" here is a simple YAML value (e.g. 42 in `foo: 42`).
// I.e., not quoted (`foo: "42"`) or in a block.
subbed = yamlScalarCoerce(subbed);
}
node.value = subbed;
},
});
}
exports.substituteEnvVars = substituteEnvVars;
// ENV_SUBSTITUTION_RE *mostly* matches the `ENV-SUBSTITUTION` ABNF from the
// spec with the exception of the DEFAULT-VALUE: we are using `[^\n}]*`
// (copying the OTel Java regex) rather than a regex closer to ABNF
// `*(VCHAR-WSP-NO-RBRACE)` (which is slightly ambiguous on what whitespace is
// allowed in WSP).
const ENV_SUBSTITUTION_RE = /^([a-zA-Z_][a-zA-Z0-9_]*)(?::-([^\n}]*))?$/;
/**
* Do environment variable substitution for the given string value.
*/
function envVarSubst(s) {
const ESCAPE_RE = /(\$\$)/;
const chunks = s.split(ESCAPE_RE);
for (let i = 0; i < chunks.length; ++i) {
if (i % 2 === 1) {
// Odd chunks are matched escape sequences, i.e. '$$'.
chunks[i] = '$';
continue;
}
else {
const varName = match[1];
const defaultValue = match[2] ?? '';
result += (0, core_1.getStringFromEnv)(varName) || defaultValue;
// Even chunks are processed for possible substition matches.
const SUBSTITUTION_REF_RE = /\$\{(?:env:)?([^}]+)\}/g;
let chunk = '';
let lastIndex = 0;
let match;
while ((match = SUBSTITUTION_REF_RE.exec(chunks[i])) !== null) {
chunk += chunks[i].slice(lastIndex, match.index);
const envMatch = ENV_SUBSTITUTION_RE.exec(match[1]);
if (!envMatch) {
// E.g.: `key: ${STRING_VALUE:?error}` test case
throw new Error(`parse error: invalid env var substitution: ${match[0]}`);
}
const envName = envMatch[1];
const defaultValue = envMatch[2] ?? '';
chunk += (0, core_1.getStringFromEnv)(envName) || defaultValue;
lastIndex = SUBSTITUTION_REF_RE.lastIndex;
}
lastIndex = TOKEN_RE.lastIndex;
chunk += chunks[i].slice(lastIndex);
chunks[i] = chunk;
}
result += str.slice(lastIndex);
const result = chunks.join('');
return result;
}
exports.envVariableSubstitution = envVariableSubstitution;
/**
* Re-interpret a string value from env var substitution as a possible
* YAML number, boolean, or null value.
*
* If the interpretted value is any other type, we return the original
* string:
* - sequences and mappings may not result from env var substitution, per the spec
* - a re-parsed YAML string normalizes whitespace, which we do not want
*/
function yamlScalarCoerce(value) {
let coerced;
try {
coerced = yaml.parse(value, { version: '1.2' });
}
catch {
return value;
}
const type = typeof coerced;
if (coerced === null || type === 'number' || type === 'boolean') {
return coerced;
}
else {
return value;
}
}
function getGrpcTlsConfig(certificateFile, clientKeyFile, clientCertificateFile, insecure) {

@@ -34,0 +108,0 @@ if (certificateFile || clientKeyFile || clientCertificateFile) {

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

{"version":3,"file":"utils.js","sourceRoot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tC,iCAAiC,EAAE,EAAE;KACtC,CAAC;AACJ,CAAC;AARD,oGAQC;AAED,SAAgB,gBAAgB,CAC9B,eAAwB,EACxB,aAAsB,EACtB,qBAA8B;IAE9B,IAAI,eAAe,IAAI,aAAa,IAAI,qBAAqB,EAAE;QAC7D,MAAM,GAAG,GAAY,EAAE,CAAC;QACxB,IAAI,eAAe,EAAE;YACnB,GAAG,CAAC,OAAO,GAAG,eAAe,CAAC;SAC/B;QACD,IAAI,aAAa,EAAE;YACjB,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC;SAC9B;QACD,IAAI,qBAAqB,EAAE;YACzB,GAAG,CAAC,SAAS,GAAG,qBAAqB,CAAC;SACvC;QACD,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAnBD,4CAmBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport type { ConfigurationModel, GrpcTls, HttpTls } from './generated/types';\n\nexport function envVariableSubstitution(value: string): string {\n const str = String(value);\n // Spec ABNF: $$ is a literal $; ${VAR}, ${VAR:-default}, ${env:VAR}, ${env:VAR:-default}\n const TOKEN_RE = /\\$\\$|\\$\\{(?:env:)?([a-zA-Z_][a-zA-Z0-9_]*)(?::-(.*?))?\\}/g;\n let result = '';\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n while ((match = TOKEN_RE.exec(str)) !== null) {\n result += str.slice(lastIndex, match.index);\n if (match[0] === '$$') {\n result += '$';\n } else {\n const varName = match[1];\n const defaultValue = match[2] ?? '';\n result += getStringFromEnv(varName) || defaultValue;\n }\n lastIndex = TOKEN_RE.lastIndex;\n }\n\n result += str.slice(lastIndex);\n return result;\n}\n\nexport function getGrpcTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string,\n insecure?: boolean\n): GrpcTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: GrpcTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n if (insecure !== undefined) {\n tls.insecure = insecure;\n }\n return tls;\n }\n return undefined;\n}\n\nexport function initializeDefaultConfiguration(): ConfigurationModel {\n return {\n disabled: false,\n resource: {},\n attribute_limits: {\n attribute_count_limit: 128,\n },\n };\n}\n\nexport function initializeDefaultTracerProviderConfiguration(): NonNullable<\n ConfigurationModel['tracer_provider']\n> {\n return {\n processors: [],\n limits: {\n attribute_count_limit: 128,\n event_count_limit: 128,\n link_count_limit: 128,\n event_attribute_count_limit: 128,\n link_attribute_count_limit: 128,\n },\n sampler: {\n parent_based: {\n root: { always_on: undefined },\n remote_parent_sampled: { always_on: undefined },\n remote_parent_not_sampled: { always_off: undefined },\n local_parent_sampled: { always_on: undefined },\n local_parent_not_sampled: { always_off: undefined },\n },\n },\n };\n}\n\nexport function initializeDefaultMeterProviderConfiguration(): NonNullable<\n ConfigurationModel['meter_provider']\n> {\n return {\n readers: [],\n views: [],\n exemplar_filter: 'trace_based',\n };\n}\n\nexport function initializeDefaultLoggerProviderConfiguration(): NonNullable<\n ConfigurationModel['logger_provider']\n> {\n return {\n processors: [],\n limits: { attribute_count_limit: 128 },\n 'logger_configurator/development': {},\n };\n}\n\nexport function getHttpTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string\n): HttpTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: HttpTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n return tls;\n }\n return undefined;\n}\n"]}
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,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,EAAE;gBAC9B,qBAAqB,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE;gBAC/C,yBAAyB,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;gBACpD,oBAAoB,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE;gBAC9C,wBAAwB,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;aACpD;SACF;KACF,CAAC;AACJ,CAAC;AAtBD,oGAsBC;AAED,SAAgB,2CAA2C;IAGzD,OAAO;QACL,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;QACT,eAAe,EAAE,aAAa;KAC/B,CAAC;AACJ,CAAC;AARD,kGAQC;AAED,SAAgB,4CAA4C;IAG1D,OAAO;QACL,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,EAAE,qBAAqB,EAAE,GAAG,EAAE;QACtC,iCAAiC,EAAE,EAAE;KACtC,CAAC;AACJ,CAAC;AARD,oGAQC;AAED,SAAgB,gBAAgB,CAC9B,eAAwB,EACxB,aAAsB,EACtB,qBAA8B;IAE9B,IAAI,eAAe,IAAI,aAAa,IAAI,qBAAqB,EAAE;QAC7D,MAAM,GAAG,GAAY,EAAE,CAAC;QACxB,IAAI,eAAe,EAAE;YACnB,GAAG,CAAC,OAAO,GAAG,eAAe,CAAC;SAC/B;QACD,IAAI,aAAa,EAAE;YACjB,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC;SAC9B;QACD,IAAI,qBAAqB,EAAE;YACzB,GAAG,CAAC,SAAS,GAAG,qBAAqB,CAAC;SACvC;QACD,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAnBD,4CAmBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as yaml from 'yaml';\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport type { ConfigurationModel, GrpcTls, HttpTls } from './generated/types';\n\n/**\n * Handle (Environment) variable substitution per\n * https://opentelemetry.io/docs/specs/otel/configuration/data-model/#environment-variable-substitution\n *\n * This changes the yaml.Document in-place.\n * This must work with a yaml.Document, rather than a raw JS object from\n * `yaml.parse()`, to distinguish between `foo: ${BAR}` and `foo: \"${BAR}\"`.\n *\n * Exported for testing.\n */\nexport function substituteEnvVars(doc: yaml.Document) {\n // Visit each scalar string value in the document. These are\n // the candidates for env var substitution.\n yaml.visit(doc, {\n Scalar: (key, node, _path) => {\n if (key === 'key') return; // skip mapping keys\n if (typeof node.value !== 'string') return;\n let subbed: string | null | number | boolean = envVarSubst(node.value);\n if (subbed !== node.value && node.type === yaml.Scalar.PLAIN) {\n // \"PLAIN\" here is a simple YAML value (e.g. 42 in `foo: 42`).\n // I.e., not quoted (`foo: \"42\"`) or in a block.\n subbed = yamlScalarCoerce(subbed);\n }\n node.value = subbed;\n },\n });\n}\n\n// ENV_SUBSTITUTION_RE *mostly* matches the `ENV-SUBSTITUTION` ABNF from the\n// spec with the exception of the DEFAULT-VALUE: we are using `[^\\n}]*`\n// (copying the OTel Java regex) rather than a regex closer to ABNF\n// `*(VCHAR-WSP-NO-RBRACE)` (which is slightly ambiguous on what whitespace is\n// allowed in WSP).\nconst ENV_SUBSTITUTION_RE = /^([a-zA-Z_][a-zA-Z0-9_]*)(?::-([^\\n}]*))?$/;\n\n/**\n * Do environment variable substitution for the given string value.\n */\nfunction envVarSubst(s: string): string {\n const ESCAPE_RE = /(\\$\\$)/;\n const chunks = s.split(ESCAPE_RE);\n for (let i = 0; i < chunks.length; ++i) {\n if (i % 2 === 1) {\n // Odd chunks are matched escape sequences, i.e. '$$'.\n chunks[i] = '$';\n continue;\n }\n\n // Even chunks are processed for possible substition matches.\n const SUBSTITUTION_REF_RE = /\\$\\{(?:env:)?([^}]+)\\}/g;\n let chunk = '';\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = SUBSTITUTION_REF_RE.exec(chunks[i])) !== null) {\n chunk += chunks[i].slice(lastIndex, match.index);\n const envMatch = ENV_SUBSTITUTION_RE.exec(match[1]);\n if (!envMatch) {\n // E.g.: `key: ${STRING_VALUE:?error}` test case\n throw new Error(\n `parse error: invalid env var substitution: ${match[0]}`\n );\n }\n const envName = envMatch[1];\n const defaultValue = envMatch[2] ?? '';\n chunk += getStringFromEnv(envName) || defaultValue;\n lastIndex = SUBSTITUTION_REF_RE.lastIndex;\n }\n chunk += chunks[i].slice(lastIndex);\n chunks[i] = chunk;\n }\n\n const result = chunks.join('');\n return result;\n}\n\n/**\n * Re-interpret a string value from env var substitution as a possible\n * YAML number, boolean, or null value.\n *\n * If the interpretted value is any other type, we return the original\n * string:\n * - sequences and mappings may not result from env var substitution, per the spec\n * - a re-parsed YAML string normalizes whitespace, which we do not want\n */\nfunction yamlScalarCoerce(value: string): string | null | number | boolean {\n let coerced;\n try {\n coerced = yaml.parse(value, { version: '1.2' });\n } catch {\n return value;\n }\n const type = typeof coerced;\n if (coerced === null || type === 'number' || type === 'boolean') {\n return coerced;\n } else {\n return value;\n }\n}\n\nexport function getGrpcTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string,\n insecure?: boolean\n): GrpcTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: GrpcTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n if (insecure !== undefined) {\n tls.insecure = insecure;\n }\n return tls;\n }\n return undefined;\n}\n\nexport function initializeDefaultConfiguration(): ConfigurationModel {\n return {\n disabled: false,\n resource: {},\n attribute_limits: {\n attribute_count_limit: 128,\n },\n };\n}\n\nexport function initializeDefaultTracerProviderConfiguration(): NonNullable<\n ConfigurationModel['tracer_provider']\n> {\n return {\n processors: [],\n limits: {\n attribute_count_limit: 128,\n event_count_limit: 128,\n link_count_limit: 128,\n event_attribute_count_limit: 128,\n link_attribute_count_limit: 128,\n },\n sampler: {\n parent_based: {\n root: { always_on: undefined },\n remote_parent_sampled: { always_on: undefined },\n remote_parent_not_sampled: { always_off: undefined },\n local_parent_sampled: { always_on: undefined },\n local_parent_not_sampled: { always_off: undefined },\n },\n },\n };\n}\n\nexport function initializeDefaultMeterProviderConfiguration(): NonNullable<\n ConfigurationModel['meter_provider']\n> {\n return {\n readers: [],\n views: [],\n exemplar_filter: 'trace_based',\n };\n}\n\nexport function initializeDefaultLoggerProviderConfiguration(): NonNullable<\n ConfigurationModel['logger_provider']\n> {\n return {\n processors: [],\n limits: { attribute_count_limit: 128 },\n 'logger_configurator/development': {},\n };\n}\n\nexport function getHttpTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string\n): HttpTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: HttpTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n return tls;\n }\n return undefined;\n}\n"]}

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

export declare const VERSION = "0.218.0";
export declare const VERSION = "0.219.0";
//# sourceMappingURL=version.d.ts.map

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

// this is autogenerated file, see scripts/version-update.js
exports.VERSION = '0.218.0';
exports.VERSION = '0.219.0';
//# sourceMappingURL=version.js.map

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

{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.218.0';\n"]}
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.219.0';\n"]}
{
"name": "@opentelemetry/configuration",
"version": "0.218.0",
"version": "0.219.0",
"description": "OpenTelemetry Configuration",

@@ -14,4 +14,4 @@ "main": "build/src/index.js",

"test": "nyc mocha test/**/*.test.ts",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"version": "node ../../../scripts/version-update.js",

@@ -43,3 +43,3 @@ "watch": "tsc --build --watch",

"dependencies": {
"@opentelemetry/core": "2.7.1",
"@opentelemetry/core": "2.8.0",
"yaml": "^2.0.0"

@@ -60,3 +60,3 @@ },

"sinon": "18.0.1",
"ts-loader": "9.5.4",
"ts-loader": "9.5.7",
"typescript": "5.0.4"

@@ -66,3 +66,3 @@ },

"sideEffects": false,
"gitHead": "06ad0eaaecbd49f5ead871325f852cc2a3454079"
"gitHead": "13a035bc695996cf4aec885fef7b9866f48bc555"
}