@opentelemetry/configuration
Advanced tools
@@ -349,4 +349,4 @@ "use strict"; | ||
| port: (0, core_1.getNumberFromEnv)('OTEL_EXPORTER_PROMETHEUS_PORT') ?? 9464, | ||
| without_scope_info: false, | ||
| 'without_target_info/development': false, | ||
| scope_info_enabled: true, | ||
| 'target_info_enabled/development': true, | ||
| }, | ||
@@ -353,0 +353,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,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7B,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC3C,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CA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BACL,MAAM,GAAG,GAAG,IAAA,wBAAgB,EAC1B,eAAe,EACf,aAAa,EACb,qBAAqB,CACtB,CAAC;gBACF,MAAM,QAAQ,GACZ,QAAQ,KAAK,WAAW;oBACtB,CAAC,CAAC,MAAM;oBACR,CAAC,CAAC,QAAQ,KAAK,eAAe;wBAC5B,CAAC,CAAC,UAAU;wBACZ,CAAC,CAAC,SAAS,CAAC;gBAClB,MAAM,QAAQ,GAAgD;oBAC5D,QAAQ,EACN,IAAA,uBAAgB,EAAC,kCAAkC,CAAC;wBACpD,CAAC,IAAA,uBAAgB,EAAC,6BAA6B,CAAC;4BAC9C,CAAC,CAAC,GAAG,IAAA,uBAAgB,EAAC,6BAA6B,CAAC,UAAU;4BAC9D,CAAC,CAAC,+BAA+B,CAAC;oBACtC,OAAO;oBACP,GAAG,CAAC,GAAG,KAAK,SAAS,IAAI,EAAE,GAAG,EAAE,CAAC;oBACjC,GAAG,CAAC,WAAW,KAAK,SAAS,IAAI,EAAE,WAAW,EAAE,CAAC;oBACjD,GAAG,CAAC,WAAW,KAAK,SAAS,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;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 = 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"]} | ||
| {"version":3,"file":"EnvironmentConfigFactory.js","sourceRoot":"","sources":["../../src/EnvironmentConfigFactory.ts"],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AC;wBACpD,CAAC,IAAA,uBAAgB,EAAC,6BAA6B,CAAC;4BAC9C,CAAC,CAAC,GAAG,IAAA,uBAAgB,EAAC,6BAA6B,CAAC,UAAU;4BAC9D,CAAC,CAAC,+BAA+B,CAAC;oBACtC,OAAO;oBACP,GAAG,CAAC,GAAG,KAAK,SAAS,IAAI,EAAE,GAAG,EAAE,CAAC;oBACjC,GAAG,CAAC,WAAW,KAAK,SAAS,IAAI,EAAE,WAAW,EAAE,CAAC;oBACjD,GAAG,CAAC,WAAW,KAAK,SAAS,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;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 = 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 scope_info_enabled: true,\n 'target_info_enabled/development': true,\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"]} |
| import type { ConfigFactory } from './IConfigFactory'; | ||
| import type { ConfigurationModel } from './generated/types'; | ||
| import type { AttributeNameValue, ConfigurationModel, TextMapPropagator } from './generated/types'; | ||
| export declare class FileConfigFactory implements ConfigFactory { | ||
@@ -9,2 +9,20 @@ private _config; | ||
| export declare function parseConfigFile(): ConfigurationModel; | ||
| /** | ||
| * Merge attributes from `resource.attributes` and `resource.attributes_list` | ||
| * (comma-separated key=value pairs) into an `AttributeNameValue[]` array. | ||
| * Entries already in `resource.attributes` taking precedence. | ||
| * | ||
| * Note: The returned array might not be a copy, so it should not be mutated. | ||
| */ | ||
| export declare function mergeResourceAttributesConfig(attributes?: AttributeNameValue[], attributes_list?: string | null): AttributeNameValue[] | undefined; | ||
| /** | ||
| * Merge propagator.composite_list (comma-separated propagator names) into | ||
| * propagator.composite, with entries already in composite taking precedence. | ||
| * Merge TextMapPropagator configs from `propagator.composite` and `propagator.composite_list` | ||
| * (comma-separated names) into a `TextMapPropagator[]` array. | ||
| * Entries already in `propagator.composite` taking precedence. | ||
| * | ||
| * Note: The returned array might not be a copy, so it should not be mutated. | ||
| */ | ||
| export declare function mergePropagatorCompositeConfig(composite?: TextMapPropagator[], composite_list?: string | null): TextMapPropagator[] | undefined; | ||
| //# sourceMappingURL=FileConfigFactory.d.ts.map |
@@ -7,3 +7,4 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.parseConfigFile = exports.FileConfigFactory = void 0; | ||
| exports.mergePropagatorCompositeConfig = exports.mergeResourceAttributesConfig = exports.parseConfigFile = exports.FileConfigFactory = void 0; | ||
| const api_1 = require("@opentelemetry/api"); | ||
| const core_1 = require("@opentelemetry/core"); | ||
@@ -26,4 +27,29 @@ const fs = require("fs"); | ||
| exports.FileConfigFactory = FileConfigFactory; | ||
| // The schema version this SDK targets. Per the configuration versioning spec, | ||
| // an implementation MUST reject a config file whose MAJOR version differs (a | ||
| // breaking-change boundary), accepts any MINOR version within that major, and | ||
| // SHOULD warn when the MINOR version is newer than it targets since unknown | ||
| // settings may be ignored. See | ||
| // https://github.com/open-telemetry/opentelemetry-configuration/blob/main/VERSIONING.md | ||
| const SUPPORTED_FILE_FORMAT_MAJOR = 1; | ||
| const SUPPORTED_FILE_FORMAT_MINOR = 1; | ||
| function validateFileFormat(configFile, fileFormat) { | ||
| if (typeof fileFormat !== 'string' || fileFormat.length === 0) { | ||
| throw new Error(`${configFile}: Unsupported file_format: "${fileFormat}". Expected a "MAJOR.MINOR" version string.`); | ||
| } | ||
| // Drop any pre-release / meta tag, e.g. "1.0-rc.2" -> "1.0". | ||
| const parts = fileFormat.split('-', 1)[0].split('.'); | ||
| const major = Number(parts[0]); | ||
| const minor = parts.length > 1 ? Number(parts[1]) : 0; | ||
| if (!Number.isInteger(major) || !Number.isInteger(minor)) { | ||
| throw new Error(`${configFile}: Unsupported file_format: "${fileFormat}". Expected "MAJOR.MINOR" version numbers.`); | ||
| } | ||
| if (major !== SUPPORTED_FILE_FORMAT_MAJOR) { | ||
| throw new Error(`${configFile}: Unsupported file_format: "${fileFormat}". This SDK supports schema version ${SUPPORTED_FILE_FORMAT_MAJOR}.x.`); | ||
| } | ||
| if (minor > SUPPORTED_FILE_FORMAT_MINOR) { | ||
| api_1.diag.warn(`${configFile}: Configuration file_format "${fileFormat}" has a newer minor version than this SDK supports (${SUPPORTED_FILE_FORMAT_MAJOR}.${SUPPORTED_FILE_FORMAT_MINOR}); some settings may be ignored.`); | ||
| } | ||
| } | ||
| function parseConfigFile() { | ||
| const supportedFileVersionPattern = /^1\.0$/; | ||
| const configFile = (0, core_1.getStringFromEnv)('OTEL_CONFIG_FILE') || ''; | ||
@@ -34,6 +60,3 @@ const file = fs.readFileSync(configFile, 'utf8'); | ||
| const processed = doc.toJS(); | ||
| const fileFormat = processed?.file_format; | ||
| if (!fileFormat || !supportedFileVersionPattern.test(String(fileFormat))) { | ||
| throw new Error(`${configFile}: Unsupported file_format: "${fileFormat}". Must match ${supportedFileVersionPattern}.`); | ||
| } | ||
| validateFileFormat(configFile, processed?.file_format); | ||
| const valid = validateConfig(processed); | ||
@@ -62,8 +85,2 @@ if (!valid) { | ||
| delete data['file_format']; | ||
| applyConfigDefaults(data); | ||
| mergeAttributesList(data); | ||
| mergeCompositeList(data); | ||
| applyBatchProcessorDefaults(data); | ||
| applyPeriodicReaderDefaults(data); | ||
| applyOtlpHttpEncodingDefaults(data); | ||
| return data; | ||
@@ -73,130 +90,77 @@ } | ||
| /** | ||
| * Apply default encoding ('protobuf') to all otlp_http exporters in the config | ||
| * where encoding was not explicitly specified. The spec defines protobuf as the | ||
| * default encoding for OTLP HTTP exporters. | ||
| * Merge attributes from `resource.attributes` and `resource.attributes_list` | ||
| * (comma-separated key=value pairs) into an `AttributeNameValue[]` array. | ||
| * Entries already in `resource.attributes` taking precedence. | ||
| * | ||
| * Note: The returned array might not be a copy, so it should not be mutated. | ||
| */ | ||
| function applyOtlpHttpEncodingDefaults(data) { | ||
| const applyEncoding = (exporter) => { | ||
| if (exporter && exporter.encoding == null) { | ||
| exporter.encoding = 'protobuf'; | ||
| function mergeResourceAttributesConfig(attributes, attributes_list) { | ||
| if (!attributes_list) { | ||
| return attributes; | ||
| } | ||
| const mergedAttrs = attributes ? attributes.slice() : []; | ||
| const existingNames = new Set(mergedAttrs.map(a => a.name)); | ||
| // TODO(6842): handle attribute limits, if any | ||
| let discard = false; | ||
| const listAttrs = {}; | ||
| for (const pair of attributes_list.split(',')) { | ||
| if (pair.trim() === '') | ||
| continue; | ||
| const parts = pair.split('='); | ||
| if (parts.length !== 2) { | ||
| api_1.diag.warn(`Invalid format for resource.attributes_list entry "${pair}": expected key=value with '=' percent-encoded in keys/values. Discarding all entries.`); | ||
| discard = true; | ||
| break; | ||
| } | ||
| }; | ||
| for (const processor of data.tracer_provider?.processors ?? []) { | ||
| applyEncoding(processor.batch?.exporter?.otlp_http); | ||
| applyEncoding(processor.simple?.exporter?.otlp_http); | ||
| const rawName = parts[0].trim(); | ||
| const rawValue = parts[1].trim(); | ||
| if (rawName === '') { | ||
| api_1.diag.warn(`Empty attribute name in resource.attributes_list entry "${pair}". Discarding all entries.`); | ||
| discard = true; | ||
| break; | ||
| } | ||
| try { | ||
| listAttrs[decodeURIComponent(rawName)] = decodeURIComponent(rawValue); | ||
| } | ||
| catch (e) { | ||
| api_1.diag.warn(`Failed to percent-decode resource.attributes_list entry "${pair}", discarding all entries: ${e}`); | ||
| discard = true; | ||
| break; | ||
| } | ||
| } | ||
| for (const reader of data.meter_provider?.readers ?? []) { | ||
| applyEncoding(reader.periodic?.exporter?.otlp_http); | ||
| } | ||
| for (const processor of data.logger_provider?.processors ?? []) { | ||
| applyEncoding(processor.batch?.exporter?.otlp_http); | ||
| applyEncoding(processor.simple?.exporter?.otlp_http); | ||
| } | ||
| } | ||
| /** | ||
| * Merge resource.attributes_list (comma-separated key=value pairs) into | ||
| * resource.attributes, with entries already in attributes taking precedence. | ||
| */ | ||
| function mergeAttributesList(data) { | ||
| const resource = data.resource; | ||
| const list = resource?.attributes_list; | ||
| if (typeof list !== 'string' || !list.trim()) | ||
| return; | ||
| if (resource.attributes == null) { | ||
| resource.attributes = []; | ||
| } | ||
| const existingKeys = new Set(resource.attributes.map((a) => a.name)); | ||
| for (const pair of list.split(',')) { | ||
| const eqIdx = pair.indexOf('='); | ||
| if (eqIdx > 0) { | ||
| const key = pair.slice(0, eqIdx).trim(); | ||
| const value = pair.slice(eqIdx + 1).trim(); | ||
| if (key && !existingKeys.has(key)) { | ||
| resource.attributes.push({ name: key, value, type: 'string' }); | ||
| if (!discard) { | ||
| for (const [name, value] of Object.entries(listAttrs)) { | ||
| if (!existingNames.has(name)) { | ||
| mergedAttrs.push({ name, value, type: 'string' }); | ||
| } | ||
| } | ||
| } | ||
| return mergedAttrs; | ||
| } | ||
| exports.mergeResourceAttributesConfig = mergeResourceAttributesConfig; | ||
| /** | ||
| * Merge propagator.composite_list (comma-separated propagator names) into | ||
| * propagator.composite, with entries already in composite taking precedence. | ||
| * Merge TextMapPropagator configs from `propagator.composite` and `propagator.composite_list` | ||
| * (comma-separated names) into a `TextMapPropagator[]` array. | ||
| * Entries already in `propagator.composite` taking precedence. | ||
| * | ||
| * Note: The returned array might not be a copy, so it should not be mutated. | ||
| */ | ||
| function mergeCompositeList(data) { | ||
| const propagator = data.propagator; | ||
| const list = propagator?.composite_list; | ||
| if (typeof list !== 'string' || !list.trim()) | ||
| return; | ||
| if (propagator.composite == null) { | ||
| propagator.composite = []; | ||
| function mergePropagatorCompositeConfig(composite, composite_list) { | ||
| if (!composite_list) { | ||
| return composite; | ||
| } | ||
| const existingNames = new Set(propagator.composite.map(entry => Object.keys(entry)[0])); | ||
| for (const name of list.split(',')) { | ||
| const mergedComposite = composite ? composite.slice() : []; | ||
| const existingNames = new Set(mergedComposite.map(c => Object.keys(c)[0])); | ||
| for (const name of composite_list.split(',')) { | ||
| const trimmed = name.trim(); | ||
| if (trimmed && !existingNames.has(trimmed)) { | ||
| propagator.composite.push({ | ||
| [trimmed]: {}, | ||
| }); | ||
| mergedComposite.push({ [trimmed]: null }); | ||
| existingNames.add(trimmed); | ||
| } | ||
| } | ||
| return mergedComposite; | ||
| } | ||
| /** | ||
| * Apply spec-defined defaults for batch span/log-record processor fields that | ||
| * are not encoded in the JSON schema. | ||
| */ | ||
| function applyBatchProcessorDefaults(data) { | ||
| const applyDefaults = (batch) => { | ||
| if (batch.schedule_delay == null) | ||
| batch.schedule_delay = 5000; | ||
| if (batch.export_timeout == null) | ||
| batch.export_timeout = 30000; | ||
| if (batch.max_queue_size == null) | ||
| batch.max_queue_size = 2048; | ||
| if (batch.max_export_batch_size == null) | ||
| batch.max_export_batch_size = 512; | ||
| }; | ||
| for (const processor of data.tracer_provider?.processors ?? []) { | ||
| if (processor.batch) | ||
| applyDefaults(processor.batch); | ||
| } | ||
| for (const processor of data.logger_provider?.processors ?? []) { | ||
| if (processor.batch) | ||
| applyDefaults(processor.batch); | ||
| } | ||
| } | ||
| /** | ||
| * Apply spec-defined defaults for periodic metric reader fields. | ||
| */ | ||
| function applyPeriodicReaderDefaults(data) { | ||
| for (const reader of data.meter_provider?.readers ?? []) { | ||
| const periodic = reader.periodic; | ||
| if (!periodic) | ||
| continue; | ||
| if (periodic.interval == null) | ||
| periodic.interval = 60000; | ||
| if (periodic.timeout == null) | ||
| periodic.timeout = 30000; | ||
| if (periodic.cardinality_limits == null) { | ||
| periodic.cardinality_limits = { default: 2000 }; | ||
| } | ||
| } | ||
| } | ||
| /** | ||
| * Apply spec-defined defaults that are not encoded in the JSON schema. | ||
| * Both FileConfigFactory and EnvironmentConfigFactory apply the same defaults | ||
| * so consumers see consistent behaviour regardless of config source. | ||
| */ | ||
| function applyConfigDefaults(data) { | ||
| if (data.disabled == null) { | ||
| data.disabled = false; | ||
| } | ||
| if (data.log_level == null) { | ||
| data.log_level = 'info'; | ||
| } | ||
| if (data.attribute_limits == null) { | ||
| data.attribute_limits = { attribute_count_limit: 128 }; | ||
| } | ||
| else if (data.attribute_limits.attribute_count_limit == null) { | ||
| data.attribute_limits.attribute_count_limit = 128; | ||
| } | ||
| } | ||
| exports.mergePropagatorCompositeConfig = mergePropagatorCompositeConfig; | ||
| //# sourceMappingURL=FileConfigFactory.js.map |
@@ -1,1 +0,1 @@ | ||
| {"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,IA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,IAAI,EAAE,EAAE;QACvD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAA4C,CAAC;QACrE,IAAI,CAAC,QAAQ;YAAE,SAAS;QACxB,IAAI,QAAQ,CAAC,QAAQ,IAAI,IAAI;YAAE,QAAQ,CAAC,QAAQ,GAAG,KAAK,CAAC;QACzD,IAAI,QAAQ,CAAC,OAAO,IAAI,IAAI;YAAE,QAAQ,CAAC,OAAO,GAAG,KAAK,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"]} | ||
| {"version":3,"file":"FileConfigFactory.js","sourceRoot":"","sources":["../../src/FileConfigFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAA0C;AAC1C,8CAAuD;AACvD,yBAAyB;AACzB,6BAA6B;AAE7B,mCAA4C;AAM5C,oFAAoF;AACpF,2EAA2E;AAC3E,wD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E,CAAC;QAC5B,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YAC1C,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1C,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SAC5B;KACF;IAED,OAAO,eAAe,CAAC;AACzB,CAAC;AApBD,wEAoBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { diag } from '@opentelemetry/api';\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 AttributeNameValue,\n ConfigurationModel,\n TextMapPropagator,\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\n// The schema version this SDK targets. Per the configuration versioning spec,\n// an implementation MUST reject a config file whose MAJOR version differs (a\n// breaking-change boundary), accepts any MINOR version within that major, and\n// SHOULD warn when the MINOR version is newer than it targets since unknown\n// settings may be ignored. See\n// https://github.com/open-telemetry/opentelemetry-configuration/blob/main/VERSIONING.md\nconst SUPPORTED_FILE_FORMAT_MAJOR = 1;\nconst SUPPORTED_FILE_FORMAT_MINOR = 1;\n\nfunction validateFileFormat(configFile: string, fileFormat: unknown): void {\n if (typeof fileFormat !== 'string' || fileFormat.length === 0) {\n throw new Error(\n `${configFile}: Unsupported file_format: \"${fileFormat}\". Expected a \"MAJOR.MINOR\" version string.`\n );\n }\n\n // Drop any pre-release / meta tag, e.g. \"1.0-rc.2\" -> \"1.0\".\n const parts = fileFormat.split('-', 1)[0].split('.');\n const major = Number(parts[0]);\n const minor = parts.length > 1 ? Number(parts[1]) : 0;\n if (!Number.isInteger(major) || !Number.isInteger(minor)) {\n throw new Error(\n `${configFile}: Unsupported file_format: \"${fileFormat}\". Expected \"MAJOR.MINOR\" version numbers.`\n );\n }\n\n if (major !== SUPPORTED_FILE_FORMAT_MAJOR) {\n throw new Error(\n `${configFile}: Unsupported file_format: \"${fileFormat}\". This SDK supports schema version ${SUPPORTED_FILE_FORMAT_MAJOR}.x.`\n );\n }\n\n if (minor > SUPPORTED_FILE_FORMAT_MINOR) {\n diag.warn(\n `${configFile}: Configuration file_format \"${fileFormat}\" has a newer minor version than this SDK supports (${SUPPORTED_FILE_FORMAT_MAJOR}.${SUPPORTED_FILE_FORMAT_MINOR}); some settings may be ignored.`\n );\n }\n}\n\nexport function parseConfigFile(): ConfigurationModel {\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 validateFileFormat(configFile, processed?.file_format);\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 return data;\n}\n\n/**\n * Merge attributes from `resource.attributes` and `resource.attributes_list`\n * (comma-separated key=value pairs) into an `AttributeNameValue[]` array.\n * Entries already in `resource.attributes` taking precedence.\n *\n * Note: The returned array might not be a copy, so it should not be mutated.\n */\nexport function mergeResourceAttributesConfig(\n attributes?: AttributeNameValue[],\n attributes_list?: string | null\n): AttributeNameValue[] | undefined {\n if (!attributes_list) {\n return attributes;\n }\n\n const mergedAttrs = attributes ? attributes.slice() : [];\n const existingNames = new Set(mergedAttrs.map(a => a.name));\n\n // TODO(6842): handle attribute limits, if any\n let discard = false;\n const listAttrs: Record<string, string> = {};\n for (const pair of attributes_list.split(',')) {\n if (pair.trim() === '') continue;\n\n const parts = pair.split('=');\n if (parts.length !== 2) {\n diag.warn(\n `Invalid format for resource.attributes_list entry \"${pair}\": expected key=value with '=' percent-encoded in keys/values. Discarding all entries.`\n );\n discard = true;\n break;\n }\n\n const rawName = parts[0].trim();\n const rawValue = parts[1].trim();\n if (rawName === '') {\n diag.warn(\n `Empty attribute name in resource.attributes_list entry \"${pair}\". Discarding all entries.`\n );\n discard = true;\n break;\n }\n\n try {\n listAttrs[decodeURIComponent(rawName)] = decodeURIComponent(rawValue);\n } catch (e) {\n diag.warn(\n `Failed to percent-decode resource.attributes_list entry \"${pair}\", discarding all entries: ${e}`\n );\n discard = true;\n break;\n }\n }\n\n if (!discard) {\n for (const [name, value] of Object.entries(listAttrs)) {\n if (!existingNames.has(name)) {\n mergedAttrs.push({ name, value, type: 'string' });\n }\n }\n }\n\n return mergedAttrs;\n}\n\n/**\n * Merge propagator.composite_list (comma-separated propagator names) into\n * propagator.composite, with entries already in composite taking precedence.\n * Merge TextMapPropagator configs from `propagator.composite` and `propagator.composite_list`\n * (comma-separated names) into a `TextMapPropagator[]` array.\n * Entries already in `propagator.composite` taking precedence.\n *\n * Note: The returned array might not be a copy, so it should not be mutated.\n */\nexport function mergePropagatorCompositeConfig(\n composite?: TextMapPropagator[],\n composite_list?: string | null\n): TextMapPropagator[] | undefined {\n if (!composite_list) {\n return composite;\n }\n\n const mergedComposite = composite ? composite.slice() : [];\n const existingNames = new Set(mergedComposite.map(c => Object.keys(c)[0]));\n\n for (const name of composite_list.split(',')) {\n const trimmed = name.trim();\n if (trimmed && !existingNames.has(trimmed)) {\n mergedComposite.push({ [trimmed]: null });\n existingNames.add(trimmed);\n }\n }\n\n return mergedComposite;\n}\n"]} |
@@ -189,2 +189,7 @@ /** | ||
| /** | ||
| * Configure an event to span event bridge log record processor. | ||
| * If omitted, ignore. | ||
| */ | ||
| export type ExperimentalEventToSpanEventBridgeLogRecordProcessor = {} | null; | ||
| /** | ||
| * Configure exporter to be OTLP with HTTP transport. | ||
@@ -330,12 +335,12 @@ * If omitted, ignore. | ||
| /** | ||
| * Configure Prometheus Exporter to produce metrics without scope labels. | ||
| * If omitted or null, false is used. | ||
| * Configure Prometheus Exporter to produce metrics with scope labels. | ||
| * If omitted or null, true is used. | ||
| */ | ||
| without_scope_info?: boolean | null; | ||
| scope_info_enabled?: boolean | null; | ||
| /** | ||
| * Configure Prometheus Exporter to produce metrics without a target info metric for the resource. | ||
| * If omitted or null, false is used. | ||
| * Configure Prometheus Exporter to produce metrics with a target info metric for the resource. | ||
| * If omitted or null, true is used. | ||
| */ | ||
| 'without_target_info/development'?: boolean | null; | ||
| with_resource_constant_labels?: IncludeExclude; | ||
| 'target_info_enabled/development'?: boolean | null; | ||
| resource_constant_labels?: IncludeExclude; | ||
| translation_strategy?: ExperimentalPrometheusTranslationStrategy; | ||
@@ -554,2 +559,7 @@ } | null; | ||
| /** | ||
| * Configure the ID generator to randomly generate TraceIds and SpanIds (spec default). | ||
| * If omitted, ignore. | ||
| */ | ||
| export type RandomIdGenerator = {} | null; | ||
| /** | ||
| * The attribute type. | ||
@@ -649,2 +659,3 @@ * Values include: | ||
| simple?: SimpleLogRecordProcessor; | ||
| 'event_to_span_event_bridge/development'?: ExperimentalEventToSpanEventBridgeLogRecordProcessor; | ||
| [k: string]: object | null | undefined; | ||
@@ -763,3 +774,3 @@ } | ||
| /** | ||
| * Configure logger names to match, evaluated as follows: | ||
| * Configure logger names to match. Matching is case-sensitive, evaluated as follows: | ||
| * | ||
@@ -817,2 +828,7 @@ * * If the logger name exactly matches. | ||
| timeout?: number | null; | ||
| /** | ||
| * Configure maximum export batch size. | ||
| * If omitted or null, no limit is used. | ||
| */ | ||
| 'max_export_batch_size/development'?: number | null; | ||
| exporter: PushMetricExporter; | ||
@@ -920,3 +936,3 @@ /** | ||
| * Configure list of value patterns to include. | ||
| * Values are evaluated to match as follows: | ||
| * Matching is case-sensitive. Values are evaluated to match as follows: | ||
| * * If the value exactly matches. | ||
@@ -931,3 +947,3 @@ * * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none. | ||
| * Configure list of value patterns to exclude. Applies after .included (i.e. excluded has higher priority than included). | ||
| * Values are evaluated to match as follows: | ||
| * Matching is case-sensitive. Values are evaluated to match as follows: | ||
| * * If the value exactly matches. | ||
@@ -1040,3 +1056,3 @@ * * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none. | ||
| /** | ||
| * Configure meter names to match, evaluated as follows: | ||
| * Configure meter names to match. Matching is case-sensitive, evaluated as follows: | ||
| * | ||
@@ -1092,2 +1108,3 @@ * * If the meter name exactly matches. | ||
| sampler?: Sampler; | ||
| id_generator?: IdGenerator; | ||
| 'tracer_configurator/development'?: ExperimentalTracerConfigurator; | ||
@@ -1289,3 +1306,3 @@ } | ||
| * Configure list of value patterns to include. | ||
| * Values are evaluated to match as follows: | ||
| * Matching is case-sensitive. Values are evaluated to match as follows: | ||
| * * If the value exactly matches. | ||
@@ -1300,3 +1317,3 @@ * * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none. | ||
| * Configure list of value patterns to exclude. Applies after .included (i.e. excluded has higher priority than included). | ||
| * Values are evaluated to match as follows: | ||
| * Matching is case-sensitive. Values are evaluated to match as follows: | ||
| * * If the value exactly matches. | ||
@@ -1311,2 +1328,10 @@ * * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none. | ||
| /** | ||
| * Configure the trace and span ID generator. | ||
| * If omitted, RandomIdGenerator is used. | ||
| */ | ||
| export interface IdGenerator { | ||
| random?: RandomIdGenerator; | ||
| [k: string]: object | null | undefined; | ||
| } | ||
| /** | ||
| * Configure tracers. | ||
@@ -1338,3 +1363,3 @@ * If omitted, all tracers use default values as described in ExperimentalTracerConfig. | ||
| /** | ||
| * Configure tracer names to match, evaluated as follows: | ||
| * Configure tracer names to match. Matching is case-sensitive, evaluated as follows: | ||
| * | ||
@@ -1382,3 +1407,3 @@ * * If the tracer name exactly matches. | ||
| * The type of value must match .type. | ||
| * Property is required and must be non-null. | ||
| * Property must be present, but if null the entry is ignored. | ||
| */ | ||
@@ -1385,0 +1410,0 @@ value: string | number | boolean | null | string[] | boolean[] | number[]; |
@@ -8,3 +8,3 @@ "use strict"; | ||
| // AUTO-GENERATED — do not edit | ||
| // Generated from opentelemetry-configuration.git v1.0.0 | ||
| // Generated from opentelemetry-configuration.git v1.1.0 | ||
| // Run `npm run generate:config` to regenerate | ||
@@ -11,0 +11,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 | (\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"]} | ||
| {"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.1.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 an event to span event bridge log record processor.\n * If omitted, ignore.\n */\nexport type ExperimentalEventToSpanEventBridgeLogRecordProcessor = {} | 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 with scope labels.\n * If omitted or null, true is used.\n */\n scope_info_enabled?: boolean | null;\n /**\n * Configure Prometheus Exporter to produce metrics with a target info metric for the resource.\n * If omitted or null, true is used.\n */\n 'target_info_enabled/development'?: boolean | null;\n 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 * Configure the ID generator to randomly generate TraceIds and SpanIds (spec default).\n * If omitted, ignore.\n */\nexport type RandomIdGenerator = {} | 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 'event_to_span_event_bridge/development'?: ExperimentalEventToSpanEventBridgeLogRecordProcessor;\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. Matching is case-sensitive, 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 /**\n * Configure maximum export batch size.\n * If omitted or null, no limit is used.\n */\n 'max_export_batch_size/development'?: 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 * Matching is case-sensitive. 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 * Matching is case-sensitive. 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. Matching is case-sensitive, 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 id_generator?: IdGenerator;\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 * Matching is case-sensitive. 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 * Matching is case-sensitive. 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 the trace and span ID generator.\n * If omitted, RandomIdGenerator is used.\n */\nexport interface IdGenerator {\n random?: RandomIdGenerator;\n [k: string]: object | null | undefined;\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. Matching is case-sensitive, 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 must be present, but if null the entry is ignored.\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, MetricProducer as MetricProducerConfigModel, NameStringValuePair as NameStringValuePairConfigModel, HttpTls as HttpTlsConfigModel, GrpcTls as GrpcTlsConfigModel, SeverityNumber as SeverityNumberConfigModel, } from './generated/types'; | ||
| export type { ConfigurationModel, LogRecordExporter as LogRecordExporterConfigModel, PushMetricExporter as PushMetricExporterConfigModel, OtlpHttpMetricExporter as OtlpHttpMetricExporterConfigModel, OtlpGrpcMetricExporter as OtlpGrpcMetricExporterConfigModel, InstrumentType as InstrumentTypeConfigModel, Aggregation as AggregationConfigModel, PeriodicMetricReader as PeriodicMetricReaderConfigModel, Sampler as SamplerConfigModel, SpanExporter as SpanExporterConfigModel, SpanProcessor as SpanProcessorConfigModel, SpanLimits as SpanLimitsConfigModel, MetricProducer as MetricProducerConfigModel, NameStringValuePair as NameStringValuePairConfigModel, HttpTls as HttpTlsConfigModel, GrpcTls as GrpcTlsConfigModel, IdGenerator as IdGeneratorConfigModel, SeverityNumber as SeverityNumberConfigModel, TextMapPropagator as TextMapPropagatorConfigModel, LoggerProvider as LoggerProviderConfigModel, AttributeLimits as AttributeLimitsConfigModel, LogRecordProcessor as LogRecordProcessorConfigModel, BatchLogRecordProcessor as BatchLogRecordProcessorConfigModel, SimpleLogRecordProcessor as SimpleLogRecordProcessorConfigModel, OtlpHttpExporter as OtlpHttpExporterConfigModel, OtlpGrpcExporter as OtlpGrpcExporterConfigModel, LogRecordLimits as LogRecordLimitsConfigModel, } from './generated/types'; | ||
| export { createConfigFactory } from './ConfigFactory'; | ||
| export { mergeResourceAttributesConfig, mergePropagatorCompositeConfig, } from './FileConfigFactory'; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -7,5 +7,8 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.createConfigFactory = void 0; | ||
| exports.mergePropagatorCompositeConfig = exports.mergeResourceAttributesConfig = exports.createConfigFactory = void 0; | ||
| var ConfigFactory_1 = require("./ConfigFactory"); | ||
| Object.defineProperty(exports, "createConfigFactory", { enumerable: true, get: function () { return ConfigFactory_1.createConfigFactory; } }); | ||
| var FileConfigFactory_1 = require("./FileConfigFactory"); | ||
| Object.defineProperty(exports, "mergeResourceAttributesConfig", { enumerable: true, get: function () { return FileConfigFactory_1.mergeResourceAttributesConfig; } }); | ||
| Object.defineProperty(exports, "mergePropagatorCompositeConfig", { enumerable: true, get: function () { return FileConfigFactory_1.mergePropagatorCompositeConfig; } }); | ||
| //# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
| {"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"]} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAgCH,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA;AAC5B,yDAG6B;AAF3B,kIAAA,6BAA6B,OAAA;AAC7B,mIAAA,8BAA8B,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 OtlpHttpMetricExporter as OtlpHttpMetricExporterConfigModel,\n OtlpGrpcMetricExporter as OtlpGrpcMetricExporterConfigModel,\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 SpanLimits as SpanLimitsConfigModel,\n MetricProducer as MetricProducerConfigModel,\n NameStringValuePair as NameStringValuePairConfigModel,\n HttpTls as HttpTlsConfigModel,\n GrpcTls as GrpcTlsConfigModel,\n IdGenerator as IdGeneratorConfigModel,\n SeverityNumber as SeverityNumberConfigModel,\n TextMapPropagator as TextMapPropagatorConfigModel,\n LoggerProvider as LoggerProviderConfigModel,\n AttributeLimits as AttributeLimitsConfigModel,\n LogRecordProcessor as LogRecordProcessorConfigModel,\n BatchLogRecordProcessor as BatchLogRecordProcessorConfigModel,\n SimpleLogRecordProcessor as SimpleLogRecordProcessorConfigModel,\n OtlpHttpExporter as OtlpHttpExporterConfigModel,\n OtlpGrpcExporter as OtlpGrpcExporterConfigModel,\n LogRecordLimits as LogRecordLimitsConfigModel,\n} from './generated/types';\nexport { createConfigFactory } from './ConfigFactory';\nexport {\n mergeResourceAttributesConfig,\n mergePropagatorCompositeConfig,\n} from './FileConfigFactory';\n"]} |
@@ -129,2 +129,3 @@ "use strict"; | ||
| disabled: false, | ||
| log_level: 'info', | ||
| resource: {}, | ||
@@ -131,0 +132,0 @@ attribute_limits: { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAA6B;AAC7B,8CAAuD;AAGvD;;;;;;;;;GASG;AACH,SAAgB,iBAAiB,CAAC,GAAkB;IAClD,4DAA4D;IAC5D,2CAA2C;IAC3C,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;QACd,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,KAA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E,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"]} | ||
| {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAA6B;AAC7B,8CAAuD;AAGvD;;;;;;;;;GASG;AACH,SAAgB,iBAAiB,CAAC,GAAkB;IAClD,4DAA4D;IAC5D,2CAA2C;IAC3C,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;QACd,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;YAC3B,IAAI,GAAG,KAAK,KAAK;gBAAE,OAAO,CAAC,oBAAoB;YAC/C,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;gBAAE,OAAO;YAC3C,IAAI,MAAM,GAAqC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACvE,IAAI,MAAM,KAAK,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;gBAC5D,8DAA8D;gBAC9D,gDAAgD;gBAChD,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;aACnC;YACD,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;QACtB,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAhBD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I,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 log_level: 'info',\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.219.0"; | ||
| export declare const VERSION = "0.220.0"; | ||
| //# sourceMappingURL=version.d.ts.map |
@@ -9,3 +9,3 @@ "use strict"; | ||
| // this is autogenerated file, see scripts/version-update.js | ||
| exports.VERSION = '0.219.0'; | ||
| exports.VERSION = '0.220.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.219.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.220.0';\n"]} |
+5
-5
| { | ||
| "name": "@opentelemetry/configuration", | ||
| "version": "0.219.0", | ||
| "version": "0.220.0", | ||
| "description": "OpenTelemetry Configuration", | ||
@@ -42,4 +42,4 @@ "main": "build/src/index.js", | ||
| "dependencies": { | ||
| "@opentelemetry/core": "2.8.0", | ||
| "yaml": "^2.0.0" | ||
| "@opentelemetry/core": "2.9.0", | ||
| "yaml": "^2.8.3" | ||
| }, | ||
@@ -56,3 +56,3 @@ "peerDependencies": { | ||
| "json-schema-to-typescript": "^15.0.0", | ||
| "mocha": "11.7.5", | ||
| "mocha": "11.7.6", | ||
| "nyc": "17.1.0", | ||
@@ -65,3 +65,3 @@ "sinon": "18.0.1", | ||
| "sideEffects": false, | ||
| "gitHead": "13a035bc695996cf4aec885fef7b9866f48bc555" | ||
| "gitHead": "40d67b7690a61bd9af0a4e5b5b9f4a14b11fc50e" | ||
| } |
+76
-9
@@ -67,3 +67,3 @@ # OpenTelemetry Declarative Configuration | ||
| When no config file is set, the factory reads from the standard OpenTelemetry SDK environment variables: | ||
| When no config file is set, the factory reads from the standard OpenTelemetry SDK environment variables. The full set of variables this package consumes: | ||
@@ -76,8 +76,69 @@ | Variable | Description | | ||
| | `OTEL_RESOURCE_ATTRIBUTES` | Comma-separated resource attributes | | ||
| | `OTEL_NODE_RESOURCE_DETECTORS` | Resource detectors to enable (`env`, `host`, `os`, `process`, `serviceinstance`, `all`, `none`) | | ||
| | `OTEL_PROPAGATORS` | Propagators: `tracecontext`, `baggage`, `b3`, `b3multi` | | ||
| | `OTEL_TRACES_EXPORTER` | Traces exporter(s): `otlp`, `console`, `none` | | ||
| | `OTEL_METRICS_EXPORTER` | Metrics exporter(s): `otlp`, `prometheus`, `console`, `none` | | ||
| | `OTEL_LOGS_EXPORTER` | Logs exporter(s): `otlp`, `console`, `none` | | ||
| | `OTEL_TRACES_SAMPLER` | Sampler name (e.g. `parentbased_always_on`, `traceidratio`) | | ||
| | `OTEL_TRACES_SAMPLER_ARG` | Sampler argument (e.g. ratio value) | | ||
| | `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP endpoint (all signals) | | ||
| | `OTEL_EXPORTER_OTLP_HEADERS` | OTLP headers (all signals) | | ||
| | `OTEL_EXPORTER_OTLP_PROTOCOL` | OTLP protocol: `grpc`, `http/protobuf`, `http/json` | | ||
| | `OTEL_PROPAGATORS` | Propagators: `tracecontext`, `baggage`, `b3`, `b3multi` | | ||
| | `OTEL_EXPORTER_OTLP_TIMEOUT` | OTLP request timeout (all signals) | | ||
| | `OTEL_EXPORTER_OTLP_COMPRESSION` | OTLP compression (all signals): `gzip`, `none` | | ||
| | `OTEL_EXPORTER_OTLP_CERTIFICATE` | OTLP server CA certificate file (all signals) | | ||
| | `OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE` | OTLP client certificate file for mTLS (all signals) | | ||
| | `OTEL_EXPORTER_OTLP_CLIENT_KEY` | OTLP client private key file for mTLS (all signals) | | ||
| | `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | Per-signal override (traces) | | ||
| | `OTEL_EXPORTER_OTLP_TRACES_HEADERS` | Per-signal override (traces) | | ||
| | `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` | Per-signal override (traces) | | ||
| | `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT` | Per-signal override (traces) | | ||
| | `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION` | Per-signal override (traces) | | ||
| | `OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE` | Per-signal override (traces) | | ||
| | `OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE` | Per-signal override (traces) | | ||
| | `OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY` | Per-signal override (traces) | | ||
| | `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Per-signal override (metrics) | | ||
| | `OTEL_EXPORTER_OTLP_METRICS_HEADERS` | Per-signal override (metrics) | | ||
| | `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL` | Per-signal override (metrics) | | ||
| | `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` | Per-signal override (metrics) | | ||
| | `OTEL_EXPORTER_OTLP_METRICS_COMPRESSION` | Per-signal override (metrics) | | ||
| | `OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE` | Per-signal override (metrics) | | ||
| | `OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE` | Per-signal override (metrics) | | ||
| | `OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY` | Per-signal override (metrics) | | ||
| | `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | Metric temporality preference: `cumulative`, `delta`, `lowmemory` | | ||
| | `OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION` | Default histogram aggregation: `explicit_bucket_histogram`, `base2_exponential_bucket_histogram` | | ||
| | `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` | Per-signal override (logs) | | ||
| | `OTEL_EXPORTER_OTLP_LOGS_HEADERS` | Per-signal override (logs) | | ||
| | `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL` | Per-signal override (logs) | | ||
| | `OTEL_EXPORTER_OTLP_LOGS_TIMEOUT` | Per-signal override (logs) | | ||
| | `OTEL_EXPORTER_OTLP_LOGS_COMPRESSION` | Per-signal override (logs) | | ||
| | `OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE` | Per-signal override (logs) | | ||
| | `OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE` | Per-signal override (logs) | | ||
| | `OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY` | Per-signal override (logs) | | ||
| | `OTEL_EXPORTER_PROMETHEUS_HOST` | Prometheus exporter bind host | | ||
| | `OTEL_EXPORTER_PROMETHEUS_PORT` | Prometheus exporter bind port | | ||
| | `OTEL_METRIC_EXPORT_INTERVAL` | Periodic metric reader export interval (ms) | | ||
| | `OTEL_METRIC_EXPORT_TIMEOUT` | Periodic metric reader export timeout (ms) | | ||
| | `OTEL_METRICS_EXEMPLAR_FILTER` | Exemplar filter: `always_on`, `always_off`, `trace_based` | | ||
| | `OTEL_BSP_SCHEDULE_DELAY` | Batch span processor: schedule delay (ms) | | ||
| | `OTEL_BSP_EXPORT_TIMEOUT` | Batch span processor: export timeout (ms) | | ||
| | `OTEL_BSP_MAX_QUEUE_SIZE` | Batch span processor: max queue size | | ||
| | `OTEL_BSP_MAX_EXPORT_BATCH_SIZE` | Batch span processor: max export batch size | | ||
| | `OTEL_BLRP_SCHEDULE_DELAY` | Batch log record processor: schedule delay (ms) | | ||
| | `OTEL_BLRP_EXPORT_TIMEOUT` | Batch log record processor: export timeout (ms) | | ||
| | `OTEL_BLRP_MAX_QUEUE_SIZE` | Batch log record processor: max queue size | | ||
| | `OTEL_BLRP_MAX_EXPORT_BATCH_SIZE` | Batch log record processor: max export batch size | | ||
| | `OTEL_ATTRIBUTE_COUNT_LIMIT` | Default max attributes per span/log/event/link | | ||
| | `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT` | Default max attribute value length | | ||
| | `OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT` | Max attributes per span | | ||
| | `OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT` | Max span attribute value length | | ||
| | `OTEL_SPAN_EVENT_COUNT_LIMIT` | Max events per span | | ||
| | `OTEL_SPAN_LINK_COUNT_LIMIT` | Max links per span | | ||
| | `OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT` | Max attributes per span event | | ||
| | `OTEL_LINK_ATTRIBUTE_COUNT_LIMIT` | Max attributes per span link | | ||
| | `OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT` | Max attributes per log record | | ||
| | `OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT` | Max log record attribute value length | | ||
| See [`src/EnvironmentConfigFactory.ts`](src/EnvironmentConfigFactory.ts) for the exact parsing logic. | ||
| ## Development | ||
@@ -90,3 +151,2 @@ | ||
| - `types.ts` — TypeScript interfaces derived from the JSON schema (via `json-schema-to-typescript`) | ||
| - `schema.ts` — The raw JSON schema exported as a constant (retained for reference; not used at runtime) | ||
| - `validator.js` — Pre-compiled ajv validator (ahead-of-time compiled from the schema at build time; eliminates runtime `ajv.compile()`) | ||
@@ -97,3 +157,3 @@ - `validator.d.ts` — TypeScript declarations for `validator.js` | ||
| 1. Update the `CONFIG_VERSION` variable in `scripts/config/generate-config.sh` | ||
| 1. Update the `CONFIG_VERSION` constant in `scripts/generate-config.js` | ||
| 2. Run from this package directory: | ||
@@ -105,12 +165,11 @@ | ||
| 3. Review the diff in `src/generated/types.ts`, `src/generated/schema.ts`, and `src/generated/validator.js` | ||
| 4. Update `supportedFileVersionPattern` in `src/FileConfigFactory.ts` if the new version falls outside the current regex | ||
| 3. Review the diff in `src/generated/types.ts` and `src/generated/validator.js` | ||
| 4. Update `SUPPORTED_FILE_FORMAT_MAJOR` / `SUPPORTED_FILE_FORMAT_MINOR` in `src/FileConfigFactory.ts` if the new schema version is outside the currently-supported range | ||
| 5. Update `EnvironmentConfigFactory.ts` and `utils.ts` if new fields need env var mapping | ||
| The generation script (`scripts/config/generate-config.js`) handles several post-processing steps: | ||
| The generation script (`scripts/generate-config.js`) handles several post-processing steps: | ||
| - Renames the root type from `OpenTelemetryConfiguration` to `ConfigurationModel` | ||
| - Makes `file_format` optional (required at parse time but not needed when constructing the model in code) | ||
| - Replaces narrow index signatures (`[k: string]: {} | null`) with `[k: string]: unknown` | ||
| - Deduplicates structurally-identical TLS types (`GrpcTls1`/`HttpTls1` → `GrpcTls`/`HttpTls`) | ||
| - Removes the duplicate type declarations that `json-schema-to-typescript` emits for structurally-identical sub-schemas (e.g. the second `GrpcTls`/`HttpTls`) | ||
| - Produces a pre-compiled ajv validator (`validator.js` + `validator.d.ts`) for use at runtime | ||
@@ -135,3 +194,11 @@ | ||
| - `1.0` | ||
| - `1.1` | ||
| For a per-field view of which schema fields the SDK currently applies, see | ||
| the JS row in the cross-SDK [language support status][lss] doc maintained in | ||
| the `opentelemetry-configuration` repo. That doc is the source of truth for | ||
| declarative-config conformance across all SDKs. | ||
| [lss]: https://github.com/open-telemetry/opentelemetry-configuration/blob/main/language-support-status.md#js- | ||
| ## Useful links | ||
@@ -138,0 +205,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1952576
1.8%11942
1.22%212
46.21%+ Added
- Removed
Updated
Updated