diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 10ed3f40824..936fc7d56a7 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -10,6 +10,8 @@ For notes on migrating to 2.x / 0.200.x see [the upgrade guide](doc/upgrade-to-2 ### :rocket: Features +feat(configuration): parse config for rc 3 [#6304](https://github.com/open-telemetry/opentelemetry-js/pull/6304) @maryliag + ### :bug: Bug Fixes ### :books: Documentation diff --git a/experimental/packages/configuration/src/EnvironmentConfigFactory.ts b/experimental/packages/configuration/src/EnvironmentConfigFactory.ts index 7583d18c7e2..4dfc3d29f4a 100644 --- a/experimental/packages/configuration/src/EnvironmentConfigFactory.ts +++ b/experimental/packages/configuration/src/EnvironmentConfigFactory.ts @@ -43,6 +43,7 @@ import { BatchLogRecordProcessor, initializeDefaultLoggerProviderConfiguration, } from './models/loggerProviderModel'; +import { getGrpcTlsConfig, getHttpTlsConfig } from './utils'; /** * EnvironmentConfigProvider provides a configuration based on environment variables. @@ -173,14 +174,11 @@ export function setTracerProvider(config: ConfigurationModel): void { } config.tracer_provider = initializeDefaultTracerProviderConfiguration(); - if (config.tracer_provider.limits == null) { - config.tracer_provider.limits = {}; - } const attributeValueLengthLimit = getNumberFromEnv( 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT' ); if (attributeValueLengthLimit) { - config.tracer_provider.limits.attribute_value_length_limit = + config.tracer_provider.limits!.attribute_value_length_limit = attributeValueLengthLimit; } @@ -188,24 +186,24 @@ export function setTracerProvider(config: ConfigurationModel): void { 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT' ); if (attributeCountLimit) { - config.tracer_provider.limits.attribute_count_limit = attributeCountLimit; + config.tracer_provider.limits!.attribute_count_limit = attributeCountLimit; } const eventCountLimit = getNumberFromEnv('OTEL_SPAN_EVENT_COUNT_LIMIT'); if (eventCountLimit) { - config.tracer_provider.limits.event_count_limit = eventCountLimit; + config.tracer_provider.limits!.event_count_limit = eventCountLimit; } const linkCountLimit = getNumberFromEnv('OTEL_SPAN_LINK_COUNT_LIMIT'); if (linkCountLimit) { - config.tracer_provider.limits.link_count_limit = linkCountLimit; + config.tracer_provider.limits!.link_count_limit = linkCountLimit; } const eventAttributeCountLimit = getNumberFromEnv( 'OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT' ); if (eventAttributeCountLimit) { - config.tracer_provider.limits.event_attribute_count_limit = + config.tracer_provider.limits!.event_attribute_count_limit = eventAttributeCountLimit; } @@ -213,7 +211,7 @@ export function setTracerProvider(config: ConfigurationModel): void { 'OTEL_LINK_ATTRIBUTE_COUNT_LIMIT' ); if (linkAttributeCountLimit) { - config.tracer_provider.limits.link_attribute_count_limit = + config.tracer_provider.limits!.link_attribute_count_limit = linkAttributeCountLimit; } @@ -246,16 +244,6 @@ export function setTracerProvider(config: ConfigurationModel): void { config.tracer_provider.processors.push({ simple: { exporter: { console: {} } }, }); - } else if (exporterType === 'zipkin') { - batchInfo.exporter = { - zipkin: { - endpoint: - getStringFromEnv('OTEL_EXPORTER_ZIPKIN_ENDPOINT') ?? - 'http://localhost:9411/api/v2/spans', - timeout: getNumberFromEnv('OTEL_EXPORTER_ZIPKIN_TIMEOUT') ?? 10000, - }, - }; - config.tracer_provider.processors.push({ batch: batchInfo }); } else { // 'otlp' and default const protocol = @@ -292,15 +280,13 @@ export function setTracerProvider(config: ConfigurationModel): void { if (endpoint) { batchInfo.exporter.otlp_grpc.endpoint = endpoint; } - if (certificateFile) { - batchInfo.exporter.otlp_grpc.certificate_file = certificateFile; - } - if (clientKeyFile) { - batchInfo.exporter.otlp_grpc.client_key_file = clientKeyFile; - } - if (clientCertificateFile) { - batchInfo.exporter.otlp_grpc.client_certificate_file = - clientCertificateFile; + const tls = getGrpcTlsConfig( + certificateFile, + clientKeyFile, + clientCertificateFile + ); + if (tls) { + batchInfo.exporter.otlp_grpc.tls = tls; } if (compression) { batchInfo.exporter.otlp_grpc.compression = compression; @@ -323,15 +309,13 @@ export function setTracerProvider(config: ConfigurationModel): void { if (endpoint) { batchInfo.exporter.otlp_http.endpoint = endpoint; } - if (certificateFile) { - batchInfo.exporter.otlp_http.certificate_file = certificateFile; - } - if (clientKeyFile) { - batchInfo.exporter.otlp_http.client_key_file = clientKeyFile; - } - if (clientCertificateFile) { - batchInfo.exporter.otlp_http.client_certificate_file = - clientCertificateFile; + const tls = getHttpTlsConfig( + certificateFile, + clientKeyFile, + clientCertificateFile + ); + if (tls) { + batchInfo.exporter.otlp_http.tls = tls; } if (compression) { batchInfo.exporter.otlp_http.compression = compression; @@ -428,16 +412,13 @@ export function setMeterProvider(config: ConfigurationModel): void { if (endpoint) { readerPeriodicInfo.exporter.otlp_grpc.endpoint = endpoint; } - if (certificateFile) { - readerPeriodicInfo.exporter.otlp_grpc.certificate_file = - certificateFile; - } - if (clientKeyFile) { - readerPeriodicInfo.exporter.otlp_grpc.client_key_file = clientKeyFile; - } - if (clientCertificateFile) { - readerPeriodicInfo.exporter.otlp_grpc.client_certificate_file = - clientCertificateFile; + const tls = getGrpcTlsConfig( + certificateFile, + clientKeyFile, + clientCertificateFile + ); + if (tls) { + readerPeriodicInfo.exporter.otlp_grpc.tls = tls; } if (compression) { readerPeriodicInfo.exporter.otlp_grpc.compression = compression; @@ -496,16 +477,13 @@ export function setMeterProvider(config: ConfigurationModel): void { if (endpoint) { readerPeriodicInfo.exporter.otlp_http.endpoint = endpoint; } - if (certificateFile) { - readerPeriodicInfo.exporter.otlp_http.certificate_file = - certificateFile; - } - if (clientKeyFile) { - readerPeriodicInfo.exporter.otlp_http.client_key_file = clientKeyFile; - } - if (clientCertificateFile) { - readerPeriodicInfo.exporter.otlp_http.client_certificate_file = - clientCertificateFile; + const tls = getHttpTlsConfig( + certificateFile, + clientKeyFile, + clientCertificateFile + ); + if (tls) { + readerPeriodicInfo.exporter.otlp_http.tls = tls; } if (compression) { readerPeriodicInfo.exporter.otlp_http.compression = compression; @@ -606,16 +584,14 @@ export function setLoggerProvider(config: ConfigurationModel): void { 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT' ); if (attributeValueLengthLimit || attributeCountLimit) { - if (config.logger_provider.limits == null) { - config.logger_provider.limits = { attribute_count_limit: 128 }; - } if (attributeValueLengthLimit) { - config.logger_provider.limits.attribute_value_length_limit = + config.logger_provider.limits!.attribute_value_length_limit = attributeValueLengthLimit; } if (attributeCountLimit) { - config.logger_provider.limits.attribute_count_limit = attributeCountLimit; + config.logger_provider.limits!.attribute_count_limit = + attributeCountLimit; } } @@ -684,15 +660,13 @@ export function setLoggerProvider(config: ConfigurationModel): void { if (endpoint) { batchInfo.exporter.otlp_grpc.endpoint = endpoint; } - if (certificateFile) { - batchInfo.exporter.otlp_grpc.certificate_file = certificateFile; - } - if (clientKeyFile) { - batchInfo.exporter.otlp_grpc.client_key_file = clientKeyFile; - } - if (clientCertificateFile) { - batchInfo.exporter.otlp_grpc.client_certificate_file = - clientCertificateFile; + const tls = getGrpcTlsConfig( + certificateFile, + clientKeyFile, + clientCertificateFile + ); + if (tls) { + batchInfo.exporter.otlp_grpc.tls = tls; } if (compression) { batchInfo.exporter.otlp_grpc.compression = compression; @@ -715,15 +689,13 @@ export function setLoggerProvider(config: ConfigurationModel): void { if (endpoint) { batchInfo.exporter.otlp_http.endpoint = endpoint; } - if (certificateFile) { - batchInfo.exporter.otlp_http.certificate_file = certificateFile; - } - if (clientKeyFile) { - batchInfo.exporter.otlp_http.client_key_file = clientKeyFile; - } - if (clientCertificateFile) { - batchInfo.exporter.otlp_http.client_certificate_file = - clientCertificateFile; + const tls = getHttpTlsConfig( + certificateFile, + clientKeyFile, + clientCertificateFile + ); + if (tls) { + batchInfo.exporter.otlp_http.tls = tls; } if (compression) { batchInfo.exporter.otlp_http.compression = compression; diff --git a/experimental/packages/configuration/src/FileConfigFactory.ts b/experimental/packages/configuration/src/FileConfigFactory.ts index 5b6bbdca1eb..172d9b3ce9b 100644 --- a/experimental/packages/configuration/src/FileConfigFactory.ts +++ b/experimental/packages/configuration/src/FileConfigFactory.ts @@ -27,12 +27,18 @@ import * as yaml from 'yaml'; import { getBooleanFromConfigFile, getBooleanListFromConfigFile, + getGrpcTlsConfig, + getHttpTlsConfig, getNumberFromConfigFile, getNumberListFromConfigFile, getStringFromConfigFile, getStringListFromConfigFile, } from './utils'; -import { NameStringValuePair, OtlpHttpEncoding } from './models/commonModel'; +import { + NameStringValuePair, + OtlpHttpEncoding, + SeverityNumber, +} from './models/commonModel'; import { initializeDefaultTracerProviderConfiguration, SpanExporter, @@ -40,6 +46,7 @@ import { TracerProvider, } from './models/tracerProviderModel'; import { + ExperimentalLoggerMatcherAndConfig, initializeDefaultLoggerProviderConfiguration, LoggerProvider, LogRecordExporter, @@ -50,6 +57,7 @@ import { Aggregation, CardinalityLimits, ExemplarFilter, + ExperimentalPrometheusTranslationStrategy, ExporterDefaultHistogramAggregation, ExporterTemporalityPreference, initializeDefaultMeterProviderConfiguration, @@ -96,7 +104,7 @@ export function hasValidConfigFile(): boolean { } export function parseConfigFile(config: ConfigurationModel) { - const supportedFileVersions = ['1.0-rc.1', '1.0-rc.2']; + const supportedFileVersions = ['1.0-rc.3']; const configFile = getStringFromEnv('OTEL_EXPERIMENTAL_CONFIG_FILE') || ''; const file = fs.readFileSync(configFile, 'utf8'); const parsedContent = yaml.parse(file); @@ -246,14 +254,17 @@ export function setPropagator( config: ConfigurationModel, propagator: Propagator ): void { - if (propagator && propagator.composite) { + if (propagator && (propagator.composite || propagator.composite_list)) { const auxList = []; const composite = []; - for (let i = 0; i < propagator.composite.length; i++) { - const key = Object.keys(propagator.composite[i])[0]; - auxList.push(key); - composite.push({ [key]: null }); + if (propagator.composite) { + for (let i = 0; i < propagator.composite.length; i++) { + const key = Object.keys(propagator.composite[i])[0]; + auxList.push(key); + composite.push({ [key]: null }); + } } + const compositeList = getStringListFromConfigFile( propagator['composite_list'] ); @@ -275,10 +286,7 @@ export function setPropagator( propagator['composite_list'] ); if (compositeListString) { - if (config.propagator == null) { - config.propagator = {}; - } - config.propagator.composite_list = compositeListString; + config.propagator!.composite_list = compositeListString; } } } @@ -349,19 +357,6 @@ function parseConfigSpanOrLogRecordExporter( : OtlpHttpEncoding.Protobuf, }, }; - - certFile = getStringFromConfigFile(e['certificate_file']); - if (certFile && parsedExporter.otlp_http) { - parsedExporter.otlp_http.certificate_file = certFile; - } - clientCertFile = getStringFromConfigFile(e['client_certificate_file']); - if (clientCertFile && parsedExporter.otlp_http) { - parsedExporter.otlp_http.client_certificate_file = clientCertFile; - } - clientKeyFile = getStringFromConfigFile(e['client_key_file']); - if (clientKeyFile && parsedExporter.otlp_http) { - parsedExporter.otlp_http.client_key_file = clientKeyFile; - } compression = getStringFromConfigFile(e['compression']); if (compression && parsedExporter.otlp_http) { parsedExporter.otlp_http.compression = compression; @@ -374,6 +369,17 @@ function parseConfigSpanOrLogRecordExporter( if (headers && parsedExporter.otlp_http) { parsedExporter.otlp_http.headers = headers; } + + if (e['tls']) { + certFile = getStringFromConfigFile(e['tls']['ca_file']); + clientCertFile = getStringFromConfigFile(e['tls']['cert_file']); + clientKeyFile = getStringFromConfigFile(e['tls']['key_file']); + + const tls = getHttpTlsConfig(certFile, clientKeyFile, clientCertFile); + if (tls) { + parsedExporter.otlp_http!.tls = tls; + } + } } break; @@ -388,18 +394,6 @@ function parseConfigSpanOrLogRecordExporter( }, }; - certFile = getStringFromConfigFile(e['certificate_file']); - if (certFile && parsedExporter.otlp_grpc) { - parsedExporter.otlp_grpc.certificate_file = certFile; - } - clientCertFile = getStringFromConfigFile(e['client_certificate_file']); - if (clientCertFile && parsedExporter.otlp_grpc) { - parsedExporter.otlp_grpc.client_certificate_file = clientCertFile; - } - clientKeyFile = getStringFromConfigFile(e['client_key_file']); - if (clientKeyFile && parsedExporter.otlp_grpc) { - parsedExporter.otlp_grpc.client_key_file = clientKeyFile; - } compression = getStringFromConfigFile(e['compression']); if (compression && parsedExporter.otlp_grpc) { parsedExporter.otlp_grpc.compression = compression; @@ -412,9 +406,22 @@ function parseConfigSpanOrLogRecordExporter( if (headers && parsedExporter.otlp_grpc) { parsedExporter.otlp_grpc.headers = headers; } - insecure = getBooleanFromConfigFile(e['insecure']); - if ((insecure || insecure === false) && parsedExporter.otlp_grpc) { - parsedExporter.otlp_grpc.insecure = insecure; + + if (e['tls']) { + certFile = getStringFromConfigFile(e['tls']['ca_file']); + clientCertFile = getStringFromConfigFile(e['tls']['cert_file']); + clientKeyFile = getStringFromConfigFile(e['tls']['key_file']); + insecure = getBooleanFromConfigFile(e['tls']['insecure']); + + const tls = getGrpcTlsConfig( + certFile, + clientKeyFile, + clientCertFile, + insecure + ); + if (tls) { + parsedExporter.otlp_grpc!.tls = tls; + } } } break; @@ -436,20 +443,6 @@ function parseConfigSpanOrLogRecordExporter( console: {}, }; break; - - case 'zipkin': - e = (exporter as SpanExporter)['zipkin']; - if (e) { - parsedExporter = { - zipkin: { - endpoint: - getStringFromConfigFile(e['endpoint']) ?? - 'http://localhost:9411/api/v2/spans', - timeout: getNumberFromConfigFile(e['timeout']) ?? 10000, - }, - }; - } - break; } return parsedExporter; @@ -463,15 +456,12 @@ export function setTracerProvider( config.tracer_provider = initializeDefaultTracerProviderConfiguration(); // Limits if (tracerProvider['limits']) { - if (config.tracer_provider.limits == null) { - config.tracer_provider.limits = {}; - } const attributeValueLengthLimit = getNumberFromConfigFile( tracerProvider['limits']['attribute_value_length_limit'] ); if (attributeValueLengthLimit) { - config.tracer_provider.limits.attribute_value_length_limit = + config.tracer_provider.limits!.attribute_value_length_limit = attributeValueLengthLimit; } @@ -479,7 +469,7 @@ export function setTracerProvider( tracerProvider['limits']['attribute_count_limit'] ); if (attributeCountLimit) { - config.tracer_provider.limits.attribute_count_limit = + config.tracer_provider.limits!.attribute_count_limit = attributeCountLimit; } @@ -487,21 +477,21 @@ export function setTracerProvider( tracerProvider['limits']['event_count_limit'] ); if (eventCountLimit) { - config.tracer_provider.limits.event_count_limit = eventCountLimit; + config.tracer_provider.limits!.event_count_limit = eventCountLimit; } const linkCountLimit = getNumberFromConfigFile( tracerProvider['limits']['link_count_limit'] ); if (linkCountLimit) { - config.tracer_provider.limits.link_count_limit = linkCountLimit; + config.tracer_provider.limits!.link_count_limit = linkCountLimit; } const eventAttributeCountLimit = getNumberFromConfigFile( tracerProvider['limits']['event_attribute_count_limit'] ); if (eventAttributeCountLimit) { - config.tracer_provider.limits.event_attribute_count_limit = + config.tracer_provider.limits!.event_attribute_count_limit = eventAttributeCountLimit; } @@ -509,7 +499,7 @@ export function setTracerProvider( tracerProvider['limits']['link_attribute_count_limit'] ); if (linkAttributeCountLimit) { - config.tracer_provider.limits.link_attribute_count_limit = + config.tracer_provider.limits!.link_attribute_count_limit = linkAttributeCountLimit; } } @@ -596,10 +586,7 @@ function getProducers(producers?: MetricProducer[]): MetricProducer[] { for (let j = 0; j < producers.length; j++) { const producer = producers[j]; if (Object.keys(producer)[0] === 'opencensus') { - parsedProducers.push({ opencensus: undefined }); - } - if (Object.keys(producer)[0] === 'prometheus') { - parsedProducers.push({ prometheus: undefined }); + parsedProducers.push({ opencensus: {} }); } } } @@ -676,18 +663,6 @@ function parseMetricExporter(exporter: PushMetricExporter): PushMetricExporter { }, }; - certFile = getStringFromConfigFile(e['certificate_file']); - if (certFile && parsedExporter.otlp_http) { - parsedExporter.otlp_http.certificate_file = certFile; - } - clientCertFile = getStringFromConfigFile(e['client_certificate_file']); - if (clientCertFile && parsedExporter.otlp_http) { - parsedExporter.otlp_http.client_certificate_file = clientCertFile; - } - clientKeyFile = getStringFromConfigFile(e['client_key_file']); - if (clientKeyFile && parsedExporter.otlp_http) { - parsedExporter.otlp_http.client_key_file = clientKeyFile; - } compression = getStringFromConfigFile(e['compression']); if (compression && parsedExporter.otlp_http) { parsedExporter.otlp_http.compression = compression; @@ -700,6 +675,17 @@ function parseMetricExporter(exporter: PushMetricExporter): PushMetricExporter { if (headers && parsedExporter.otlp_http) { parsedExporter.otlp_http.headers = headers; } + + if (e['tls']) { + certFile = getStringFromConfigFile(e['tls']['ca_file']); + clientCertFile = getStringFromConfigFile(e['tls']['cert_file']); + clientKeyFile = getStringFromConfigFile(e['tls']['key_file']); + + const tls = getHttpTlsConfig(certFile, clientKeyFile, clientCertFile); + if (tls) { + parsedExporter.otlp_http!.tls = tls; + } + } } break; @@ -720,18 +706,6 @@ function parseMetricExporter(exporter: PushMetricExporter): PushMetricExporter { }, }; - certFile = getStringFromConfigFile(e['certificate_file']); - if (certFile && parsedExporter.otlp_grpc) { - parsedExporter.otlp_grpc.certificate_file = certFile; - } - clientCertFile = getStringFromConfigFile(e['client_certificate_file']); - if (clientCertFile && parsedExporter.otlp_grpc) { - parsedExporter.otlp_grpc.client_certificate_file = clientCertFile; - } - clientKeyFile = getStringFromConfigFile(e['client_key_file']); - if (clientKeyFile && parsedExporter.otlp_grpc) { - parsedExporter.otlp_grpc.client_key_file = clientKeyFile; - } compression = getStringFromConfigFile(e['compression']); if (compression && parsedExporter.otlp_grpc) { parsedExporter.otlp_grpc.compression = compression; @@ -744,9 +718,22 @@ function parseMetricExporter(exporter: PushMetricExporter): PushMetricExporter { if (headers && parsedExporter.otlp_grpc) { parsedExporter.otlp_grpc.headers = headers; } - insecure = getBooleanFromConfigFile(e['insecure']); - if ((insecure || insecure === false) && parsedExporter.otlp_grpc) { - parsedExporter.otlp_grpc.insecure = insecure; + + if (e['tls']) { + certFile = getStringFromConfigFile(e['tls']['ca_file']); + clientCertFile = getStringFromConfigFile(e['tls']['cert_file']); + clientKeyFile = getStringFromConfigFile(e['tls']['key_file']); + insecure = getBooleanFromConfigFile(e['tls']['insecure']); + + const tls = getGrpcTlsConfig( + certFile, + clientKeyFile, + clientCertFile, + insecure + ); + if (tls) { + parsedExporter.otlp_grpc!.tls = tls; + } } } break; @@ -770,9 +757,19 @@ function parseMetricExporter(exporter: PushMetricExporter): PushMetricExporter { break; case 'console': - parsedExporter = { - console: {}, - }; + e = exporter['console']; + if (e) { + parsedExporter = { + console: { + temporality_preference: getTemporalityPreference( + e['temporality_preference'] + ), + default_histogram_aggregation: getDefaultHistogramAggregation( + e['default_histogram_aggregation'] + ), + }, + }; + } break; } @@ -826,23 +823,65 @@ export function setMeterProvider( 'without_scope_info' ] ) ?? false, - with_resource_constant_labels: { + without_target_info: + getBooleanFromConfigFile( + element['exporter']['prometheus/development'][ + 'without_target_info' + ] + ) ?? false, + }, + }; + if ( + element['exporter']['prometheus/development'][ + 'with_resource_constant_labels' + ] + ) { + exporter['prometheus/development']!.with_resource_constant_labels = + { included: getStringListFromConfigFile( element['exporter']['prometheus/development'][ 'with_resource_constant_labels' - ]['included'] + ]?.['included'] ) ?? [], excluded: getStringListFromConfigFile( element['exporter']['prometheus/development'][ 'with_resource_constant_labels' - ]['excluded'] + ]?.['excluded'] ) ?? [], - }, - }, - }; + }; + } + if ( + element['exporter']['prometheus/development'][ + 'translation_strategy' + ] + ) { + const ts = getStringFromConfigFile( + element['exporter']['prometheus/development'][ + 'translation_strategy' + ] + ); + switch (ts) { + case 'underscore_escaping_with_suffixes': + exporter['prometheus/development']!.translation_strategy = + ExperimentalPrometheusTranslationStrategy.UnderscoreEscapingWithSuffixes; + break; + case 'underscore_escaping_without_suffixes': + exporter['prometheus/development']!.translation_strategy = + ExperimentalPrometheusTranslationStrategy.UnderscoreEscapingWithoutSuffixes; + break; + case 'no_utf8_escaping_with_suffixes': + exporter['prometheus/development']!.translation_strategy = + ExperimentalPrometheusTranslationStrategy.NoUtf8EscapingWithSuffixes; + break; + case 'no_translation': + exporter['prometheus/development']!.translation_strategy = + ExperimentalPrometheusTranslationStrategy.NoTranslation; + break; + } + } const pullReader: MetricReader = { pull: { exporter: exporter, @@ -1063,6 +1102,64 @@ export function setMeterProvider( } } +export function getSeverity( + severity?: SeverityNumber +): SeverityNumber | undefined { + const severityType = getStringFromConfigFile(severity); + switch (severityType) { + case 'debug': + return SeverityNumber.DEBUG; + case 'debug2': + return SeverityNumber.DEBUG2; + case 'debug3': + return SeverityNumber.DEBUG3; + case 'debug4': + return SeverityNumber.DEBUG4; + case 'info': + return SeverityNumber.INFO; + case 'info2': + return SeverityNumber.INFO2; + case 'info3': + return SeverityNumber.INFO3; + case 'info4': + return SeverityNumber.INFO4; + case 'warn': + return SeverityNumber.WARN; + case 'warn2': + return SeverityNumber.WARN2; + case 'warn3': + return SeverityNumber.WARN3; + case 'warn4': + return SeverityNumber.WARN4; + case 'error': + return SeverityNumber.ERROR; + case 'error2': + return SeverityNumber.ERROR2; + case 'error3': + return SeverityNumber.ERROR3; + case 'error4': + return SeverityNumber.ERROR4; + case 'fatal': + return SeverityNumber.FATAL; + case 'fatal2': + return SeverityNumber.FATAL2; + case 'fatal3': + return SeverityNumber.FATAL3; + case 'fatal4': + return SeverityNumber.FATAL4; + case 'trace': + return SeverityNumber.TRACE; + case 'trace2': + return SeverityNumber.TRACE2; + case 'trace3': + return SeverityNumber.TRACE3; + case 'trace4': + return SeverityNumber.TRACE4; + default: + return undefined; + } +} + export function setLoggerProvider( config: ConfigurationModel, loggerProvider: LoggerProvider @@ -1078,15 +1175,12 @@ export function setLoggerProvider( loggerProvider['limits']['attribute_count_limit'] ); if (attributeValueLengthLimit || attributeCountLimit) { - if (config.logger_provider.limits == null) { - config.logger_provider.limits = { attribute_count_limit: 128 }; - } if (attributeValueLengthLimit) { - config.logger_provider.limits.attribute_value_length_limit = + config.logger_provider.limits!.attribute_value_length_limit = attributeValueLengthLimit; } if (attributeCountLimit) { - config.logger_provider.limits.attribute_count_limit = + config.logger_provider.limits!.attribute_count_limit = attributeCountLimit; } } @@ -1141,13 +1235,13 @@ export function setLoggerProvider( if (loggerProvider['logger_configurator/development']) { const defaultConfigDisabled = getBooleanFromConfigFile( loggerProvider['logger_configurator/development']['default_config']?.[ - 'disabled' + 'enabled' ] ); if (defaultConfigDisabled || defaultConfigDisabled === false) { config.logger_provider['logger_configurator/development'] = { default_config: { - disabled: defaultConfigDisabled, + enabled: defaultConfigDisabled, }, }; } @@ -1164,19 +1258,35 @@ export function setLoggerProvider( ) { const logger = loggerProvider['logger_configurator/development'].loggers[i]; - let disabled = false; + let enabled = false; + let traceBased; + let minSeverity; if (logger['config']) { - disabled = - getBooleanFromConfigFile(logger['config']['disabled']) ?? false; + enabled = + getBooleanFromConfigFile(logger['config']['enabled']) ?? false; + traceBased = getBooleanFromConfigFile( + logger['config']['trace_based'] + ); + if (logger['config']['minimum_severity']) { + minSeverity = getSeverity(logger['config']['minimum_severity']); + } } const name = getStringFromConfigFile(logger['name']); if (name) { - loggers.push({ + const loggerNew: ExperimentalLoggerMatcherAndConfig = { name: name, config: { - disabled: disabled, + enabled: enabled, }, - }); + }; + if (traceBased !== undefined) { + loggerNew.config!.trace_based = traceBased; + } + if (minSeverity !== undefined) { + loggerNew.config!.minimum_severity = minSeverity; + } + + loggers.push(loggerNew); } } if (config.logger_provider['logger_configurator/development'] == null) { diff --git a/experimental/packages/configuration/src/models/commonModel.ts b/experimental/packages/configuration/src/models/commonModel.ts index 1d8cbf626c8..989e6d3a9aa 100644 --- a/experimental/packages/configuration/src/models/commonModel.ts +++ b/experimental/packages/configuration/src/models/commonModel.ts @@ -50,25 +50,9 @@ export interface OtlpHttpExporter { endpoint?: string; /** - * Configure certificate used to verify a server's TLS credentials. - * Absolute path to certificate file in PEM format. - * If omitted or null, system default certificate verification is used for secure connections. + * Configure TLS settings for the exporter. */ - certificate_file?: string; - - /** - * Configure mTLS private client key. - * Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - * If omitted or null, mTLS is not used. - */ - client_key_file?: string; - - /** - * Configure mTLS client certificate. - * Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - * If omitted or null, mTLS is not used. - */ - client_certificate_file?: string; + tls?: HttpTls; /** * Configure compression. @@ -118,25 +102,9 @@ export interface OtlpGrpcExporter { endpoint?: string; /** - * Configure certificate used to verify a server's TLS credentials. - * Absolute path to certificate file in PEM format. - * If omitted or null, system default certificate verification is used for secure connections. + * Configure TLS settings for the exporter. */ - certificate_file?: string; - - /** - * Configure mTLS private client key. - * Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - * If omitted or null, mTLS is not used. - */ - client_key_file?: string; - - /** - * Configure mTLS client certificate. - * Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - * If omitted or null, mTLS is not used. - */ - client_certificate_file?: string; + tls?: GrpcTls; /** * Configure headers. Entries have higher priority than entries from .headers_list. @@ -164,6 +132,61 @@ export interface OtlpGrpcExporter { * If omitted or null, 10000 is used. */ timeout?: number; +} + +export interface ExperimentalOtlpFileExporter { + /** + * Configure output stream. + * Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. + * If omitted or null, stdout is used. + */ + output_stream?: string; +} + +export interface HttpTls { + /** + * Configure certificate used to verify a server's TLS credentials. + * Absolute path to certificate file in PEM format. + * If omitted or null, system default certificate verification is used for secure connections. + */ + ca_file?: string; + + /** + * Configure mTLS private client key. + * Absolute path to client key file in PEM format. If set, .client_certificate must also be set. + * If omitted or null, mTLS is not used. + */ + key_file?: string; + + /** + * Configure mTLS client certificate. + * Absolute path to client certificate file in PEM format. If set, .client_key must also be set. + * If omitted or null, mTLS is not used. + */ + cert_file?: string; +} + +export interface GrpcTls { + /** + * Configure certificate used to verify a server's TLS credentials. + * Absolute path to certificate file in PEM format. + * If omitted or null, system default certificate verification is used for secure connections. + */ + ca_file?: string; + + /** + * Configure mTLS private client key. + * Absolute path to client key file in PEM format. If set, .client_certificate must also be set. + * If omitted or null, mTLS is not used. + */ + key_file?: string; + + /** + * Configure mTLS client certificate. + * Absolute path to client certificate file in PEM format. If set, .client_key must also be set. + * If omitted or null, mTLS is not used. + */ + cert_file?: string; /** * Configure client transport security for the exporter's connection. @@ -173,11 +196,29 @@ export interface OtlpGrpcExporter { insecure?: boolean; } -export interface OtlpFileExporter { - /** - * Configure output stream. - * Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. - * If omitted or null, stdout is used. - */ - output_stream?: string; +export enum SeverityNumber { + DEBUG = 'debug', + DEBUG2 = 'debug2', + DEBUG3 = 'debug3', + DEBUG4 = 'debug4', + ERROR = 'error', + ERROR2 = 'error2', + ERROR3 = 'error3', + ERROR4 = 'error4', + FATAL = 'fatal', + FATAL2 = 'fatal2', + FATAL3 = 'fatal3', + FATAL4 = 'fatal4', + INFO = 'info', + INFO2 = 'info2', + INFO3 = 'info3', + INFO4 = 'info4', + TRACE = 'trace', + TRACE2 = 'trace2', + TRACE3 = 'trace3', + TRACE4 = 'trace4', + WARN = 'warn', + WARN2 = 'warn2', + WARN3 = 'warn3', + WARN4 = 'warn4', } diff --git a/experimental/packages/configuration/src/models/loggerProviderModel.ts b/experimental/packages/configuration/src/models/loggerProviderModel.ts index 607ccb43c1f..becfabacf1a 100644 --- a/experimental/packages/configuration/src/models/loggerProviderModel.ts +++ b/experimental/packages/configuration/src/models/loggerProviderModel.ts @@ -16,17 +16,19 @@ 'use strict'; import { - OtlpFileExporter, + ExperimentalOtlpFileExporter, OtlpGrpcExporter, OtlpHttpExporter, + SeverityNumber, } from './commonModel'; -export function initializeDefaultLoggerProviderConfiguration(): LoggerProvider { +export function initializeDefaultLoggerProviderConfiguration(): Required { return { processors: [], limits: { attribute_count_limit: 128, }, + 'logger_configurator/development': {}, }; } @@ -45,7 +47,7 @@ export interface LoggerProvider { * Configure loggers. * This type is in development and subject to breaking changes in minor versions. */ - 'logger_configurator/development'?: LoggerConfigurator; + 'logger_configurator/development'?: ExperimentalLoggerConfigurator; } export interface SimpleLogRecordProcessor { @@ -103,7 +105,7 @@ export interface LogRecordExporter { * Configure exporter to be OTLP with file transport. * This type is in development and subject to breaking changes in minor versions. */ - 'otlp_file/development'?: OtlpFileExporter; + 'otlp_file/development'?: ExperimentalOtlpFileExporter; /** * Configure exporter to be console. @@ -139,36 +141,48 @@ export interface LogRecordProcessor { simple?: SimpleLogRecordProcessor; } -export interface LoggerConfigurator { +export interface ExperimentalLoggerConfigurator { /** * Configure the default logger config used there is no matching entry in .logger_configurator/development.loggers. */ - default_config?: LoggerConfig; + default_config?: ExperimentalLoggerConfig; /** * Configure loggers. */ - loggers?: LoggerMatcherAndConfig[]; + loggers?: ExperimentalLoggerMatcherAndConfig[]; } -export interface LoggerConfig { - /** - * Configure if the logger is enabled or not. - */ - disabled: boolean; -} - -export interface LoggerMatcherAndConfig { +export interface ExperimentalLoggerMatcherAndConfig { /** * Configure logger names to match, evaluated as follows: * * If the logger name exactly matches. * * If the logger name matches the wildcard pattern, where '?' matches any single character * and '*' matches any number of characters including none. */ - name?: string; + name: string; /** * The logger config. */ - config?: LoggerConfig; + config: ExperimentalLoggerConfig; +} + +export interface ExperimentalLoggerConfig { + /** + * Configure if the logger is enabled or not. + */ + enabled?: boolean; + + /** + * Configure severity filtering. + * Log records with an non-zero (i.e. unspecified) severity number which is less than minimum_severity are not processed. + */ + minimum_severity?: SeverityNumber; + + /** + * Configure trace based filtering. + * 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. + */ + trace_based?: boolean; } diff --git a/experimental/packages/configuration/src/models/meterProviderModel.ts b/experimental/packages/configuration/src/models/meterProviderModel.ts index df0654096bc..78f5d2ab367 100644 --- a/experimental/packages/configuration/src/models/meterProviderModel.ts +++ b/experimental/packages/configuration/src/models/meterProviderModel.ts @@ -16,14 +16,17 @@ 'use strict'; import { + GrpcTls, + HttpTls, IncludeExclude, NameStringValuePair, OtlpHttpEncoding, } from './commonModel'; -export function initializeDefaultMeterProviderConfiguration(): MeterProvider { +export function initializeDefaultMeterProviderConfiguration(): Required { return { readers: [], + views: [], exemplar_filter: ExemplarFilter.TraceBased, }; } @@ -169,12 +172,12 @@ export interface PushMetricExporter { * Configure exporter to be OTLP with file transport. * This type is in development and subject to breaking changes in minor versions. */ - 'otlp_file/development'?: OtlpFileMetricExporter; + 'otlp_file/development'?: ExperimentalOtlpFileMetricExporter; /** * Configure exporter to be console. */ - console?: object; + console?: ConsoleMetricExporter; } export interface PullMetricExporter { @@ -182,7 +185,7 @@ export interface PullMetricExporter { * Configure exporter to be prometheus. * This type is in development and subject to breaking changes in minor versions. */ - 'prometheus/development': PrometheusMetricExporter; + 'prometheus/development': ExperimentalPrometheusMetricExporter; } export interface MetricProducer { @@ -190,14 +193,9 @@ export interface MetricProducer { * Configure metric producer to be opencensus. */ opencensus?: object; - - /** - * Configure metric producer to be prometheus. - */ - prometheus?: object; } -export interface PrometheusMetricExporter { +export interface ExperimentalPrometheusMetricExporter { /** * Configure host. * If omitted or null, localhost is used. @@ -216,10 +214,28 @@ export interface PrometheusMetricExporter { */ without_scope_info?: boolean; + /** + * Configure Prometheus Exporter to produce metrics without a target info metric for the resource. + * If omitted or null, false is used. + */ + without_target_info?: boolean; + /** * Configure Prometheus Exporter to add resource attributes as metrics attributes. */ - with_resource_constant_labels: IncludeExclude; + with_resource_constant_labels?: IncludeExclude; + + /** + * Configure how metric names are translated to Prometheus metric names. + */ + translation_strategy?: ExperimentalPrometheusTranslationStrategy; +} + +export enum ExperimentalPrometheusTranslationStrategy { + UnderscoreEscapingWithSuffixes = 'underscore_escaping_with_suffixes', + UnderscoreEscapingWithoutSuffixes = 'underscore_escaping_without_suffixes', + NoUtf8EscapingWithSuffixes = 'no_utf8_escaping_with_suffixes', + NoTranslation = 'no_translation', } export interface MetricReader { @@ -242,25 +258,9 @@ export interface OtlpHttpMetricExporter { endpoint?: string; /** - * Configure certificate used to verify a server's TLS credentials. - * Absolute path to certificate file in PEM format. - * If omitted or null, system default certificate verification is used for secure connections. - */ - certificate_file?: string; - - /** - * Configure mTLS private client key. - * Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - * If omitted or null, mTLS is not used. - */ - client_key_file?: string; - - /** - * Configure mTLS client certificate. - * Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - * If omitted or null, mTLS is not used. + * Configure TLS settings for the exporter. */ - client_certificate_file?: string; + tls?: HttpTls; /** * Configure headers. Entries have higher priority than entries from .headers_list. @@ -319,25 +319,9 @@ export interface OtlpGrpcMetricExporter { endpoint?: string; /** - * Configure certificate used to verify a server's TLS credentials. - * Absolute path to certificate file in PEM format. - * If omitted or null, system default certificate verification is used for secure connections. - */ - certificate_file?: string; - - /** - * Configure mTLS private client key. - * Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - * If omitted or null, mTLS is not used. + * Configure TLS settings for the exporter. */ - client_key_file?: string; - - /** - * Configure mTLS client certificate. - * Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - * If omitted or null, mTLS is not used. - */ - client_certificate_file?: string; + tls?: GrpcTls; /** * Configure headers. Entries have higher priority than entries from .headers_list. @@ -366,13 +350,6 @@ export interface OtlpGrpcMetricExporter { */ timeout?: number; - /** - * Configure client transport security for the exporter's connection. - * Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. - * If omitted or null, false is used. - */ - insecure?: boolean; - /** * Configure temporality preference. * Values include: cumulative, delta, low_memory. @@ -388,7 +365,7 @@ export interface OtlpGrpcMetricExporter { default_histogram_aggregation?: ExporterDefaultHistogramAggregation; } -export interface OtlpFileMetricExporter { +export interface ExperimentalOtlpFileMetricExporter { /** * Configure output stream. * Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. @@ -422,6 +399,20 @@ export enum ExporterDefaultHistogramAggregation { ExplicitBucketHistogram = 'explicit_bucket_histogram', } +export interface ConsoleMetricExporter { + /** + * Configure temporality preference. + * If omitted or null, cumulative is used. + */ + temporality_preference?: ExporterTemporalityPreference; + + /** + * Configure default histogram aggregation. + * If omitted or null, explicit_bucket_histogram is used. + */ + default_histogram_aggregation?: ExporterDefaultHistogramAggregation; +} + export interface View { /** * Configure view selector. diff --git a/experimental/packages/configuration/src/models/resourceModel.ts b/experimental/packages/configuration/src/models/resourceModel.ts index 6646766a50b..adf6f86d1a4 100644 --- a/experimental/packages/configuration/src/models/resourceModel.ts +++ b/experimental/packages/configuration/src/models/resourceModel.ts @@ -43,7 +43,7 @@ export interface Resource { * This type is in development and subject to breaking changes in minor versions. * If omitted or null, resource detection is disabled. */ - 'detection/development'?: ResourceDetection; + 'detection/development'?: ExperimentalResourceDetection; } export interface AttributeNameValue { @@ -67,7 +67,7 @@ export interface AttributeNameValue { | 'double_array'; } -export interface ResourceDetection { +export interface ExperimentalResourceDetection { /** * Configure attributes provided by resource detectors. */ @@ -78,10 +78,10 @@ export interface ResourceDetection { * Resource detector names are dependent on the SDK language ecosystem. Please consult documentation for each respective language. * If omitted or null, no resource detectors are enabled. */ - detectors?: ResourceDetector; + detectors?: ExperimentalResourceDetector; } -export interface ResourceDetector { +export interface ExperimentalResourceDetector { /** * Enable the container resource detector, which populates container.* attributes. */ diff --git a/experimental/packages/configuration/src/models/tracerProviderModel.ts b/experimental/packages/configuration/src/models/tracerProviderModel.ts index fae23d2e32e..07788bb6f3f 100644 --- a/experimental/packages/configuration/src/models/tracerProviderModel.ts +++ b/experimental/packages/configuration/src/models/tracerProviderModel.ts @@ -16,12 +16,12 @@ 'use strict'; import { - OtlpFileExporter, + ExperimentalOtlpFileExporter, OtlpGrpcExporter, OtlpHttpExporter, } from './commonModel'; -export function initializeDefaultTracerProviderConfiguration(): TracerProvider { +export function initializeDefaultTracerProviderConfiguration(): Required { return { processors: [], limits: { @@ -61,60 +61,37 @@ export interface TracerProvider { sampler?: Sampler; } -export interface SpanProcessor { - /** - * Configure a batch span processor. - */ - batch?: BatchSpanProcessor; - - /** - * Configure a simple span processor. - */ - simple?: SimpleSpanProcessor; -} - -export interface SpanLimits { - /** - * Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. - * Value must be non-negative. - * If omitted or null, there is no limit. - */ - attribute_value_length_limit?: number; - +export interface BatchSpanProcessor { /** - * Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + * Configure delay interval (in milliseconds) between two consecutive exports. * Value must be non-negative. - * If omitted or null, 128 is used. + * If omitted or null, 5000 is used for traces and 1000 for logs. */ - attribute_count_limit?: number; + schedule_delay?: number; /** - * Configure max span event count. - * Value must be non-negative. - * If omitted or null, 128 is used. + * Configure maximum allowed time (in milliseconds) to export data. + * Value must be non-negative. A value of 0 indicates no limit (infinity). + * If omitted or null, 30000 is used. */ - event_count_limit?: number; + export_timeout?: number; /** - * Configure max span link count. - * Value must be non-negative. - * If omitted or null, 128 is used. + * Configure maximum queue size. Value must be positive. + * If omitted or null, 2048 is used. */ - link_count_limit?: number; + max_queue_size?: number; /** - * Configure max attributes per span event. - * Value must be non-negative. - * If omitted or null, 128 is used. + * Configure maximum batch size. Value must be positive. + * If omitted or null, 512 is used. */ - event_attribute_count_limit?: number; + max_export_batch_size?: number; /** - * Configure max attributes per span link. - * Value must be non-negative. - * If omitted or null, 128 is used. + * Configure exporter. */ - link_attribute_count_limit?: number; + exporter: SpanExporter; } export interface Sampler { @@ -132,6 +109,11 @@ export interface Sampler { * Configure sampler to be always_on. */ always_on?: object; + + /*** + * Configure sampler to be trace_id_ratio_based. + */ + trace_id_ratio_based?: TraceIdRatioBasedSampler; } export interface ParentBasedSampler { @@ -139,60 +121,41 @@ export interface ParentBasedSampler { * Configure root sampler. * If omitted or null, always_on is used. */ - root: Sampler; + root?: Sampler; /** * Configure remote_parent_sampled sampler. * If omitted or null, always_on is used. */ - remote_parent_sampled: Sampler; + remote_parent_sampled?: Sampler; /** * Configure remote_parent_not_sampled sampler. * If omitted or null, always_off is used. */ - remote_parent_not_sampled: Sampler; + remote_parent_not_sampled?: Sampler; /** * Configure local_parent_sampled sampler. * If omitted or null, always_on is used. */ - local_parent_sampled: Sampler; + local_parent_sampled?: Sampler; /** * Configure local_parent_not_sampled sampler. * If omitted or null, always_off is used. */ - local_parent_not_sampled: Sampler; + local_parent_not_sampled?: Sampler; } -export interface BatchSpanProcessor { - /** - * Configure delay interval (in milliseconds) between two consecutive exports. - * Value must be non-negative. - * If omitted or null, 5000 is used for traces and 1000 for logs. - */ - schedule_delay?: number; - +export interface TraceIdRatioBasedSampler { /** - * Configure maximum allowed time (in milliseconds) to export data. - * Value must be non-negative. A value of 0 indicates no limit (infinity). - * If omitted or null, 30000 is used. - */ - export_timeout?: number; - - /** - * Configure maximum queue size. Value must be positive. - * If omitted or null, 2048 is used. + * Configure trace_id_ratio. */ - max_queue_size?: number; - - /** - * Configure maximum batch size. Value must be positive. - * If omitted or null, 512 is used. - */ - max_export_batch_size?: number; + ratio?: number; +} +export interface SimpleSpanProcessor { /** * Configure exporter. */ @@ -214,37 +177,66 @@ export interface SpanExporter { * Configure exporter to be OTLP with file transport. * This type is in development and subject to breaking changes in minor versions. */ - 'otlp_file/development'?: OtlpFileExporter; + 'otlp_file/development'?: ExperimentalOtlpFileExporter; /** * Configure exporter to be console. */ console?: object; +} +export interface SpanLimits { /** - * Configure exporter to be zipkin. + * Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. + * Value must be non-negative. + * If omitted or null, there is no limit. */ - zipkin?: ZipkinSpanExporter; -} + attribute_value_length_limit?: number; -export interface ZipkinSpanExporter { /** - * Configure endpoint. - * If omitted or null, http://localhost:9411/api/v2/spans is used. + * Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. + * Value must be non-negative. + * If omitted or null, 128 is used. */ - endpoint?: string; + attribute_count_limit?: number; /** - * Configure max time (in milliseconds) to wait for each export. - * Value must be non-negative. A value of 0 indicates indefinite. - * If omitted or null, 10000 is used. + * Configure max span event count. + * Value must be non-negative. + * If omitted or null, 128 is used. */ - timeout?: number; + event_count_limit?: number; + + /** + * Configure max span link count. + * Value must be non-negative. + * If omitted or null, 128 is used. + */ + link_count_limit?: number; + + /** + * Configure max attributes per span event. + * Value must be non-negative. + * If omitted or null, 128 is used. + */ + event_attribute_count_limit?: number; + + /** + * Configure max attributes per span link. + * Value must be non-negative. + * If omitted or null, 128 is used. + */ + link_attribute_count_limit?: number; } -export interface SimpleSpanProcessor { +export interface SpanProcessor { /** - * Configure exporter. + * Configure a batch span processor. */ - exporter: SpanExporter; + batch?: BatchSpanProcessor; + + /** + * Configure a simple span processor. + */ + simple?: SimpleSpanProcessor; } diff --git a/experimental/packages/configuration/src/utils.ts b/experimental/packages/configuration/src/utils.ts index 211092d51ac..6f268e7e3c9 100644 --- a/experimental/packages/configuration/src/utils.ts +++ b/experimental/packages/configuration/src/utils.ts @@ -16,6 +16,7 @@ import { diag } from '@opentelemetry/api'; import { getStringFromEnv } from '@opentelemetry/core'; import { inspect } from 'util'; +import { GrpcTls, HttpTls } from './models/commonModel'; /** * Retrieves a boolean value from a configuration file parameter. @@ -174,3 +175,49 @@ export function envVariableSubstitution(value: unknown): string | undefined { } return String(value); } + +export function getGrpcTlsConfig( + certificateFile?: string, + clientKeyFile?: string, + clientCertificateFile?: string, + insecure?: boolean +): GrpcTls | undefined { + if (certificateFile || clientKeyFile || clientCertificateFile) { + const tls: GrpcTls = {}; + if (certificateFile) { + tls.ca_file = certificateFile; + } + if (clientKeyFile) { + tls.key_file = clientKeyFile; + } + if (clientCertificateFile) { + tls.cert_file = clientCertificateFile; + } + if (insecure !== undefined) { + tls.insecure = insecure; + } + return tls; + } + return undefined; +} + +export function getHttpTlsConfig( + certificateFile?: string, + clientKeyFile?: string, + clientCertificateFile?: string +): HttpTls | undefined { + if (certificateFile || clientKeyFile || clientCertificateFile) { + const tls: HttpTls = {}; + if (certificateFile) { + tls.ca_file = certificateFile; + } + if (clientKeyFile) { + tls.key_file = clientKeyFile; + } + if (clientCertificateFile) { + tls.cert_file = clientCertificateFile; + } + return tls; + } + return undefined; +} diff --git a/experimental/packages/configuration/test/ConfigFactory.test.ts b/experimental/packages/configuration/test/ConfigFactory.test.ts index 47dd13e6c07..0bee4827169 100644 --- a/experimental/packages/configuration/test/ConfigFactory.test.ts +++ b/experimental/packages/configuration/test/ConfigFactory.test.ts @@ -19,9 +19,10 @@ import * as Sinon from 'sinon'; import { ConfigurationModel } from '../src'; import { diag, DiagLogLevel } from '@opentelemetry/api'; import { createConfigFactory } from '../src/ConfigFactory'; -import { OtlpHttpEncoding } from '../src/models/commonModel'; +import { OtlpHttpEncoding, SeverityNumber } from '../src/models/commonModel'; import { ExemplarFilter, + ExperimentalPrometheusTranslationStrategy, ExporterDefaultHistogramAggregation, ExporterTemporalityPreference, InstrumentType, @@ -41,6 +42,7 @@ import { setPropagator, setMeterProvider as setFileMeterProvider, getTemporalityPreference, + getSeverity, } from '../src/FileConfigFactory'; import { TracerProvider } from '../src/models/tracerProviderModel'; @@ -78,6 +80,120 @@ const defaultTracerProvider: TracerProvider = { }; const configFromFile: ConfigurationModel = { + disabled: false, + log_level: DiagLogLevel.INFO, + resource: { + attributes: [ + { + name: 'service.name', + value: 'unknown_service', + type: 'string', + }, + ], + }, + attribute_limits: { + attribute_count_limit: 128, + }, + propagator: { + composite: [{ tracecontext: null }, { baggage: null }], + composite_list: 'tracecontext,baggage', + }, + tracer_provider: { + processors: [ + { + batch: { + schedule_delay: 5000, + export_timeout: 30000, + max_queue_size: 2048, + max_export_batch_size: 512, + exporter: { + otlp_http: { + endpoint: 'http://localhost:4318/v1/traces', + timeout: 10000, + compression: 'gzip', + encoding: OtlpHttpEncoding.Protobuf, + }, + }, + }, + }, + ], + limits: { + attribute_count_limit: 128, + event_count_limit: 128, + link_count_limit: 128, + event_attribute_count_limit: 128, + link_attribute_count_limit: 128, + }, + sampler: { + parent_based: { + root: { always_on: undefined }, + remote_parent_sampled: { always_on: undefined }, + remote_parent_not_sampled: { always_off: undefined }, + local_parent_sampled: { always_on: undefined }, + local_parent_not_sampled: { always_off: undefined }, + }, + }, + }, + meter_provider: { + readers: [ + { + periodic: { + interval: 60000, + timeout: 30000, + exporter: { + otlp_http: { + endpoint: 'http://localhost:4318/v1/metrics', + compression: 'gzip', + timeout: 10000, + encoding: OtlpHttpEncoding.Protobuf, + temporality_preference: ExporterTemporalityPreference.Cumulative, + default_histogram_aggregation: + ExporterDefaultHistogramAggregation.ExplicitBucketHistogram, + }, + }, + cardinality_limits: { + default: 2000, + counter: 2000, + gauge: 2000, + histogram: 2000, + observable_counter: 2000, + observable_gauge: 2000, + observable_up_down_counter: 2000, + up_down_counter: 2000, + }, + }, + }, + ], + exemplar_filter: ExemplarFilter.TraceBased, + views: [], + }, + logger_provider: { + processors: [ + { + batch: { + schedule_delay: 1000, + export_timeout: 30000, + max_queue_size: 2048, + max_export_batch_size: 512, + exporter: { + otlp_http: { + endpoint: 'http://localhost:4318/v1/logs', + timeout: 10000, + encoding: OtlpHttpEncoding.Protobuf, + compression: 'gzip', + }, + }, + }, + }, + ], + limits: { + attribute_count_limit: 128, + }, + 'logger_configurator/development': {}, + }, +}; + +const configFromKitchenSinkFile: ConfigurationModel = { disabled: false, log_level: DiagLogLevel.INFO, resource: { @@ -169,9 +285,11 @@ const configFromFile: ConfigurationModel = { otlp_http: { endpoint: 'http://localhost:4318/v1/traces', timeout: 10000, - certificate_file: '/app/cert.pem', - client_key_file: '/app/cert.pem', - client_certificate_file: '/app/cert.pem', + tls: { + ca_file: '/app/cert.pem', + key_file: '/app/cert.pem', + cert_file: '/app/cert.pem', + }, headers: [{ name: 'api-key', value: '1234' }], headers_list: 'api-key=1234', compression: 'gzip', @@ -190,13 +308,15 @@ const configFromFile: ConfigurationModel = { otlp_grpc: { endpoint: 'http://localhost:4317', timeout: 10000, - certificate_file: '/app/cert.pem', - client_key_file: '/app/cert.pem', - client_certificate_file: '/app/cert.pem', + tls: { + ca_file: '/app/cert.pem', + key_file: '/app/cert.pem', + cert_file: '/app/cert.pem', + insecure: false, + }, headers: [{ name: 'api-key', value: '1234' }], headers_list: 'api-key=1234', compression: 'gzip', - insecure: false, }, }, }, @@ -227,20 +347,6 @@ const configFromFile: ConfigurationModel = { }, }, }, - { - batch: { - schedule_delay: 5000, - export_timeout: 30000, - max_queue_size: 2048, - max_export_batch_size: 512, - exporter: { - zipkin: { - endpoint: 'http://localhost:9411/api/v2/spans', - timeout: 10000, - }, - }, - }, - }, { simple: { exporter: { @@ -276,15 +382,117 @@ const configFromFile: ConfigurationModel = { host: 'localhost', port: 9464, without_scope_info: false, + without_target_info: false, with_resource_constant_labels: { included: ['service*'], excluded: ['service.attr1'], }, + translation_strategy: + ExperimentalPrometheusTranslationStrategy.UnderscoreEscapingWithSuffixes, }, }, producers: [ { - opencensus: undefined, + opencensus: {}, + }, + ], + cardinality_limits: { + default: 2000, + counter: 2000, + gauge: 2000, + histogram: 2000, + observable_counter: 2000, + observable_gauge: 2000, + observable_up_down_counter: 2000, + up_down_counter: 2000, + }, + }, + }, + { + pull: { + exporter: { + 'prometheus/development': { + host: 'localhost', + port: 9464, + without_scope_info: false, + without_target_info: false, + with_resource_constant_labels: { + included: ['service*'], + excluded: ['service.attr1'], + }, + translation_strategy: + ExperimentalPrometheusTranslationStrategy.UnderscoreEscapingWithoutSuffixes, + }, + }, + producers: [ + { + opencensus: {}, + }, + ], + cardinality_limits: { + default: 2000, + counter: 2000, + gauge: 2000, + histogram: 2000, + observable_counter: 2000, + observable_gauge: 2000, + observable_up_down_counter: 2000, + up_down_counter: 2000, + }, + }, + }, + { + pull: { + exporter: { + 'prometheus/development': { + host: 'localhost', + port: 9464, + without_scope_info: false, + without_target_info: false, + with_resource_constant_labels: { + included: ['service*'], + excluded: ['service.attr1'], + }, + translation_strategy: + ExperimentalPrometheusTranslationStrategy.NoUtf8EscapingWithSuffixes, + }, + }, + producers: [ + { + opencensus: {}, + }, + ], + cardinality_limits: { + default: 2000, + counter: 2000, + gauge: 2000, + histogram: 2000, + observable_counter: 2000, + observable_gauge: 2000, + observable_up_down_counter: 2000, + up_down_counter: 2000, + }, + }, + }, + { + pull: { + exporter: { + 'prometheus/development': { + host: 'localhost', + port: 9464, + without_scope_info: false, + without_target_info: false, + with_resource_constant_labels: { + included: ['service*'], + excluded: ['service.attr1'], + }, + translation_strategy: + ExperimentalPrometheusTranslationStrategy.NoTranslation, + }, + }, + producers: [ + { + opencensus: {}, }, ], cardinality_limits: { @@ -306,9 +514,11 @@ const configFromFile: ConfigurationModel = { exporter: { otlp_http: { endpoint: 'http://localhost:4318/v1/metrics', - certificate_file: '/app/cert.pem', - client_key_file: '/app/cert.pem', - client_certificate_file: '/app/cert.pem', + tls: { + ca_file: '/app/cert.pem', + key_file: '/app/cert.pem', + cert_file: '/app/cert.pem', + }, headers: [ { name: 'api-key', @@ -326,7 +536,7 @@ const configFromFile: ConfigurationModel = { }, producers: [ { - prometheus: undefined, + opencensus: {}, }, ], cardinality_limits: { @@ -348,9 +558,12 @@ const configFromFile: ConfigurationModel = { exporter: { otlp_grpc: { endpoint: 'http://localhost:4317', - certificate_file: '/app/cert.pem', - client_key_file: '/app/cert.pem', - client_certificate_file: '/app/cert.pem', + tls: { + ca_file: '/app/cert.pem', + key_file: '/app/cert.pem', + cert_file: '/app/cert.pem', + insecure: false, + }, headers: [ { name: 'api-key', @@ -360,7 +573,6 @@ const configFromFile: ConfigurationModel = { headers_list: 'api-key=1234', compression: 'gzip', timeout: 10000, - insecure: false, temporality_preference: ExporterTemporalityPreference.Delta, default_histogram_aggregation: ExporterDefaultHistogramAggregation.Base2ExponentialBucketHistogram, @@ -431,7 +643,11 @@ const configFromFile: ConfigurationModel = { timeout: 30000, interval: 60000, exporter: { - console: {}, + console: { + temporality_preference: ExporterTemporalityPreference.Delta, + default_histogram_aggregation: + ExporterDefaultHistogramAggregation.Base2ExponentialBucketHistogram, + }, }, cardinality_limits: { default: 2000, @@ -491,9 +707,11 @@ const configFromFile: ConfigurationModel = { endpoint: 'http://localhost:4318/v1/logs', timeout: 10000, encoding: OtlpHttpEncoding.Protobuf, - certificate_file: '/app/cert.pem', - client_key_file: '/app/cert.pem', - client_certificate_file: '/app/cert.pem', + tls: { + ca_file: '/app/cert.pem', + key_file: '/app/cert.pem', + cert_file: '/app/cert.pem', + }, headers: [{ name: 'api-key', value: '1234' }], headers_list: 'api-key=1234', compression: 'gzip', @@ -511,13 +729,15 @@ const configFromFile: ConfigurationModel = { otlp_grpc: { endpoint: 'http://localhost:4317', timeout: 10000, - certificate_file: '/app/cert.pem', - client_key_file: '/app/cert.pem', - client_certificate_file: '/app/cert.pem', + tls: { + ca_file: '/app/cert.pem', + key_file: '/app/cert.pem', + cert_file: '/app/cert.pem', + insecure: false, + }, headers: [{ name: 'api-key', value: '1234' }], headers_list: 'api-key=1234', compression: 'gzip', - insecure: false, }, }, }, @@ -562,13 +782,15 @@ const configFromFile: ConfigurationModel = { }, 'logger_configurator/development': { default_config: { - disabled: true, + enabled: true, }, loggers: [ { name: 'io.opentelemetry.contrib.*', config: { - disabled: false, + enabled: false, + minimum_severity: SeverityNumber.INFO, + trace_based: true, }, }, ], @@ -662,6 +884,7 @@ const defaultConfigFromFileWithEnvVariables: ConfigurationModel = { }, ], exemplar_filter: ExemplarFilter.TraceBased, + views: [], }, logger_provider: { processors: [ @@ -685,6 +908,7 @@ const defaultConfigFromFileWithEnvVariables: ConfigurationModel = { limits: { attribute_count_limit: 128, }, + 'logger_configurator/development': {}, }, }; @@ -695,9 +919,11 @@ const readerExample: MetricReader = { exporter: { otlp_http: { endpoint: 'http://localhost:4318/v1/metrics', - certificate_file: '/app/cert.pem', - client_key_file: '/app/cert.pem', - client_certificate_file: '/app/cert.pem', + tls: { + ca_file: '/app/cert.pem', + key_file: '/app/cert.pem', + cert_file: '/app/cert.pem', + }, headers: [ { name: 'api-key', @@ -715,7 +941,7 @@ const readerExample: MetricReader = { }, producers: [ { - prometheus: undefined, + opencensus: {}, }, ], cardinality_limits: { @@ -943,9 +1169,11 @@ describe('ConfigFactory', function () { exporter: { otlp_http: { endpoint: 'http://test.com:4318/v1/traces', - certificate_file: 'certificate_file.txt', - client_key_file: 'certificate_key_value', - client_certificate_file: 'client_certificate_file.txt', + tls: { + ca_file: 'certificate_file.txt', + key_file: 'certificate_key_value', + cert_file: 'client_certificate_file.txt', + }, compression: 'gzip', timeout: 2000, headers_list: 'host=localhost', @@ -1022,70 +1250,8 @@ describe('ConfigFactory', function () { assert.deepStrictEqual(configProvider.getConfigModel(), expectedConfig); }); - it('should return config with tracer_provider with default zipkin exporter', function () { - process.env.OTEL_TRACES_EXPORTER = 'zipkin'; - const expectedConfig: ConfigurationModel = { - ...defaultConfig, - tracer_provider: { - ...defaultTracerProvider, - processors: [ - { - batch: { - schedule_delay: 5000, - export_timeout: 30000, - max_queue_size: 2048, - max_export_batch_size: 512, - exporter: { - zipkin: { - endpoint: 'http://localhost:9411/api/v2/spans', - timeout: 10000, - }, - }, - }, - }, - ], - }, - }; - const configProvider = createConfigFactory(); - assert.deepStrictEqual(configProvider.getConfigModel(), expectedConfig); - }); - - it('should return config with tracer_provider with custom zipkin exporter', function () { - process.env.OTEL_TRACES_EXPORTER = 'zipkin'; - process.env.OTEL_EXPORTER_ZIPKIN_ENDPOINT = - 'http://custom:9411/api/v2/spans'; - process.env.OTEL_EXPORTER_ZIPKIN_TIMEOUT = '15000'; - const expectedConfig: ConfigurationModel = { - ...defaultConfig, - tracer_provider: { - ...defaultTracerProvider, - processors: [ - { - batch: { - schedule_delay: 5000, - export_timeout: 30000, - max_queue_size: 2048, - max_export_batch_size: 512, - exporter: { - zipkin: { - endpoint: 'http://custom:9411/api/v2/spans', - timeout: 15000, - }, - }, - }, - }, - ], - }, - }; - const configProvider = createConfigFactory(); - assert.deepStrictEqual(configProvider.getConfigModel(), expectedConfig); - }); - it('should return config with tracer_provider with exporter list', function () { - process.env.OTEL_TRACES_EXPORTER = 'otlp,console,zipkin'; - process.env.OTEL_EXPORTER_ZIPKIN_ENDPOINT = - 'http://custom:9411/api/v2/spans'; - process.env.OTEL_EXPORTER_ZIPKIN_TIMEOUT = '15000'; + process.env.OTEL_TRACES_EXPORTER = 'otlp,console'; const expectedConfig: ConfigurationModel = { ...defaultConfig, tracer_provider: { @@ -1113,20 +1279,6 @@ describe('ConfigFactory', function () { }, }, }, - { - batch: { - schedule_delay: 5000, - export_timeout: 30000, - max_queue_size: 2048, - max_export_batch_size: 512, - exporter: { - zipkin: { - endpoint: 'http://custom:9411/api/v2/spans', - timeout: 15000, - }, - }, - }, - }, ], }, }; @@ -1164,9 +1316,11 @@ describe('ConfigFactory', function () { otlp_grpc: { endpoint: 'http://localhost:4317', timeout: 10000, - certificate_file: 'traces-cert.pem', - client_key_file: 'traces-key.pem', - client_certificate_file: 'traces-client-cert.pem', + tls: { + ca_file: 'traces-cert.pem', + key_file: 'traces-key.pem', + cert_file: 'traces-client-cert.pem', + }, compression: 'gzip', headers_list: 'host=localhost', }, @@ -1210,9 +1364,11 @@ describe('ConfigFactory', function () { exporter: { otlp_http: { endpoint: 'http://test.com:4318/v1/metrics', - certificate_file: 'certificate_file.txt', - client_key_file: 'certificate_key_value', - client_certificate_file: 'client_certificate_file.txt', + tls: { + ca_file: 'certificate_file.txt', + key_file: 'certificate_key_value', + cert_file: 'client_certificate_file.txt', + }, compression: 'gzip', timeout: 300, headers_list: 'host=localhost', @@ -1226,6 +1382,7 @@ describe('ConfigFactory', function () { }, ], exemplar_filter: ExemplarFilter.AlwaysOn, + views: [], }, }; const configFactory = createConfigFactory(); @@ -1250,6 +1407,7 @@ describe('ConfigFactory', function () { }, ], exemplar_filter: ExemplarFilter.TraceBased, + views: [], }, }; const configFactory = createConfigFactory(); @@ -1296,6 +1454,7 @@ describe('ConfigFactory', function () { }, ], exemplar_filter: ExemplarFilter.TraceBased, + views: [], }, }; const configFactory = createConfigFactory(); @@ -1327,9 +1486,11 @@ describe('ConfigFactory', function () { ExporterTemporalityPreference.Cumulative, endpoint: 'http://localhost:4317', timeout: 10000, - certificate_file: 'metric-cert.pem', - client_key_file: 'metric-key.pem', - client_certificate_file: 'metric-client-cert.pem', + tls: { + ca_file: 'metric-cert.pem', + key_file: 'metric-key.pem', + cert_file: 'metric-client-cert.pem', + }, compression: 'gzip', headers_list: 'host=localhost', }, @@ -1338,6 +1499,7 @@ describe('ConfigFactory', function () { }, ], exemplar_filter: ExemplarFilter.TraceBased, + views: [], }, }; const configFactory = createConfigFactory(); @@ -1371,6 +1533,7 @@ describe('ConfigFactory', function () { }, ], exemplar_filter: ExemplarFilter.TraceBased, + views: [], }, }; const configFactory = createConfigFactory(); @@ -1404,6 +1567,7 @@ describe('ConfigFactory', function () { }, ], exemplar_filter: ExemplarFilter.TraceBased, + views: [], }, }; const configFactory = createConfigFactory(); @@ -1438,6 +1602,7 @@ describe('ConfigFactory', function () { }, ], exemplar_filter: ExemplarFilter.TraceBased, + views: [], }, }; const configFactory = createConfigFactory(); @@ -1470,6 +1635,7 @@ describe('ConfigFactory', function () { }, ], exemplar_filter: ExemplarFilter.TraceBased, + views: [], }, }; const configFactory = createConfigFactory(); @@ -1510,9 +1676,11 @@ describe('ConfigFactory', function () { exporter: { otlp_http: { endpoint: 'http://test.com:4318/v1/logs', - certificate_file: 'certificate_file.txt', - client_key_file: 'certificate_key_value', - client_certificate_file: 'client_certificate_file.txt', + tls: { + ca_file: 'certificate_file.txt', + key_file: 'certificate_key_value', + cert_file: 'client_certificate_file.txt', + }, compression: 'gzip', timeout: 700, headers_list: 'host=localhost', @@ -1522,6 +1690,7 @@ describe('ConfigFactory', function () { }, }, ], + 'logger_configurator/development': {}, }, }; const configFactory = createConfigFactory(); @@ -1545,6 +1714,7 @@ describe('ConfigFactory', function () { }, }, ], + 'logger_configurator/development': {}, }, }; const configFactory = createConfigFactory(); @@ -1589,6 +1759,7 @@ describe('ConfigFactory', function () { }, }, ], + 'logger_configurator/development': {}, }, }; const configFactory = createConfigFactory(); @@ -1623,9 +1794,11 @@ describe('ConfigFactory', function () { otlp_grpc: { endpoint: 'http://localhost:4317', timeout: 10000, - certificate_file: 'log-cert.pem', - client_key_file: 'log-key.pem', - client_certificate_file: 'log-client-cert.pem', + tls: { + ca_file: 'log-cert.pem', + key_file: 'log-key.pem', + cert_file: 'log-client-cert.pem', + }, headers_list: 'host=localhost', compression: 'gzip', }, @@ -1633,6 +1806,7 @@ describe('ConfigFactory', function () { }, }, ], + 'logger_configurator/development': {}, }, }; const configFactory = createConfigFactory(); @@ -1665,6 +1839,7 @@ describe('ConfigFactory', function () { }, }, ], + 'logger_configurator/development': {}, }, }; const configFactory = createConfigFactory(); @@ -1701,9 +1876,11 @@ describe('ConfigFactory', function () { timeout: 12000, compression: 'backup_compression', encoding: OtlpHttpEncoding.Protobuf, - certificate_file: 'backup_certificate_file.pem', - client_certificate_file: 'backup_client_certificate.pem', - client_key_file: 'backup_client_key.pem', + tls: { + ca_file: 'backup_certificate_file.pem', + key_file: 'backup_client_key.pem', + cert_file: 'backup_client_certificate.pem', + }, headers_list: 'backup_headers=123', }, }, @@ -1727,9 +1904,11 @@ describe('ConfigFactory', function () { ExporterTemporalityPreference.Cumulative, default_histogram_aggregation: ExporterDefaultHistogramAggregation.ExplicitBucketHistogram, - certificate_file: 'backup_certificate_file.pem', - client_certificate_file: 'backup_client_certificate.pem', - client_key_file: 'backup_client_key.pem', + tls: { + ca_file: 'backup_certificate_file.pem', + key_file: 'backup_client_key.pem', + cert_file: 'backup_client_certificate.pem', + }, headers_list: 'backup_headers=123', encoding: OtlpHttpEncoding.Protobuf, }, @@ -1737,6 +1916,7 @@ describe('ConfigFactory', function () { }, }, ], + views: [], }, logger_provider: { limits: { @@ -1755,15 +1935,18 @@ describe('ConfigFactory', function () { timeout: 12000, compression: 'backup_compression', encoding: OtlpHttpEncoding.Protobuf, - certificate_file: 'backup_certificate_file.pem', - client_certificate_file: 'backup_client_certificate.pem', - client_key_file: 'backup_client_key.pem', + tls: { + ca_file: 'backup_certificate_file.pem', + key_file: 'backup_client_key.pem', + cert_file: 'backup_client_certificate.pem', + }, headers_list: 'backup_headers=123', }, }, }, }, ], + 'logger_configurator/development': {}, }, }; const configFactory = createConfigFactory(); @@ -1827,6 +2010,7 @@ describe('ConfigFactory', function () { }, }, ], + views: [], }; assert.deepStrictEqual(config.meter_provider, expectedMeterProvider); @@ -1857,6 +2041,7 @@ describe('ConfigFactory', function () { }, }, ], + views: [], }; assert.deepStrictEqual(config.meter_provider, expectedMeterProvider); }); @@ -1865,18 +2050,28 @@ describe('ConfigFactory', function () { describe('get values from config file', function () { it('should initialize config with default values from valid config file', function () { process.env.OTEL_EXPERIMENTAL_CONFIG_FILE = - 'test/fixtures/kitchen-sink.yaml'; + 'test/fixtures/sdk-config.yaml'; const configFactory = createConfigFactory(); assert.deepStrictEqual(configFactory.getConfigModel(), configFromFile); }); + it('should initialize config with default values from longer valid config file', function () { + process.env.OTEL_EXPERIMENTAL_CONFIG_FILE = + 'test/fixtures/kitchen-sink.yaml'; + const configFactory = createConfigFactory(); + assert.deepStrictEqual( + configFactory.getConfigModel(), + configFromKitchenSinkFile + ); + }); + it('should return error from invalid config file', function () { const warnSpy = Sinon.spy(diag, 'warn'); - process.env.OTEL_EXPERIMENTAL_CONFIG_FILE = './fixtures/kitchen-sink.txt'; + process.env.OTEL_EXPERIMENTAL_CONFIG_FILE = './fixtures/invalid.txt'; createConfigFactory(); Sinon.assert.calledWith( warnSpy, - 'Config file ./fixtures/kitchen-sink.txt set on OTEL_EXPERIMENTAL_CONFIG_FILE is not valid' + 'Config file ./fixtures/invalid.txt set on OTEL_EXPERIMENTAL_CONFIG_FILE is not valid' ); }); @@ -1886,7 +2081,7 @@ describe('ConfigFactory', function () { createConfigFactory(); Sinon.assert.calledWith( warnSpy, - 'Unsupported File Format: invalid. It must be one of the following: 1.0-rc.1,1.0-rc.2' + 'Unsupported File Format: invalid. It must be one of the following: 1.0-rc.3' ); }); @@ -1925,13 +2120,14 @@ describe('ConfigFactory', function () { it('should initialize config with config file that contains environment variables', function () { process.env.OTEL_EXPERIMENTAL_CONFIG_FILE = 'test/fixtures/sdk-migration-config.yaml'; + process.env.OTEL_EXPORTER_OTLP_ENDPOINT = 'http://test.com:4318'; process.env.OTEL_SDK_DISABLED = 'false'; process.env.OTEL_LOG_LEVEL = 'debug'; process.env.OTEL_SERVICE_NAME = 'custom-name'; process.env.OTEL_RESOURCE_ATTRIBUTES = 'att=1'; process.env.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT = '23'; process.env.OTEL_ATTRIBUTE_COUNT_LIMIT = '7'; - process.env.OTEL_PROPAGATORS = 'prop'; + process.env.OTEL_PROPAGATORS = 'b3multi'; process.env.OTEL_BSP_SCHEDULE_DELAY = '123'; process.env.OTEL_BSP_EXPORT_TIMEOUT = '456'; process.env.OTEL_BSP_MAX_QUEUE_SIZE = '789'; @@ -1954,7 +2150,7 @@ describe('ConfigFactory', function () { process.env.OTEL_METRIC_EXPORT_INTERVAL = '20'; process.env.OTEL_METRIC_EXPORT_TIMEOUT = '21'; process.env.OTEL_EXPORTER_OTLP_METRICS_ENDPOINT = - 'http://test:4318/v1/metrics'; + 'http://test.com:4318/v1/metrics'; process.env.OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE = 'metric-certificate'; process.env.OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY = 'metric-client-key'; process.env.OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE = @@ -2005,8 +2201,8 @@ describe('ConfigFactory', function () { attribute_value_length_limit: 23, }, propagator: { - composite: [{ prop: null }], - composite_list: 'prop', + composite: [{ b3multi: null }], + composite_list: 'b3multi', }, tracer_provider: { ...defaultConfigFromFileWithEnvVariables.tracer_provider, @@ -2027,9 +2223,11 @@ describe('ConfigFactory', function () { schedule_delay: 123, exporter: { otlp_http: { - certificate_file: 'trace-certificate', - client_certificate_file: 'trace-client-certificate', - client_key_file: 'trace-client-key', + tls: { + ca_file: 'trace-certificate', + key_file: 'trace-client-key', + cert_file: 'trace-client-certificate', + }, compression: 'trace-compression', encoding: OtlpHttpEncoding.Protobuf, endpoint: 'http://test.com:4318/v1/traces', @@ -2050,15 +2248,17 @@ describe('ConfigFactory', function () { timeout: 21, exporter: { otlp_http: { - endpoint: 'http://test:4318/v1/metrics', + endpoint: 'http://test.com:4318/v1/metrics', timeout: 22, temporality_preference: ExporterTemporalityPreference.Cumulative, default_histogram_aggregation: ExporterDefaultHistogramAggregation.ExplicitBucketHistogram, - certificate_file: 'metric-certificate', - client_certificate_file: 'metric-client-certificate', - client_key_file: 'metric-client-key', + tls: { + ca_file: 'metric-certificate', + key_file: 'metric-client-key', + cert_file: 'metric-client-certificate', + }, compression: 'metric-compression', encoding: OtlpHttpEncoding.Protobuf, headers_list: 'metric-header', @@ -2077,6 +2277,7 @@ describe('ConfigFactory', function () { }, }, ], + views: [], }, logger_provider: { ...defaultConfigFromFileWithEnvVariables.logger_provider, @@ -2093,9 +2294,11 @@ describe('ConfigFactory', function () { schedule_delay: 23, exporter: { otlp_http: { - certificate_file: 'logs-certificate', - client_certificate_file: 'logs-client-certificate', - client_key_file: 'logs-client-key', + tls: { + ca_file: 'logs-certificate', + key_file: 'logs-client-key', + cert_file: 'logs-client-certificate', + }, compression: 'logs-compression', encoding: OtlpHttpEncoding.Protobuf, endpoint: 'http://test.com:4318/v1/logs', @@ -2220,7 +2423,39 @@ describe('ConfigFactory', function () { let config = {}; parseConfigFile(config); - assert.deepStrictEqual(config, { resource: {} }); + assert.deepStrictEqual(config, { + resource: {}, + propagator: { + composite: [{ tracecontext: null }], + composite_list: 'tracecontext', + }, + logger_provider: { + limits: { + attribute_count_limit: 128, + }, + processors: [ + { + simple: { + exporter: { + console: {}, + }, + }, + }, + ], + 'logger_configurator/development': { + loggers: [ + { + config: { + enabled: false, + minimum_severity: 'info', + trace_based: true, + }, + name: 'io.opentelemetry.contrib.*', + }, + ], + }, + }, + }); config = {}; setResourceAttributes(config, [], ''); @@ -2457,6 +2692,104 @@ describe('ConfigFactory', function () { ], }, }); + + assert.deepStrictEqual( + getSeverity(SeverityNumber.DEBUG), + SeverityNumber.DEBUG + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.DEBUG2), + SeverityNumber.DEBUG2 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.DEBUG3), + SeverityNumber.DEBUG3 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.DEBUG4), + SeverityNumber.DEBUG4 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.INFO), + SeverityNumber.INFO + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.INFO2), + SeverityNumber.INFO2 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.INFO3), + SeverityNumber.INFO3 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.INFO4), + SeverityNumber.INFO4 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.WARN), + SeverityNumber.WARN + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.WARN2), + SeverityNumber.WARN2 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.WARN3), + SeverityNumber.WARN3 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.WARN4), + SeverityNumber.WARN4 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.ERROR), + SeverityNumber.ERROR + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.ERROR2), + SeverityNumber.ERROR2 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.ERROR3), + SeverityNumber.ERROR3 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.ERROR4), + SeverityNumber.ERROR4 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.FATAL), + SeverityNumber.FATAL + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.FATAL2), + SeverityNumber.FATAL2 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.FATAL3), + SeverityNumber.FATAL3 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.FATAL4), + SeverityNumber.FATAL4 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.TRACE), + SeverityNumber.TRACE + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.TRACE2), + SeverityNumber.TRACE2 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.TRACE3), + SeverityNumber.TRACE3 + ); + assert.deepStrictEqual( + getSeverity(SeverityNumber.TRACE4), + SeverityNumber.TRACE4 + ); + assert.deepStrictEqual(getSeverity(undefined), undefined); }); }); }); diff --git a/experimental/packages/configuration/test/fixtures/invalid-providers.yaml b/experimental/packages/configuration/test/fixtures/invalid-providers.yaml index cbd48b27ac7..dbc0b7d9fbb 100644 --- a/experimental/packages/configuration/test/fixtures/invalid-providers.yaml +++ b/experimental/packages/configuration/test/fixtures/invalid-providers.yaml @@ -1,4 +1,4 @@ -file_format: "1.0-rc.1" +file_format: "1.0-rc.3" tracer_provider: processors: [] meter_provider: diff --git a/experimental/packages/configuration/test/fixtures/kitchen-sink.yaml b/experimental/packages/configuration/test/fixtures/kitchen-sink.yaml index f44e11628dd..837d614cd32 100644 --- a/experimental/packages/configuration/test/fixtures/kitchen-sink.yaml +++ b/experimental/packages/configuration/test/fixtures/kitchen-sink.yaml @@ -1,484 +1,252 @@ -# kitchen-sink.yaml demonstrates all configurable surface area, including explanatory comments. +# kitchen-sink.yaml demonstrates all configurable surface area. # # It DOES NOT represent expected real world configuration, as it makes strange configuration # choices in an effort to exercise the full surface area. # # Configuration values are set to their defaults when default values are defined. - -# The file format version. -# The yaml format is documented at -# https://github.com/open-telemetry/opentelemetry-configuration/tree/main/schema -file_format: "1.0-rc.2" -# Configure if the SDK is disabled or not. -# If omitted or null, false is used. +# +# For schema documentation, including required properties, semantics, default behavior, etc, +# see: https://github.com/open-telemetry/opentelemetry-configuration/blob/main/schema-docs.md +file_format: "1.0-rc.3" disabled: false -# Configure the log level of the internal logger used by the SDK. -# If omitted, info is used. log_level: info -# Configure general attribute limits. See also tracer_provider.limits, logger_provider.limits. attribute_limits: - # Configure max attribute value size. - # Value must be non-negative. - # If omitted or null, there is no limit. attribute_value_length_limit: 4096 - # Configure max attribute count. - # Value must be non-negative. - # If omitted or null, 128 is used. attribute_count_limit: 128 -# Configure logger provider. -# If omitted, a noop logger provider is used. logger_provider: - # Configure log record processors. processors: - - # Configure a batch log record processor. - batch: - # Configure delay interval (in milliseconds) between two consecutive exports. - # Value must be non-negative. - # If omitted or null, 1000 is used. + - batch: schedule_delay: 5000 - # Configure maximum allowed time (in milliseconds) to export data. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 30000 is used. export_timeout: 30000 - # Configure maximum queue size. Value must be positive. - # If omitted or null, 2048 is used. max_queue_size: 2048 - # Configure maximum batch size. Value must be positive. - # If omitted or null, 512 is used. max_export_batch_size: 512 - # Configure exporter. exporter: - # Configure exporter to be OTLP with HTTP transport. otlp_http: endpoint: http://localhost:4318/v1/logs - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: /app/cert.pem - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: /app/cert.pem - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: /app/cert.pem - # Configure headers. Entries have higher priority than entries from .headers_list. - # If an entry's .value is null, the entry is ignored. + tls: + ca_file: /app/cert.pem + key_file: /app/cert.pem + cert_file: /app/cert.pem headers: - name: api-key value: "1234" - # Configure headers. Entries have lower priority than entries from .headers. - # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. - # If omitted or null, no headers are added. headers_list: "api-key=1234" - # Configure compression. - # Values include: gzip, none. Implementations may support other compression algorithms. - # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 10000 is used. timeout: 10000 - # Configure the encoding used for messages. - # Values include: protobuf, json. Implementations may not support json. - # If omitted or null, protobuf is used. encoding: protobuf - - # Configure a batch log record processor. - batch: - # Configure exporter. + - batch: exporter: - # Configure exporter to be OTLP with gRPC transport. otlp_grpc: - # Configure endpoint. - # If omitted or null, http://localhost:4317 is used. endpoint: http://localhost:4317 - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: /app/cert.pem - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: /app/cert.pem - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: /app/cert.pem - # Configure headers. Entries have higher priority than entries from .headers_list. - # If an entry's .value is null, the entry is ignored. + tls: + ca_file: /app/cert.pem + key_file: /app/cert.pem + cert_file: /app/cert.pem + insecure: false headers: - name: api-key value: "1234" - # Configure headers. Entries have lower priority than entries from .headers. - # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. - # If omitted or null, no headers are added. headers_list: "api-key=1234" - # Configure compression. - # Values include: gzip, none. Implementations may support other compression algorithms. - # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 10000 is used. timeout: 10000 - # Configure client transport security for the exporter's connection. - # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. - # If omitted or null, false is used. - insecure: false - - # Configure a batch log record processor. - batch: - # Configure exporter. + - batch: exporter: - # Configure exporter to be OTLP with file transport. - # This type is in development and subject to breaking changes in minor versions. otlp_file/development: - # Configure output stream. - # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. - # If omitted or null, stdout is used. output_stream: file:///var/log/logs.jsonl - - # Configure a batch log record processor. - batch: - # Configure exporter. + - batch: exporter: - # Configure exporter to be OTLP with file transport. - # This type is in development and subject to breaking changes in minor versions. otlp_file/development: - # Configure output stream. - # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. - # If omitted or null, stdout is used. output_stream: stdout - - # Configure a simple log record processor. - simple: - # Configure exporter. + - simple: exporter: - # Configure exporter to be console. console: - # Configure log record limits. See also attribute_limits. limits: - # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. - # Value must be non-negative. - # If omitted or null, there is no limit. attribute_value_length_limit: 4096 - # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. - # Value must be non-negative. - # If omitted or null, 128 is used. attribute_count_limit: 128 - # Configure loggers. - # This type is in development and subject to breaking changes in minor versions. logger_configurator/development: - # Configure the default logger config used there is no matching entry in .logger_configurator/development.loggers. default_config: - # Configure if the logger is enabled or not. - disabled: true - # Configure loggers. + enabled: true loggers: - - # Configure logger names to match, evaluated as follows: - # - # * If the logger name exactly matches. - # * If the logger name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none. - name: io.opentelemetry.contrib.* - # The logger config. + - name: io.opentelemetry.contrib.* config: - # Configure if the logger is enabled or not. - disabled: false -# Configure meter provider. -# If omitted, a noop meter provider is used. + enabled: false + minimum_severity: info + trace_based: true meter_provider: - # Configure metric readers. readers: - - # Configure a pull based metric reader. - pull: - # Configure exporter. + - pull: exporter: - # Configure exporter to be prometheus. - # This type is in development and subject to breaking changes in minor versions. prometheus/development: - # Configure host. - # If omitted or null, localhost is used. host: localhost - # Configure port. - # If omitted or null, 9464 is used. port: 9464 - # Configure Prometheus Exporter to produce metrics without a scope info metric. - # If omitted or null, false is used. without_scope_info: false - # Configure Prometheus Exporter to add resource attributes as metrics attributes. + without_target_info: false with_resource_constant_labels: - # Configure resource attributes to be included. - # Attribute keys from resources are evaluated to match as follows: - # * If the value of the attribute key exactly matches. - # * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none. - # If omitted, no resource attributes are included. included: - "service*" - # Configure resource attributes to be excluded. Applies after .with_resource_constant_labels.included (i.e. excluded has higher priority than included). - # Attribute keys from resources are evaluated to match as follows: - # * If the value of the attribute key exactly matches. - # * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none. - # If omitted, .included resource attributes are included. excluded: - "service.attr1" - # Configure how Prometheus metrics are exposed. Values include: - # - # * UnderscoreEscapingWithSuffixes, the default. This fully escapes metric names for classic Prometheus metric name compatibility, and includes appending type and unit suffixes. - # * UnderscoreEscapingWithoutSuffixes, metric names will continue to escape special characters to _, but suffixes won't be attached. - # * NoUTF8EscapingWithSuffixes will disable changing special characters to _. Special suffixes like units and _total for counters will be attached. - # * NoTranslation. This strategy bypasses all metric and label name translation, passing them through unaltered. - # - # If omitted or null, UnderscoreEscapingWithSuffixes is used. - translation_strategy: UnderscoreEscapingWithSuffixes - # Configure metric producers. + translation_strategy: underscore_escaping_with_suffixes producers: - - # Configure metric producer to be opencensus. - opencensus: - # Configure cardinality limits. + - opencensus: cardinality_limits: - # Configure default cardinality limit for all instrument types. - # Instrument-specific cardinality limits take priority. - # If omitted or null, 2000 is used. default: 2000 - # Configure default cardinality limit for counter instruments. - # If omitted or null, the value from .default is used. counter: 2000 - # Configure default cardinality limit for gauge instruments. - # If omitted or null, the value from .default is used. gauge: 2000 - # Configure default cardinality limit for histogram instruments. - # If omitted or null, the value from .default is used. histogram: 2000 - # Configure default cardinality limit for observable_counter instruments. - # If omitted or null, the value from .default is used. observable_counter: 2000 - # Configure default cardinality limit for observable_gauge instruments. - # If omitted or null, the value from .default is used. observable_gauge: 2000 - # Configure default cardinality limit for observable_up_down_counter instruments. - # If omitted or null, the value from .default is used. observable_up_down_counter: 2000 - # Configure default cardinality limit for up_down_counter instruments. - # If omitted or null, the value from .default is used. up_down_counter: 2000 - - # Configure a periodic metric reader. - periodic: - # Configure delay interval (in milliseconds) between start of two consecutive exports. - # Value must be non-negative. - # If omitted or null, 60000 is used. + - pull: + exporter: + prometheus/development: + host: localhost + port: 9464 + without_scope_info: false + without_target_info: false + with_resource_constant_labels: + included: + - "service*" + excluded: + - "service.attr1" + translation_strategy: underscore_escaping_without_suffixes + producers: + - opencensus: + cardinality_limits: + default: 2000 + counter: 2000 + gauge: 2000 + histogram: 2000 + observable_counter: 2000 + observable_gauge: 2000 + observable_up_down_counter: 2000 + up_down_counter: 2000 + - pull: + exporter: + prometheus/development: + host: localhost + port: 9464 + without_scope_info: false + without_target_info: false + with_resource_constant_labels: + included: + - "service*" + excluded: + - "service.attr1" + translation_strategy: no_utf8_escaping_with_suffixes + producers: + - opencensus: + cardinality_limits: + default: 2000 + counter: 2000 + gauge: 2000 + histogram: 2000 + observable_counter: 2000 + observable_gauge: 2000 + observable_up_down_counter: 2000 + up_down_counter: 2000 + - pull: + exporter: + prometheus/development: + host: localhost + port: 9464 + without_scope_info: false + without_target_info: false + with_resource_constant_labels: + included: + - "service*" + excluded: + - "service.attr1" + translation_strategy: no_translation + producers: + - opencensus: + cardinality_limits: + default: 2000 + counter: 2000 + gauge: 2000 + histogram: 2000 + observable_counter: 2000 + observable_gauge: 2000 + observable_up_down_counter: 2000 + up_down_counter: 2000 + - periodic: interval: 60000 - # Configure maximum allowed time (in milliseconds) to export data. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 30000 is used. timeout: 30000 - # Configure exporter. exporter: - # Configure exporter to be OTLP with HTTP transport. otlp_http: - # Configure endpoint, including the metric specific path. - # If omitted or null, http://localhost:4318/v1/metrics is used. endpoint: http://localhost:4318/v1/metrics - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: /app/cert.pem - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: /app/cert.pem - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: /app/cert.pem - # Configure headers. Entries have higher priority than entries from .headers_list. - # If an entry's .value is null, the entry is ignored. + tls: + ca_file: /app/cert.pem + key_file: /app/cert.pem + cert_file: /app/cert.pem headers: - name: api-key value: "1234" - # Configure headers. Entries have lower priority than entries from .headers. - # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. - # If omitted or null, no headers are added. headers_list: "api-key=1234" - # Configure compression. - # Values include: gzip, none. Implementations may support other compression algorithms. - # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 10000 is used. timeout: 10000 - # Configure the encoding used for messages. - # Values include: protobuf, json. Implementations may not support json. - # If omitted or null, protobuf is used. encoding: protobuf - # Configure temporality preference. - # Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. - # If omitted or null, cumulative is used. temporality_preference: delta - # Configure default histogram aggregation. - # Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. - # If omitted or null, explicit_bucket_histogram is used. default_histogram_aggregation: base2_exponential_bucket_histogram - # Configure metric producers. producers: - - # Configure metric producer to be prometheus. - prometheus: - # Configure cardinality limits. + - opencensus: cardinality_limits: - # Configure default cardinality limit for all instrument types. - # Instrument-specific cardinality limits take priority. - # If omitted or null, 2000 is used. default: 2000 - # Configure default cardinality limit for counter instruments. - # If omitted or null, the value from .default is used. counter: 2000 - # Configure default cardinality limit for gauge instruments. - # If omitted or null, the value from .default is used. gauge: 2000 - # Configure default cardinality limit for histogram instruments. - # If omitted or null, the value from .default is used. histogram: 2000 - # Configure default cardinality limit for observable_counter instruments. - # If omitted or null, the value from .default is used. observable_counter: 2000 - # Configure default cardinality limit for observable_gauge instruments. - # If omitted or null, the value from .default is used. observable_gauge: 2000 - # Configure default cardinality limit for observable_up_down_counter instruments. - # If omitted or null, the value from .default is used. observable_up_down_counter: 2000 - # Configure default cardinality limit for up_down_counter instruments. - # If omitted or null, the value from .default is used. up_down_counter: 2000 - - # Configure a periodic metric reader. - periodic: - # Configure exporter. + - periodic: exporter: - # Configure exporter to be OTLP with gRPC transport. otlp_grpc: - # Configure endpoint. - # If omitted or null, http://localhost:4317 is used. endpoint: http://localhost:4317 - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: /app/cert.pem - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: /app/cert.pem - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: /app/cert.pem - # Configure headers. Entries have higher priority than entries from .headers_list. - # If an entry's .value is null, the entry is ignored. + tls: + ca_file: /app/cert.pem + key_file: /app/cert.pem + cert_file: /app/cert.pem + insecure: false headers: - name: api-key value: "1234" - # Configure headers. Entries have lower priority than entries from .headers. - # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. - # If omitted or null, no headers are added. headers_list: "api-key=1234" - # Configure compression. - # Values include: gzip, none. Implementations may support other compression algorithms. - # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 10000 is used. timeout: 10000 - # Configure client transport security for the exporter's connection. - # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. - # If omitted or null, false is used. - insecure: false - # Configure temporality preference. - # Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. - # If omitted or null, cumulative is used. temporality_preference: delta - # Configure default histogram aggregation. - # Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. - # If omitted or null, explicit_bucket_histogram is used. default_histogram_aggregation: base2_exponential_bucket_histogram - - # Configure a periodic metric reader. - periodic: - # Configure exporter. + - periodic: exporter: - # Configure exporter to be OTLP with file transport. - # This type is in development and subject to breaking changes in minor versions. otlp_file/development: - # Configure output stream. - # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. - # If omitted or null, stdout is used. output_stream: file:///var/log/metrics.jsonl - # Configure temporality preference. Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. - # If omitted or null, cumulative is used. temporality_preference: delta - # Configure default histogram aggregation. Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. - # If omitted or null, explicit_bucket_histogram is used. default_histogram_aggregation: base2_exponential_bucket_histogram - - # Configure a periodic metric reader. - periodic: - # Configure exporter. + - periodic: exporter: - # Configure exporter to be OTLP with file transport. - # This type is in development and subject to breaking changes in minor versions. otlp_file/development: - # Configure output stream. - # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. - # If omitted or null, stdout is used. output_stream: stdout - # Configure temporality preference. Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. - # If omitted or null, cumulative is used. temporality_preference: delta - # Configure default histogram aggregation. Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. - # If omitted or null, explicit_bucket_histogram is used. default_histogram_aggregation: base2_exponential_bucket_histogram - - # Configure a periodic metric reader. - periodic: - # Configure exporter. + - periodic: exporter: - # Configure exporter to be console. console: - # Configure views. - # Each view has a selector which determines the instrument(s) it applies to, and a configuration for the resulting stream(s). + temporality_preference: delta + default_histogram_aggregation: base2_exponential_bucket_histogram views: - - # Configure view selector. - # Selection criteria is additive as described in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#instrument-selection-criteria. - selector: - # Configure instrument name selection criteria. - # If omitted or null, all instrument names match. + - selector: instrument_name: my-instrument - # Configure instrument type selection criteria. - # Values include: counter, gauge, histogram, observable_counter, observable_gauge, observable_up_down_counter, up_down_counter. - # If omitted or null, all instrument types match. instrument_type: histogram - # Configure the instrument unit selection criteria. - # If omitted or null, all instrument units match. unit: ms - # Configure meter name selection criteria. - # If omitted or null, all meter names match. meter_name: my-meter - # Configure meter version selection criteria. - # If omitted or null, all meter versions match. meter_version: 1.0.0 - # Configure meter schema url selection criteria. - # If omitted or null, all meter schema URLs match. meter_schema_url: https://opentelemetry.io/schemas/1.16.0 - # Configure view stream. stream: - # Configure metric name of the resulting stream(s). - # If omitted or null, the instrument's original name is used. name: new_instrument_name - # Configure metric description of the resulting stream(s). - # If omitted or null, the instrument's origin description is used. description: new_description - # Configure aggregation of the resulting stream(s). - # Values include: default, drop, explicit_bucket_histogram, base2_exponential_bucket_histogram, last_value, sum. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#aggregation. - # If omitted, default is used. aggregation: - # Configure aggregation to be explicit_bucket_histogram. explicit_bucket_histogram: - # Configure bucket boundaries. - # If omitted, [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000] is used. boundaries: [ 0.0, @@ -497,296 +265,133 @@ meter_provider: 7500.0, 10000.0 ] - # Configure record min and max. - # If omitted or null, true is used. record_min_max: true - # Configure the aggregation cardinality limit. - # If omitted or null, the metric reader's default cardinality limit is used. aggregation_cardinality_limit: 2000 - # Configure attribute keys retained in the resulting stream(s). attribute_keys: - # Configure list of attribute keys to include in the resulting stream(s). All other attributes are dropped. - # If omitted, all attributes are included. included: - key1 - key2 - # Configure list of attribute keys to exclude from the resulting stream(s). Applies after .attribute_keys.included (i.e. excluded has higher priority than included). - # If omitted, .attribute_keys.included are included. excluded: - key3 - # Configure the exemplar filter. - # Values include: trace_based, always_on, always_off. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration. - # If omitted or null, trace_based is used. exemplar_filter: trace_based - # Configure meters. - # This type is in development and subject to breaking changes in minor versions. - meter_configurator/development: - # Configure the default meter config used there is no matching entry in .meter_configurator/development.meters. - default_config: - # Configure if the meter is enabled or not. - disabled: true - # Configure meters. - meters: - - # Configure meter names to match, evaluated as follows: - # - # * If the meter name exactly matches. - # * If the meter name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none. - name: io.opentelemetry.contrib.* - # The meter config. - config: - # Configure if the meter is enabled or not. - disabled: false -# Configure text map context propagators. -# If omitted, a noop propagator is used. propagator: - # Configure the propagators in the composite text map propagator. Entries from .composite_list are appended to the list here with duplicates filtered out. - # Built-in propagator keys include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party keys include: xray. - # If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used. composite: - - # Include the w3c trace context propagator. - tracecontext: - - # Include the w3c baggage propagator. - baggage: - - # Include the zipkin b3 propagator. - b3: - - # Include the zipkin b3 multi propagator. - b3multi: - - # Include the jaeger propagator. - jaeger: - - # Include the opentracing propagator. - ottrace: - # Configure the propagators in the composite text map propagator. Entries are appended to .composite with duplicates filtered out. - # 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. - # Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party identifiers include: xray. - # If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used. + - tracecontext: + - baggage: + - b3: + - b3multi: + - jaeger: + - ottrace: composite_list: "tracecontext,baggage,b3,b3multi,jaeger,ottrace,xray" -# Configure tracer provider. -# If omitted, a noop tracer provider is used. tracer_provider: - # Configure span processors. processors: - - # Configure a batch span processor. - batch: - # Configure delay interval (in milliseconds) between two consecutive exports. - # Value must be non-negative. - # If omitted or null, 5000 is used. + - batch: schedule_delay: 5000 - # Configure maximum allowed time (in milliseconds) to export data. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 30000 is used. export_timeout: 30000 - # Configure maximum queue size. Value must be positive. - # If omitted or null, 2048 is used. max_queue_size: 2048 - # Configure maximum batch size. Value must be positive. - # If omitted or null, 512 is used. max_export_batch_size: 512 - # Configure exporter. exporter: - # Configure exporter to be OTLP with HTTP transport. otlp_http: - # Configure endpoint, including the trace specific path. - # If omitted or null, http://localhost:4318/v1/traces is used. endpoint: http://localhost:4318/v1/traces - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: /app/cert.pem - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: /app/cert.pem - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: /app/cert.pem - # Configure headers. Entries have higher priority than entries from .headers_list. - # If an entry's .value is null, the entry is ignored. + tls: + ca_file: /app/cert.pem + key_file: /app/cert.pem + cert_file: /app/cert.pem headers: - name: api-key value: "1234" - # Configure headers. Entries have lower priority than entries from .headers. - # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. - # If omitted or null, no headers are added. headers_list: "api-key=1234" - # Configure compression. - # Values include: gzip, none. Implementations may support other compression algorithms. - # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 10000 is used. timeout: 10000 - # Configure the encoding used for messages. - # Values include: protobuf, json. Implementations may not support json. - # If omitted or null, protobuf is used. encoding: protobuf - - # Configure a batch span processor. - batch: - # Configure exporter. + - batch: exporter: - # Configure exporter to be OTLP with gRPC transport. otlp_grpc: - # Configure endpoint. - # If omitted or null, http://localhost:4317 is used. endpoint: http://localhost:4317 - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: /app/cert.pem - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: /app/cert.pem - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: /app/cert.pem - # Configure headers. Entries have higher priority than entries from .headers_list. - # If an entry's .value is null, the entry is ignored. + tls: + ca_file: /app/cert.pem + key_file: /app/cert.pem + cert_file: /app/cert.pem + insecure: false headers: - name: api-key value: "1234" - # Configure headers. Entries have lower priority than entries from .headers. - # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. - # If omitted or null, no headers are added. headers_list: "api-key=1234" - # Configure compression. - # Values include: gzip, none. Implementations may support other compression algorithms. - # If omitted or null, none is used. compression: gzip - # Configure max time (in milliseconds) to wait for each export. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 10000 is used. timeout: 10000 - # Configure client transport security for the exporter's connection. - # Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure. - # If omitted or null, false is used. - insecure: false - - # Configure a batch span processor. - batch: - # Configure exporter. + - batch: exporter: - # Configure exporter to be OTLP with file transport. - # This type is in development and subject to breaking changes in minor versions. otlp_file/development: - # Configure output stream. - # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. - # If omitted or null, stdout is used. output_stream: file:///var/log/traces.jsonl - - # Configure a batch span processor. - batch: - # Configure exporter. + - batch: exporter: - # Configure exporter to be OTLP with file transport. - # This type is in development and subject to breaking changes in minor versions. otlp_file/development: - # Configure output stream. - # Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl. - # If omitted or null, stdout is used. output_stream: stdout - - # Configure a batch span processor. - batch: - # Configure exporter. - exporter: - # Configure exporter to be zipkin. - zipkin: - # Configure endpoint. - # If omitted or null, http://localhost:9411/api/v2/spans is used. - endpoint: http://localhost:9411/api/v2/spans - # Configure max time (in milliseconds) to wait for each export. - # Value must be non-negative. A value of 0 indicates indefinite. - # If omitted or null, 10000 is used. - timeout: 10000 - - # Configure a simple span processor. - simple: - # Configure exporter. + - simple: exporter: - # Configure exporter to be console. console: - # Configure span limits. See also attribute_limits. limits: - # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. - # Value must be non-negative. - # If omitted or null, there is no limit. attribute_value_length_limit: 4096 - # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. - # Value must be non-negative. - # If omitted or null, 128 is used. attribute_count_limit: 128 - # Configure max span event count. - # Value must be non-negative. - # If omitted or null, 128 is used. event_count_limit: 128 - # Configure max span link count. - # Value must be non-negative. - # If omitted or null, 128 is used. link_count_limit: 128 - # Configure max attributes per span event. - # Value must be non-negative. - # If omitted or null, 128 is used. event_attribute_count_limit: 128 - # Configure max attributes per span link. - # Value must be non-negative. - # If omitted or null, 128 is used. link_attribute_count_limit: 128 - # Configure the sampler. - # If omitted, parent based sampler with a root of always_on is used. sampler: - # Configure sampler to be parent_based. parent_based: - # Configure root sampler. - # If omitted or null, always_on is used. root: - # Configure sampler to be trace_id_ratio_based. - trace_id_ratio_based: - # Configure trace_id_ratio. - # If omitted or null, 1.0 is used. - ratio: 0.0001 - # Configure remote_parent_sampled sampler. - # If omitted or null, always_on is used. + always_on: remote_parent_sampled: - # Configure sampler to be always_on. always_on: - # Configure remote_parent_not_sampled sampler. - # If omitted or null, always_off is used. remote_parent_not_sampled: - # Configure sampler to be always_off. - always_off: - # Configure local_parent_sampled sampler. - # If omitted or null, always_on is used. + probability/development: + ratio: 0.01 local_parent_sampled: - # Configure sampler to be always_on. - always_on: + composite/development: + # Configure sampler to be rule_based. + rule_based: + # The rules for the sampler, matched in order. Each rule can have multiple match conditions - the sampler will be applied if all match. + # If no conditions are specified, the rule matches all spans that reach it. If no rules match, the span is not sampled. + rules: + - attribute_values: + key: http.route + values: + - /healthz + - /livez + # Configure sampler when matched. + sampler: + # Configure sampler to be always_off if matched. + always_off: + # Configure a sampling rule matching http.path attribute patterns. + - attribute_patterns: + key: http.path + included: + - /internal/* + excluded: + - /internal/special/* + # Configure sampler when matched. + sampler: + # Configure sampler to be always_on if matched. + always_on: + # Configure a sampling rule matching root spans with CLIENT span kind. + - parent: + - none + span_kinds: + - client + sampler: + # Configure sampler to be probability if matched. + probability: + ratio: 0.05 + - sampler: + probability: + # Configure ratio. + # If omitted or null, 1.0 is used. + ratio: 0.001 # Configure local_parent_not_sampled sampler. # If omitted or null, always_off is used. local_parent_not_sampled: - # Configure sampler to be always_off. always_off: - # Configure tracers. - # This type is in development and subject to breaking changes in minor versions. - tracer_configurator/development: - # Configure the default tracer config used there is no matching entry in .tracer_configurator/development.tracers. - default_config: - # Configure if the tracer is enabled or not. - disabled: true - # Configure tracers. - tracers: - - # Configure tracer names to match, evaluated as follows: - # - # * If the tracer name exactly matches. - # * If the tracer name matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none. - name: io.opentelemetry.contrib.* - # The tracer config. - config: - # Configure if the tracer is enabled or not. - disabled: false -# Configure resource for all signals. -# If omitted, the default resource is used. resource: - # Configure resource attributes. Entries have higher priority than entries from .resource.attributes_list. - # Entries must contain .name and .value, and may optionally include .type. If an entry's .type omitted or null, string is used. - # The .value's type must match the .type. Values for .type include: string, bool, int, double, string_array, bool_array, int_array, double_array. attributes: - name: service.name value: unknown_service @@ -814,137 +419,16 @@ resource: - name: double_array_key value: [ 1.1, 2.2 ] type: double_array - # Configure resource attributes. Entries have lower priority than entries from .resource.attributes. - # 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. - # If omitted or null, no resource attributes are added. attributes_list: "service.namespace=my-namespace,service.version=1.0.0" - # Configure resource detection. - # This type is in development and subject to breaking changes in minor versions. - # If omitted or null, resource detection is disabled. detection/development: - # Configure attributes provided by resource detectors. attributes: - # Configure list of attribute key patterns to include from resource detectors. - # Attribute keys from resource detectors are evaluated to match as follows: - # * If the value of the attribute key exactly matches. - # * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none. - # If omitted, all attributes are included. included: - process.* - # Configure list of attribute key patterns to exclude from resource detectors. Applies after .resource.detectors.attributes.included (i.e. excluded has higher priority than included). - # Attribute keys from resource detectors are evaluated to match as follows: - # * If the value of the attribute key exactly matches. - # * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none. - # If omitted, .included attributes are included. excluded: - process.command_args - # Configure resource detectors. - # Resource detector names are dependent on the SDK language ecosystem. Please consult documentation for each respective language. - # If omitted or null, no resource detectors are enabled. detectors: - - # Enable the container resource detector, which populates container.* attributes. - container: - - # Enable the host resource detector, which populates host.* and os.* attributes. - host: - - # Enable the process resource detector, which populates process.* attributes. - process: - - # Enable the service detector, which populates service.name based on the OTEL_SERVICE_NAME environment variable and service.instance.id. - service: - # Configure resource schema URL. - # If omitted or null, no schema URL is used. - schema_url: https://opentelemetry.io/schemas/1.16.0 -# Configure instrumentation. -# This type is in development and subject to breaking changes in minor versions. -instrumentation/development: - # Configure general SemConv options that may apply to multiple languages and instrumentations. - # Instrumenation may merge general config options with the language specific configuration at .instrumentation.. - general: - # Configure instrumentations following the peer semantic conventions. - # See peer semantic conventions: https://opentelemetry.io/docs/specs/semconv/attributes-registry/peer/ - peer: - # Configure the service mapping for instrumentations following peer.service semantic conventions. - # Each entry is a key value pair where "peer" defines the IP address and "service" defines the corresponding logical name of the service. - # See peer.service semantic conventions: https://opentelemetry.io/docs/specs/semconv/general/attributes/#general-remote-service-attributes - service_mapping: - - peer: 1.2.3.4 - service: FooService - - peer: 2.3.4.5 - service: BarService - # Configure instrumentations following the http semantic conventions. - # See http semantic conventions: https://opentelemetry.io/docs/specs/semconv/http/ - http: - # Configure instrumentations following the http client semantic conventions. - client: - # Configure headers to capture for outbound http requests. - request_captured_headers: - - Content-Type - - Accept - # Configure headers to capture for outbound http responses. - response_captured_headers: - - Content-Type - - Content-Encoding - # Configure instrumentations following the http server semantic conventions. - server: - # Configure headers to capture for inbound http requests. - request_captured_headers: - - Content-Type - - Accept - # Configure headers to capture for outbound http responses. - response_captured_headers: - - Content-Type - - Content-Encoding - # Configure C++ language-specific instrumentation libraries. - cpp: - # Configure the instrumentation corresponding to key "example". - example: - property: "value" - # Configure .NET language-specific instrumentation libraries. - dotnet: - # Configure the instrumentation corresponding to key "example". - example: - property: "value" - # Configure Erlang language-specific instrumentation libraries. - erlang: - # Configure the instrumentation corresponding to key "example". - example: - property: "value" - # Configure Go language-specific instrumentation libraries. - go: - # Configure the instrumentation corresponding to key "example". - example: - property: "value" - # Configure Java language-specific instrumentation libraries. - java: - # Configure the instrumentation corresponding to key "example". - example: - property: "value" - # Configure JavaScript language-specific instrumentation libraries. - js: - # Configure the instrumentation corresponding to key "example". - example: - property: "value" - # Configure PHP language-specific instrumentation libraries. - php: - # Configure the instrumentation corresponding to key "example". - example: - property: "value" - # Configure Python language-specific instrumentation libraries. - python: - # Configure the instrumentation corresponding to key "example". - example: - property: "value" - # Configure Ruby language-specific instrumentation libraries. - ruby: - # Configure the instrumentation corresponding to key "example". - example: - property: "value" - # Configure Rust language-specific instrumentation libraries. - rust: - # Configure the instrumentation corresponding to key "example". - example: - property: "value" - # Configure Swift language-specific instrumentation libraries. - swift: - # Configure the instrumentation corresponding to key "example". - example: - property: "value" \ No newline at end of file + - container: + - host: + - process: + - service: + schema_url: https://opentelemetry.io/schemas/1.16.0 \ No newline at end of file diff --git a/experimental/packages/configuration/test/fixtures/resources.yaml b/experimental/packages/configuration/test/fixtures/resources.yaml index 5d8ec1943e9..c25718b9170 100644 --- a/experimental/packages/configuration/test/fixtures/resources.yaml +++ b/experimental/packages/configuration/test/fixtures/resources.yaml @@ -1,4 +1,4 @@ -file_format: "1.0-rc.2" +file_format: "1.0-rc.3" disabled: false resource: # Configure resource attributes. Entries have higher priority than entries from .resource.attributes_list. diff --git a/experimental/packages/configuration/test/fixtures/sdk-config.yaml b/experimental/packages/configuration/test/fixtures/sdk-config.yaml new file mode 100644 index 00000000000..7f7844867e1 --- /dev/null +++ b/experimental/packages/configuration/test/fixtures/sdk-config.yaml @@ -0,0 +1,94 @@ +# sdk-config.yaml is a comprehensive starting point for configuring the SDK, including exporting to +# localhost via OTLP. +# +# NOTE: With the exception of env var substitution syntax (i.e. ${MY_ENV}), SDKs ignore +# environment variables when interpreting config files. This including ignoring all env +# vars defined in https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/. +# +# For schema documentation, including required properties, semantics, default behavior, etc, +# see: https://github.com/open-telemetry/opentelemetry-configuration/blob/main/schema-docs.md +file_format: "1.0-rc.3" +disabled: false +log_level: info +resource: + attributes: + - name: service.name + value: unknown_service +attribute_limits: + attribute_value_length_limit: + attribute_count_limit: 128 +propagator: + composite: + - tracecontext: + - baggage: +tracer_provider: + processors: + - batch: + schedule_delay: 5000 + export_timeout: 30000 + max_queue_size: 2048 + max_export_batch_size: 512 + exporter: + otlp_http: + endpoint: http://localhost:4318/v1/traces + tls: + ca_file: + key_file: + cert_file: + compression: gzip + timeout: 10000 + limits: + attribute_value_length_limit: + attribute_count_limit: 128 + event_count_limit: 128 + link_count_limit: 128 + event_attribute_count_limit: 128 + link_attribute_count_limit: 128 + sampler: + parent_based: + root: + always_on: + remote_parent_sampled: + always_on: + remote_parent_not_sampled: + always_off: + local_parent_sampled: + always_on: + local_parent_not_sampled: + always_off: +meter_provider: + readers: + - periodic: + interval: 60000 + timeout: 30000 + exporter: + otlp_http: + endpoint: http://localhost:4318/v1/metrics + tls: + ca_file: + key_file: + cert_file: + compression: gzip + timeout: 10000 + temporality_preference: cumulative + default_histogram_aggregation: explicit_bucket_histogram + exemplar_filter: trace_based +logger_provider: + processors: + - batch: + schedule_delay: 1000 + export_timeout: 30000 + max_queue_size: 2048 + max_export_batch_size: 512 + exporter: + otlp_http: + endpoint: http://localhost:4318/v1/logs + tls: + ca_file: + key_file: + cert_file: + compression: gzip + timeout: 10000 + limits: + attribute_value_length_limit: + attribute_count_limit: 128 \ No newline at end of file diff --git a/experimental/packages/configuration/test/fixtures/sdk-migration-config.yaml b/experimental/packages/configuration/test/fixtures/sdk-migration-config.yaml index 168344b8337..f9b8539d8ef 100644 --- a/experimental/packages/configuration/test/fixtures/sdk-migration-config.yaml +++ b/experimental/packages/configuration/test/fixtures/sdk-migration-config.yaml @@ -7,286 +7,118 @@ # below, but OTEL_TRACES_EXPORTER is not since it does not map well to the hierarchical # structure of declarative configuration. # - -# The file format version. -# The yaml format is documented at -# https://github.com/open-telemetry/opentelemetry-configuration/tree/main/schema -file_format: "1.0-rc.1" -# Configure if the SDK is disabled or not. -# If omitted or null, false is used. +# NOTE: With the exception of env var substitution syntax, SDKs ignore environment variables +# when interpreting config files. For example, if "disabled: ${OTEL_SDK_DISABLED:-false}" +# is replaced with "disabled: false", then setting the env var OTEL_SDK_DISABLED will have +# no effect. See https://opentelemetry.io/docs/specs/otel/configuration/data-model/ +# for more information. The following spec defined env vars are NOT referenced and are thus +# ignored: +# +# - OTEL_TRACES_SAMPLER +# - OTEL_TRACES_SAMPLER_ARG +# - OTEL_EXPORTER_ZIPKIN_ENDPOINT +# - OTEL_EXPORTER_ZIPKIN_TIMEOUT +# - OTEL_EXPORTER_PROMETHEUS_HOST +# - OTEL_EXPORTER_PROMETHEUS_PORT +# - OTEL_TRACES_EXPORTER +# - OTEL_METRICS_EXPORTER +# - OTEL_LOGS_EXPORTER +# - OTEL_EXPORTER_OTLP_PROTOCOL, OTEL_EXPORTER_OTLP_{SIGNAL}_PROTOCOL +# - OTEL_EXPORTER_OTLP_ENDPOINT +# - OTEL_EXPORTER_OTLP_INSECURE, OTEL_EXPORTER_OTLP_{SIGNAL}_INSECURE +# - OTEL_EXPORTER_OTLP_CERTIFICATE +# - OTEL_EXPORTER_OTLP_CLIENT_KEY +# - OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE +# - OTEL_EXPORTER_OTLP_COMPRESSION +# - OTEL_EXPORTER_OTLP_TIMEOUT +# - OTEL_LOG_LEVEL +# +# For schema documentation, including required properties, semantics, default behavior, etc, +# see: https://github.com/open-telemetry/opentelemetry-configuration/blob/main/schema-docs.md +file_format: "1.0-rc.3" disabled: ${OTEL_SDK_DISABLED:-false} -# Configure the log level of the internal logger used by the SDK. -# If omitted, info is used. -log_level: ${OTEL_LOG_LEVEL:-info} -# Configure resource for all signals. -# If omitted, the default resource is used. +log_level: info resource: - # Configure resource attributes. Entries have higher priority than entries from .resource.attributes_list. - # Entries must contain .name and .value, and may optionally include .type. If an entry's .type omitted or null, string is used. - # The .value's type must match the .type. Values for .type include: string, bool, int, double, string_array, bool_array, int_array, double_array. attributes: - name: service.name value: ${OTEL_SERVICE_NAME:-unknown_service} - # Configure resource attributes. Entries have lower priority than entries from .resource.attributes. - # 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. - # If omitted or null, no resource attributes are added. attributes_list: ${OTEL_RESOURCE_ATTRIBUTES} -# Configure general attribute limits. See also tracer_provider.limits, logger_provider.limits. attribute_limits: - # Configure max attribute value size. - # Value must be non-negative. - # If omitted or null, there is no limit. attribute_value_length_limit: ${OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT} - # Configure max attribute count. - # Value must be non-negative. - # If omitted or null, 128 is used. attribute_count_limit: ${OTEL_ATTRIBUTE_COUNT_LIMIT:-128} -# Configure text map context propagators. -# If omitted, a noop propagator is used. propagator: - # Configure the propagators in the composite text map propagator. Entries from .composite_list are appended to the list here with duplicates filtered out. - # Built-in propagator keys include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party keys include: xray. - # If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used. - composite: [] - # Configure the propagators in the composite text map propagator. Entries are appended to .composite with duplicates filtered out. - # 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. - # Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi, jaeger, ottrace. Known third party identifiers include: xray. - # If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used. composite_list: ${OTEL_PROPAGATORS:-tracecontext,baggage} -# Configure tracer provider. -# If omitted, a noop tracer provider is used. tracer_provider: - # Configure span processors. processors: - - # Configure a batch span processor. - batch: - # Configure delay interval (in milliseconds) between two consecutive exports. - # Value must be non-negative. - # If omitted or null, 5000 is used. + - batch: schedule_delay: ${OTEL_BSP_SCHEDULE_DELAY:-5000} - # Configure maximum allowed time (in milliseconds) to export data. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 30000 is used. export_timeout: ${OTEL_BSP_EXPORT_TIMEOUT:-30000} - # Configure maximum queue size. Value must be positive. - # If omitted or null, 2048 is used. max_queue_size: ${OTEL_BSP_MAX_QUEUE_SIZE:-2048} - # Configure maximum batch size. Value must be positive. - # If omitted or null, 512 is used. max_export_batch_size: ${OTEL_BSP_MAX_EXPORT_BATCH_SIZE:-512} - # Configure exporter. exporter: - # Configure exporter to be OTLP with HTTP transport. otlp_http: - # Configure endpoint, including the trace specific path. - # If omitted or null, http://localhost:4318/v1/traces is used. - endpoint: ${OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:-http://localhost:4318/v1/traces} - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: ${OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE} - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: ${OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY} - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: ${OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE} - # Configure compression. - # Values include: gzip, none. Implementations may support other compression algorithms. - # If omitted or null, none is used. + endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://localhost:4318}/v1/traces + tls: + ca_file: ${OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE} + key_file: ${OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY} + cert_file: ${OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE} compression: ${OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:-gzip} - # Configure max time (in milliseconds) to wait for each export. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 10000 is used. timeout: ${OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:-10000} - # Configure headers. Entries have higher priority than entries from .headers_list. - # If an entry's .value is null, the entry is ignored. - headers: [] - # Configure headers. Entries have lower priority than entries from .headers. - # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. - # If omitted or null, no headers are added. headers_list: ${OTEL_EXPORTER_OTLP_TRACES_HEADERS} - # Configure span limits. See also attribute_limits. limits: - # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. - # Value must be non-negative. - # If omitted or null, there is no limit. attribute_value_length_limit: ${OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT} - # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. - # Value must be non-negative. - # If omitted or null, 128 is used. attribute_count_limit: ${OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:-128} - # Configure max span event count. - # Value must be non-negative. - # If omitted or null, 128 is used. event_count_limit: ${OTEL_SPAN_EVENT_COUNT_LIMIT:-128} - # Configure max span link count. - # Value must be non-negative. - # If omitted or null, 128 is used. link_count_limit: ${OTEL_SPAN_LINK_COUNT_LIMIT:-128} - # Configure max attributes per span event. - # Value must be non-negative. - # If omitted or null, 128 is used. event_attribute_count_limit: ${OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT:-128} - # Configure max attributes per span link. - # Value must be non-negative. - # If omitted or null, 128 is used. link_attribute_count_limit: ${OTEL_LINK_ATTRIBUTE_COUNT_LIMIT:-128} - # Configure the sampler. - # If omitted, parent based sampler with a root of always_on is used. sampler: - # Configure sampler to be parent_based. parent_based: - # Configure root sampler. - # If omitted or null, always_on is used. root: - # Configure sampler to be always_on. always_on: - # Configure remote_parent_sampled sampler. - # If omitted or null, always_on is used. remote_parent_sampled: - # Configure sampler to be always_on. always_on: - # Configure remote_parent_not_sampled sampler. - # If omitted or null, always_off is used. remote_parent_not_sampled: - # Configure sampler to be always_off. always_off: - # Configure local_parent_sampled sampler. - # If omitted or null, always_on is used. local_parent_sampled: - # Configure sampler to be always_on. always_on: - # Configure local_parent_not_sampled sampler. - # If omitted or null, always_off is used. local_parent_not_sampled: - # Configure sampler to be always_off. always_off: - - -# Configure meter provider. -# If omitted, a noop meter provider is used. meter_provider: - # Configure metric readers. readers: - - # Configure a periodic metric reader. - periodic: - # Configure delay interval (in milliseconds) between start of two consecutive exports. - # Value must be non-negative. - # If omitted or null, 60000 is used. + - periodic: interval: ${OTEL_METRIC_EXPORT_INTERVAL:-60000} - # Configure maximum allowed time (in milliseconds) to export data. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 30000 is used. timeout: ${OTEL_METRIC_EXPORT_TIMEOUT:-30000} - # Configure exporter. exporter: - # Configure exporter to be OTLP with HTTP transport. otlp_http: - # Configure endpoint, including the metric specific path. - # If omitted or null, http://localhost:4318/v1/metrics is used. - endpoint: ${OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:-http://localhost:4318/v1/metrics} - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: ${OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE} - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: ${OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY} - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: ${OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE} - # Configure compression. - # Values include: gzip, none. Implementations may support other compression algorithms. - # If omitted or null, none is used. + endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://localhost:4318}/v1/metrics + tls: + ca_file: ${OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE} + key_file: ${OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY} + cert_file: ${OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE} compression: ${OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:-gzip} - # Configure max time (in milliseconds) to wait for each export. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 10000 is used. timeout: ${OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:-10000} - # Configure headers. Entries have higher priority than entries from .headers_list. - # If an entry's .value is null, the entry is ignored. - headers: [] - # Configure headers. Entries have lower priority than entries from .headers. - # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. - # If omitted or null, no headers are added. headers_list: ${OTEL_EXPORTER_OTLP_METRICS_HEADERS} - # Configure temporality preference. - # Values include: cumulative, delta, low_memory. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. - # If omitted or null, cumulative is used. temporality_preference: ${OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:-cumulative} - # Configure default histogram aggregation. - # Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram. For behavior of values, see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk_exporters/otlp.md. - # If omitted or null, explicit_bucket_histogram is used. default_histogram_aggregation: ${OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION:-explicit_bucket_histogram} - # Configure the exemplar filter. - # Values include: trace_based, always_on, always_off. For behavior of values see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#metrics-sdk-configuration. - # If omitted or null, trace_based is used. exemplar_filter: ${OTEL_METRICS_EXEMPLAR_FILTER:-trace_based} -# Configure logger provider. -# If omitted, a noop logger provider is used. logger_provider: - # Configure log record processors. processors: - - # Configure a batch log record processor. - batch: - # Configure delay interval (in milliseconds) between two consecutive exports. - # Value must be non-negative. - # If omitted or null, 1000 is used. + - batch: schedule_delay: ${OTEL_BLRP_SCHEDULE_DELAY:-1000} - # Configure maximum allowed time (in milliseconds) to export data. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 30000 is used. export_timeout: ${OTEL_BLRP_EXPORT_TIMEOUT:-30000} - # Configure maximum queue size. Value must be positive. - # If omitted or null, 2048 is used. max_queue_size: ${OTEL_BLRP_MAX_QUEUE_SIZE:-2048} - # Configure maximum batch size. Value must be positive. - # If omitted or null, 512 is used. max_export_batch_size: ${OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:-512} - # Configure exporter. exporter: - # Configure exporter to be OTLP with HTTP transport. otlp_http: - endpoint: ${OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:-http://localhost:4318/v1/logs} - # Configure certificate used to verify a server's TLS credentials. - # Absolute path to certificate file in PEM format. - # If omitted or null, system default certificate verification is used for secure connections. - certificate_file: ${OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE} - # Configure mTLS private client key. - # Absolute path to client key file in PEM format. If set, .client_certificate must also be set. - # If omitted or null, mTLS is not used. - client_key_file: ${OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY} - # Configure mTLS client certificate. - # Absolute path to client certificate file in PEM format. If set, .client_key must also be set. - # If omitted or null, mTLS is not used. - client_certificate_file: ${OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE} - # Configure compression. - # Values include: gzip, none. Implementations may support other compression algorithms. - # If omitted or null, none is used. + endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://localhost:4318}/v1/logs + tls: + ca_file: ${OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE} + key_file: ${OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY} + cert_file: ${OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE} compression: ${OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:-gzip} - # Configure max time (in milliseconds) to wait for each export. - # Value must be non-negative. A value of 0 indicates no limit (infinity). - # If omitted or null, 10000 is used. timeout: ${OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:-10000} - # Configure headers. Entries have higher priority than entries from .headers_list. - # If an entry's .value is null, the entry is ignored. - headers: [] - # Configure headers. Entries have lower priority than entries from .headers. - # The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details. - # If omitted or null, no headers are added. headers_list: ${OTEL_EXPORTER_OTLP_LOGS_HEADERS} - # Configure log record limits. See also attribute_limits. limits: - # Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit. - # Value must be non-negative. - # If omitted or null, there is no limit. attribute_value_length_limit: ${OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT} - # Configure max attribute count. Overrides .attribute_limits.attribute_count_limit. - # Value must be non-negative. - # If omitted or null, 128 is used. attribute_count_limit: ${OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:-128} \ No newline at end of file diff --git a/experimental/packages/configuration/test/fixtures/short-config.yml b/experimental/packages/configuration/test/fixtures/short-config.yml index 0473fbd1b1e..da71ec21800 100644 --- a/experimental/packages/configuration/test/fixtures/short-config.yml +++ b/experimental/packages/configuration/test/fixtures/short-config.yml @@ -1,4 +1,4 @@ -file_format: "1.0-rc.1" +file_format: "1.0-rc.3" disabled: false resource: attributes_list: service.instance.id=123 \ No newline at end of file diff --git a/experimental/packages/configuration/test/fixtures/test-for-coverage.yaml b/experimental/packages/configuration/test/fixtures/test-for-coverage.yaml index 8f5c677e757..335bef8ba9f 100644 --- a/experimental/packages/configuration/test/fixtures/test-for-coverage.yaml +++ b/experimental/packages/configuration/test/fixtures/test-for-coverage.yaml @@ -1,5 +1,17 @@ -file_format: "1.0-rc.1" +file_format: "1.0-rc.3" resource: attributes_list: propagator: - composite_list: tracecontext \ No newline at end of file + composite_list: tracecontext +logger_provider: + processors: + - simple: + exporter: + console: + logger_configurator/development: + loggers: + - name: io.opentelemetry.contrib.* + config: + enabled: false + minimum_severity: info + trace_based: true \ No newline at end of file