@opentelemetry/configuration 0.212.0 → 0.213.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/ConfigFactory.js +1 -12
- package/build/src/ConfigFactory.js.map +1 -1
- package/build/src/EnvironmentConfigFactory.js +1 -12
- package/build/src/EnvironmentConfigFactory.js.map +1 -1
- package/build/src/FileConfigFactory.js +1 -12
- package/build/src/FileConfigFactory.js.map +1 -1
- package/build/src/IConfigFactory.js +1 -12
- package/build/src/IConfigFactory.js.map +1 -1
- package/build/src/index.js +1 -12
- package/build/src/index.js.map +1 -1
- package/build/src/models/commonModel.js +1 -12
- package/build/src/models/commonModel.js.map +1 -1
- package/build/src/models/configModel.js +1 -12
- package/build/src/models/configModel.js.map +1 -1
- package/build/src/models/loggerProviderModel.js +1 -12
- package/build/src/models/loggerProviderModel.js.map +1 -1
- package/build/src/models/meterProviderModel.js +1 -12
- package/build/src/models/meterProviderModel.js.map +1 -1
- package/build/src/models/resourceModel.js +1 -12
- package/build/src/models/resourceModel.js.map +1 -1
- package/build/src/models/tracerProviderModel.js +1 -12
- package/build/src/models/tracerProviderModel.js.map +1 -1
- package/build/src/utils.js +1 -12
- package/build/src/utils.js.map +1 -1
- package/build/src/version.d.ts +1 -1
- package/build/src/version.js +1 -1
- package/build/src/version.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meterProviderModel.js","sourceRoot":"","sources":["../../../src/models/meterProviderModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,YAAY,CAAC;;;AAUb,SAAgB,2CAA2C;IACzD,OAAO;QACL,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;QACT,eAAe,EAAE,cAAc,CAAC,UAAU;KAC3C,CAAC;AACJ,CAAC;AAND,kGAMC;AAuBD,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,0CAAwB,CAAA;IACxB,wCAAsB,CAAA;IACtB,4CAA0B,CAAA;AAC5B,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB;AA+KD,IAAY,yCAKX;AALD,WAAY,yCAAyC;IACnD,iHAAoE,CAAA;IACpE,uHAA0E,CAAA;IAC1E,0GAA6D,CAAA;IAC7D,6EAAgC,CAAA;AAClC,CAAC,EALW,yCAAyC,GAAzC,iDAAyC,KAAzC,iDAAyC,QAKpD;AAwJD,IAAY,6BAIX;AAJD,WAAY,6BAA6B;IACvC,0DAAyB,CAAA;IACzB,gDAAe,CAAA;IACf,yDAAwB,CAAA;AAC1B,CAAC,EAJW,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAIxC;AAED,IAAY,mCAGX;AAHD,WAAY,mCAAmC;IAC7C,6GAAsE,CAAA;IACtE,4FAAqD,CAAA;AACvD,CAAC,EAHW,mCAAmC,GAAnC,2CAAmC,KAAnC,2CAAmC,QAG9C;AAoED,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,yCAAuB,CAAA;IACvB,0DAAwC,CAAA;IACxC,sDAAoC,CAAA;IACpC,wEAAsD,CAAA;IACtD,mDAAiC,CAAA;AACnC,CAAC,EARW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAQzB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use strict';\n\nimport {\n GrpcTls,\n HttpTls,\n IncludeExclude,\n NameStringValuePair,\n OtlpHttpEncoding,\n} from './commonModel';\n\nexport function initializeDefaultMeterProviderConfiguration(): Required<MeterProvider> {\n return {\n readers: [],\n views: [],\n exemplar_filter: ExemplarFilter.TraceBased,\n };\n}\n\nexport interface MeterProvider {\n /**\n * Configure metric readers.\n */\n readers: MetricReader[];\n\n /**\n * Configure views.\n * Each view has a selector which determines the instrument(s) it applies to,\n * and a configuration for the resulting stream(s).\n */\n views?: View[];\n\n /**\n * Configure the exemplar filter.\n * Values include: trace_based, always_on, always_off.\n * If omitted or null, trace_based is used.\n */\n exemplar_filter?: ExemplarFilter;\n}\n\nexport enum ExemplarFilter {\n AlwaysOff = 'always_off',\n AlwaysOn = 'always_on',\n TraceBased = 'trace_based',\n}\n\nexport interface PeriodicMetricReader {\n /**\n * Configure delay interval (in milliseconds) between start of two consecutive exports.\n * Value must be non-negative.\n * If omitted or null, 60000 is used.\n */\n interval?: number;\n\n /**\n * Configure maximum allowed time (in milliseconds) to export data.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 30000 is used.\n */\n timeout?: number;\n\n /**\n * Configure exporter.\n */\n exporter: PushMetricExporter;\n\n /**\n * Configure metric producers.\n */\n producers?: MetricProducer[];\n\n /**\n * Configure cardinality limits.\n */\n cardinality_limits?: CardinalityLimits;\n}\n\nexport interface PullMetricReader {\n /**\n * Configure exporter.\n */\n exporter: PullMetricExporter;\n\n /**\n * Configure metric producers.\n */\n producers?: MetricProducer[];\n\n /**\n * Configure cardinality limits.\n */\n cardinality_limits?: CardinalityLimits;\n}\n\nexport interface CardinalityLimits {\n /**\n * Configure default cardinality limit for all instrument types.\n * Instrument-specific cardinality limits take priority.\n * If omitted or null, 2000 is used.\n */\n default?: number;\n\n /**\n * Configure default cardinality limit for counter instruments.\n * If omitted or null, the value from .default is used.\n */\n counter?: number;\n\n /**\n * Configure default cardinality limit for gauge instruments.\n * If omitted or null, the value from .default is used.\n */\n gauge?: number;\n\n /**\n * Configure default cardinality limit for histogram instruments.\n * If omitted or null, the value from .default is used.\n */\n histogram?: number;\n\n /**\n * Configure default cardinality limit for observable_counter instruments.\n * If omitted or null, the value from .default is used.\n */\n observable_counter?: number;\n\n /**\n * Configure default cardinality limit for observable_gauge instruments.\n * If omitted or null, the value from .default is used.\n */\n observable_gauge?: number;\n\n /**\n * Configure default cardinality limit for observable_up_down_counter instruments.\n * If omitted or null, the value from .default is used.\n */\n observable_up_down_counter?: number;\n\n /**\n * Configure default cardinality limit for up_down_counter instruments.\n * If omitted or null, the value from .default is used.\n */\n up_down_counter?: number;\n}\n\nexport interface PushMetricExporter {\n /**\n * Configure exporter to be OTLP with HTTP transport.\n */\n otlp_http?: OtlpHttpMetricExporter;\n\n /**\n * Configure exporter to be OTLP with gRPC transport.\n */\n otlp_grpc?: OtlpGrpcMetricExporter;\n\n /**\n * Configure exporter to be OTLP with file transport.\n * This type is in development and subject to breaking changes in minor versions.\n */\n 'otlp_file/development'?: ExperimentalOtlpFileMetricExporter;\n\n /**\n * Configure exporter to be console.\n */\n console?: ConsoleMetricExporter;\n}\n\nexport interface PullMetricExporter {\n /**\n * Configure exporter to be prometheus.\n * This type is in development and subject to breaking changes in minor versions.\n */\n 'prometheus/development': ExperimentalPrometheusMetricExporter;\n}\n\nexport interface MetricProducer {\n /**\n * Configure metric producer to be opencensus.\n */\n opencensus?: object;\n}\n\nexport interface ExperimentalPrometheusMetricExporter {\n /**\n * Configure host.\n * If omitted or null, localhost is used.\n */\n host?: string;\n\n /**\n * Configure port.\n * If omitted or null, 9464 is used.\n */\n port?: number;\n\n /**\n * Configure Prometheus Exporter to produce metrics without a scope info metric.\n * If omitted or null, false is used.\n */\n without_scope_info?: boolean;\n\n /**\n * Configure Prometheus Exporter to produce metrics without a target info metric for the resource.\n * If omitted or null, false is used.\n */\n without_target_info?: boolean;\n\n /**\n * Configure Prometheus Exporter to add resource attributes as metrics attributes.\n */\n with_resource_constant_labels?: IncludeExclude;\n\n /**\n * Configure how metric names are translated to Prometheus metric names.\n */\n translation_strategy?: ExperimentalPrometheusTranslationStrategy;\n}\n\nexport enum ExperimentalPrometheusTranslationStrategy {\n UnderscoreEscapingWithSuffixes = 'underscore_escaping_with_suffixes',\n UnderscoreEscapingWithoutSuffixes = 'underscore_escaping_without_suffixes',\n NoUtf8EscapingWithSuffixes = 'no_utf8_escaping_with_suffixes',\n NoTranslation = 'no_translation',\n}\n\nexport interface MetricReader {\n /**\n * Configure a periodic metric reader.\n */\n periodic?: PeriodicMetricReader;\n\n /**\n * Configure a pull based metric reader.\n */\n pull?: PullMetricReader;\n}\n\nexport interface OtlpHttpMetricExporter {\n /**\n * Configure endpoint, including the metric specific path.\n * If omitted or null, http://localhost:4318/v1/metrics is used.\n */\n endpoint?: string;\n\n /**\n * Configure TLS settings for the exporter.\n */\n tls?: HttpTls;\n\n /**\n * Configure headers. Entries have higher priority than entries from .headers_list.\n * If an entry's .value is null, the entry is ignored.\n */\n headers?: NameStringValuePair[];\n\n /**\n * Configure headers. Entries have lower priority than entries from .headers.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS.\n * If omitted or null, no headers are added.\n */\n headers_list?: string;\n\n /**\n * Configure compression.\n * Values include: gzip, none. Implementations may support other compression algorithms.\n * If omitted or null, none is used.\n */\n compression?: string;\n\n /**\n * Configure max time (in milliseconds) to wait for each export.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 10000 is used.\n */\n timeout?: number;\n\n /**\n * Configure the encoding used for messages.\n * Values include: protobuf, json. Implementations may not support json.\n * If omitted or null, protobuf is used.\n */\n encoding?: OtlpHttpEncoding;\n\n /**\n * Configure temporality preference.\n * Values include: cumulative, delta, low_memory.\n * If omitted or null, cumulative is used.\n */\n temporality_preference?: ExporterTemporalityPreference;\n\n /**\n * Configure default histogram aggregation.\n * Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram.\n * If omitted or null, explicit_bucket_histogram is used.\n */\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n}\n\nexport interface OtlpGrpcMetricExporter {\n /**\n * Configure endpoint.\n * If omitted or null, http://localhost:4317 is used.\n */\n endpoint?: string;\n\n /**\n * Configure TLS settings for the exporter.\n */\n tls?: GrpcTls;\n\n /**\n * Configure headers. Entries have higher priority than entries from .headers_list.\n * If an entry's .value is null, the entry is ignored.\n */\n headers?: NameStringValuePair[];\n\n /**\n * Configure headers. Entries have lower priority than entries from .headers.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS.\n * If omitted or null, no headers are added.\n */\n headers_list?: string;\n\n /**\n * Configure compression.\n * Values include: gzip, none. Implementations may support other compression algorithms.\n * If omitted or null, none is used.\n */\n compression?: string;\n\n /**\n * Configure max time (in milliseconds) to wait for each export.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 10000 is used.\n */\n timeout?: number;\n\n /**\n * Configure temporality preference.\n * Values include: cumulative, delta, low_memory.\n * If omitted or null, cumulative is used.\n */\n temporality_preference?: ExporterTemporalityPreference;\n\n /**\n * Configure default histogram aggregation.\n * Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram.\n * If omitted or null, explicit_bucket_histogram is used.\n */\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n}\n\nexport interface ExperimentalOtlpFileMetricExporter {\n /**\n * Configure output stream.\n * Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.\n * If omitted or null, stdout is used.\n */\n output_stream?: string;\n\n /**\n * Configure temporality preference.\n * Values include: cumulative, delta, low_memory.\n * If omitted or null, cumulative is used.\n */\n temporality_preference?: ExporterTemporalityPreference;\n\n /**\n * Configure default histogram aggregation.\n * Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram.\n * If omitted or null, explicit_bucket_histogram is used.\n */\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n}\n\nexport enum ExporterTemporalityPreference {\n Cumulative = 'cumulative',\n Delta = 'delta',\n LowMemory = 'low_memory',\n}\n\nexport enum ExporterDefaultHistogramAggregation {\n Base2ExponentialBucketHistogram = 'base2_exponential_bucket_histogram',\n ExplicitBucketHistogram = 'explicit_bucket_histogram',\n}\n\nexport interface ConsoleMetricExporter {\n /**\n * Configure temporality preference.\n * If omitted or null, cumulative is used.\n */\n temporality_preference?: ExporterTemporalityPreference;\n\n /**\n * Configure default histogram aggregation.\n * If omitted or null, explicit_bucket_histogram is used.\n */\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n}\n\nexport interface View {\n /**\n * Configure view selector.\n */\n selector?: ViewSelector;\n\n /**\n * Configure view stream.\n */\n stream?: ViewStream;\n}\n\nexport interface ViewSelector {\n /**\n * Configure instrument name selection criteria.\n * If omitted or null, all instrument names match.\n */\n instrument_name?: string;\n\n /**\n * Configure instrument type selection criteria.\n * Values include: counter, gauge, histogram, observable_counter, observable_gauge,\n * observable_up_down_counter, up_down_counter.\n * If omitted or null, all instrument types match.\n */\n instrument_type?: InstrumentType;\n\n /**\n * Configure the instrument unit selection criteria.\n * If omitted or null, all instrument units match.\n */\n unit?: string;\n\n /**\n * Configure meter name selection criteria.\n * If omitted or null, all meter names match.\n */\n meter_name?: string;\n\n /**\n * Configure meter version selection criteria.\n * If omitted or null, all meter versions match.\n */\n meter_version?: string;\n\n /**\n * Configure meter schema url selection criteria.\n * If omitted or null, all meter schema URLs match.\n */\n meter_schema_url?: string;\n}\n\nexport enum InstrumentType {\n Counter = 'counter',\n Gauge = 'gauge',\n Histogram = 'histogram',\n ObservableCounter = 'observable_counter',\n ObservableGauge = 'observable_gauge',\n ObservableUpDownCounter = 'observable_up_down_counter',\n UpDownCounter = 'up_down_counter',\n}\n\nexport interface ViewStream {\n /**\n * Configure metric name of the resulting stream(s).\n * If omitted or null, the instrument's original name is used.\n */\n name?: string;\n\n /**\n * Configure metric description of the resulting stream(s).\n * If omitted or null, the instrument's origin description is used.\n */\n description?: string;\n\n /**\n * Configure aggregation of the resulting stream(s).\n * Values include: default, drop, explicit_bucket_histogram, base2_exponential_bucket_histogram, last_value, sum.\n * If omitted, default is used.\n */\n aggregation?: Aggregation;\n\n /**\n * Configure the aggregation cardinality limit.\n * If omitted or null, the metric reader's default cardinality limit is used.\n */\n aggregation_cardinality_limit?: number;\n\n /**\n * Configure attribute keys retained in the resulting stream(s).\n */\n attribute_keys?: IncludeExclude;\n}\n\nexport interface Aggregation {\n /**\n * Configure aggregation to be default.\n */\n default?: object;\n\n /**\n * Configure aggregation to be drop.\n */\n drop?: object;\n\n /**\n * Configure aggregation to be explicit_bucket_histogram.\n */\n explicit_bucket_histogram?: ExplicitBucketHistogramAggregation;\n\n /**\n * Configure aggregation to be base2_exponential_bucket_histogram.\n */\n base2_exponential_bucket_histogram?: Base2ExponentialBucketHistogramAggregation;\n\n /**\n * Configure aggregation to be last_value.\n */\n last_value?: object;\n\n /**\n * Configure aggregation to be sum.\n */\n sum?: object;\n}\n\nexport interface ExplicitBucketHistogramAggregation {\n /**\n * Configure bucket boundaries.\n * If omitted, [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000] is used.\n */\n boundaries?: number[];\n\n /**\n * Configure record min and max.\n * If omitted or null, true is used.\n */\n record_min_max?: boolean;\n}\n\nexport interface Base2ExponentialBucketHistogramAggregation {\n /**\n * Configure max_scale.\n */\n max_scale?: number;\n\n /**\n * Configure max_size.\n */\n max_size?: number;\n\n /**\n * Configure record min and max.\n * If omitted or null, true is used.\n */\n record_min_max?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"meterProviderModel.js","sourceRoot":"","sources":["../../../src/models/meterProviderModel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,YAAY,CAAC;;;AAUb,SAAgB,2CAA2C;IACzD,OAAO;QACL,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;QACT,eAAe,EAAE,cAAc,CAAC,UAAU;KAC3C,CAAC;AACJ,CAAC;AAND,kGAMC;AAuBD,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,0CAAwB,CAAA;IACxB,wCAAsB,CAAA;IACtB,4CAA0B,CAAA;AAC5B,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB;AA+KD,IAAY,yCAKX;AALD,WAAY,yCAAyC;IACnD,iHAAoE,CAAA;IACpE,uHAA0E,CAAA;IAC1E,0GAA6D,CAAA;IAC7D,6EAAgC,CAAA;AAClC,CAAC,EALW,yCAAyC,GAAzC,iDAAyC,KAAzC,iDAAyC,QAKpD;AAwJD,IAAY,6BAIX;AAJD,WAAY,6BAA6B;IACvC,0DAAyB,CAAA;IACzB,gDAAe,CAAA;IACf,yDAAwB,CAAA;AAC1B,CAAC,EAJW,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAIxC;AAED,IAAY,mCAGX;AAHD,WAAY,mCAAmC;IAC7C,6GAAsE,CAAA;IACtE,4FAAqD,CAAA;AACvD,CAAC,EAHW,mCAAmC,GAAnC,2CAAmC,KAAnC,2CAAmC,QAG9C;AAoED,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,yCAAuB,CAAA;IACvB,0DAAwC,CAAA;IACxC,sDAAoC,CAAA;IACpC,wEAAsD,CAAA;IACtD,mDAAiC,CAAA;AACnC,CAAC,EARW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAQzB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n'use strict';\n\nimport {\n GrpcTls,\n HttpTls,\n IncludeExclude,\n NameStringValuePair,\n OtlpHttpEncoding,\n} from './commonModel';\n\nexport function initializeDefaultMeterProviderConfiguration(): Required<MeterProvider> {\n return {\n readers: [],\n views: [],\n exemplar_filter: ExemplarFilter.TraceBased,\n };\n}\n\nexport interface MeterProvider {\n /**\n * Configure metric readers.\n */\n readers: MetricReader[];\n\n /**\n * Configure views.\n * Each view has a selector which determines the instrument(s) it applies to,\n * and a configuration for the resulting stream(s).\n */\n views?: View[];\n\n /**\n * Configure the exemplar filter.\n * Values include: trace_based, always_on, always_off.\n * If omitted or null, trace_based is used.\n */\n exemplar_filter?: ExemplarFilter;\n}\n\nexport enum ExemplarFilter {\n AlwaysOff = 'always_off',\n AlwaysOn = 'always_on',\n TraceBased = 'trace_based',\n}\n\nexport interface PeriodicMetricReader {\n /**\n * Configure delay interval (in milliseconds) between start of two consecutive exports.\n * Value must be non-negative.\n * If omitted or null, 60000 is used.\n */\n interval?: number;\n\n /**\n * Configure maximum allowed time (in milliseconds) to export data.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 30000 is used.\n */\n timeout?: number;\n\n /**\n * Configure exporter.\n */\n exporter: PushMetricExporter;\n\n /**\n * Configure metric producers.\n */\n producers?: MetricProducer[];\n\n /**\n * Configure cardinality limits.\n */\n cardinality_limits?: CardinalityLimits;\n}\n\nexport interface PullMetricReader {\n /**\n * Configure exporter.\n */\n exporter: PullMetricExporter;\n\n /**\n * Configure metric producers.\n */\n producers?: MetricProducer[];\n\n /**\n * Configure cardinality limits.\n */\n cardinality_limits?: CardinalityLimits;\n}\n\nexport interface CardinalityLimits {\n /**\n * Configure default cardinality limit for all instrument types.\n * Instrument-specific cardinality limits take priority.\n * If omitted or null, 2000 is used.\n */\n default?: number;\n\n /**\n * Configure default cardinality limit for counter instruments.\n * If omitted or null, the value from .default is used.\n */\n counter?: number;\n\n /**\n * Configure default cardinality limit for gauge instruments.\n * If omitted or null, the value from .default is used.\n */\n gauge?: number;\n\n /**\n * Configure default cardinality limit for histogram instruments.\n * If omitted or null, the value from .default is used.\n */\n histogram?: number;\n\n /**\n * Configure default cardinality limit for observable_counter instruments.\n * If omitted or null, the value from .default is used.\n */\n observable_counter?: number;\n\n /**\n * Configure default cardinality limit for observable_gauge instruments.\n * If omitted or null, the value from .default is used.\n */\n observable_gauge?: number;\n\n /**\n * Configure default cardinality limit for observable_up_down_counter instruments.\n * If omitted or null, the value from .default is used.\n */\n observable_up_down_counter?: number;\n\n /**\n * Configure default cardinality limit for up_down_counter instruments.\n * If omitted or null, the value from .default is used.\n */\n up_down_counter?: number;\n}\n\nexport interface PushMetricExporter {\n /**\n * Configure exporter to be OTLP with HTTP transport.\n */\n otlp_http?: OtlpHttpMetricExporter;\n\n /**\n * Configure exporter to be OTLP with gRPC transport.\n */\n otlp_grpc?: OtlpGrpcMetricExporter;\n\n /**\n * Configure exporter to be OTLP with file transport.\n * This type is in development and subject to breaking changes in minor versions.\n */\n 'otlp_file/development'?: ExperimentalOtlpFileMetricExporter;\n\n /**\n * Configure exporter to be console.\n */\n console?: ConsoleMetricExporter;\n}\n\nexport interface PullMetricExporter {\n /**\n * Configure exporter to be prometheus.\n * This type is in development and subject to breaking changes in minor versions.\n */\n 'prometheus/development': ExperimentalPrometheusMetricExporter;\n}\n\nexport interface MetricProducer {\n /**\n * Configure metric producer to be opencensus.\n */\n opencensus?: object;\n}\n\nexport interface ExperimentalPrometheusMetricExporter {\n /**\n * Configure host.\n * If omitted or null, localhost is used.\n */\n host?: string;\n\n /**\n * Configure port.\n * If omitted or null, 9464 is used.\n */\n port?: number;\n\n /**\n * Configure Prometheus Exporter to produce metrics without a scope info metric.\n * If omitted or null, false is used.\n */\n without_scope_info?: boolean;\n\n /**\n * Configure Prometheus Exporter to produce metrics without a target info metric for the resource.\n * If omitted or null, false is used.\n */\n without_target_info?: boolean;\n\n /**\n * Configure Prometheus Exporter to add resource attributes as metrics attributes.\n */\n with_resource_constant_labels?: IncludeExclude;\n\n /**\n * Configure how metric names are translated to Prometheus metric names.\n */\n translation_strategy?: ExperimentalPrometheusTranslationStrategy;\n}\n\nexport enum ExperimentalPrometheusTranslationStrategy {\n UnderscoreEscapingWithSuffixes = 'underscore_escaping_with_suffixes',\n UnderscoreEscapingWithoutSuffixes = 'underscore_escaping_without_suffixes',\n NoUtf8EscapingWithSuffixes = 'no_utf8_escaping_with_suffixes',\n NoTranslation = 'no_translation',\n}\n\nexport interface MetricReader {\n /**\n * Configure a periodic metric reader.\n */\n periodic?: PeriodicMetricReader;\n\n /**\n * Configure a pull based metric reader.\n */\n pull?: PullMetricReader;\n}\n\nexport interface OtlpHttpMetricExporter {\n /**\n * Configure endpoint, including the metric specific path.\n * If omitted or null, http://localhost:4318/v1/metrics is used.\n */\n endpoint?: string;\n\n /**\n * Configure TLS settings for the exporter.\n */\n tls?: HttpTls;\n\n /**\n * Configure headers. Entries have higher priority than entries from .headers_list.\n * If an entry's .value is null, the entry is ignored.\n */\n headers?: NameStringValuePair[];\n\n /**\n * Configure headers. Entries have lower priority than entries from .headers.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS.\n * If omitted or null, no headers are added.\n */\n headers_list?: string;\n\n /**\n * Configure compression.\n * Values include: gzip, none. Implementations may support other compression algorithms.\n * If omitted or null, none is used.\n */\n compression?: string;\n\n /**\n * Configure max time (in milliseconds) to wait for each export.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 10000 is used.\n */\n timeout?: number;\n\n /**\n * Configure the encoding used for messages.\n * Values include: protobuf, json. Implementations may not support json.\n * If omitted or null, protobuf is used.\n */\n encoding?: OtlpHttpEncoding;\n\n /**\n * Configure temporality preference.\n * Values include: cumulative, delta, low_memory.\n * If omitted or null, cumulative is used.\n */\n temporality_preference?: ExporterTemporalityPreference;\n\n /**\n * Configure default histogram aggregation.\n * Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram.\n * If omitted or null, explicit_bucket_histogram is used.\n */\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n}\n\nexport interface OtlpGrpcMetricExporter {\n /**\n * Configure endpoint.\n * If omitted or null, http://localhost:4317 is used.\n */\n endpoint?: string;\n\n /**\n * Configure TLS settings for the exporter.\n */\n tls?: GrpcTls;\n\n /**\n * Configure headers. Entries have higher priority than entries from .headers_list.\n * If an entry's .value is null, the entry is ignored.\n */\n headers?: NameStringValuePair[];\n\n /**\n * Configure headers. Entries have lower priority than entries from .headers.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS.\n * If omitted or null, no headers are added.\n */\n headers_list?: string;\n\n /**\n * Configure compression.\n * Values include: gzip, none. Implementations may support other compression algorithms.\n * If omitted or null, none is used.\n */\n compression?: string;\n\n /**\n * Configure max time (in milliseconds) to wait for each export.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 10000 is used.\n */\n timeout?: number;\n\n /**\n * Configure temporality preference.\n * Values include: cumulative, delta, low_memory.\n * If omitted or null, cumulative is used.\n */\n temporality_preference?: ExporterTemporalityPreference;\n\n /**\n * Configure default histogram aggregation.\n * Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram.\n * If omitted or null, explicit_bucket_histogram is used.\n */\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n}\n\nexport interface ExperimentalOtlpFileMetricExporter {\n /**\n * Configure output stream.\n * Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.\n * If omitted or null, stdout is used.\n */\n output_stream?: string;\n\n /**\n * Configure temporality preference.\n * Values include: cumulative, delta, low_memory.\n * If omitted or null, cumulative is used.\n */\n temporality_preference?: ExporterTemporalityPreference;\n\n /**\n * Configure default histogram aggregation.\n * Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram.\n * If omitted or null, explicit_bucket_histogram is used.\n */\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n}\n\nexport enum ExporterTemporalityPreference {\n Cumulative = 'cumulative',\n Delta = 'delta',\n LowMemory = 'low_memory',\n}\n\nexport enum ExporterDefaultHistogramAggregation {\n Base2ExponentialBucketHistogram = 'base2_exponential_bucket_histogram',\n ExplicitBucketHistogram = 'explicit_bucket_histogram',\n}\n\nexport interface ConsoleMetricExporter {\n /**\n * Configure temporality preference.\n * If omitted or null, cumulative is used.\n */\n temporality_preference?: ExporterTemporalityPreference;\n\n /**\n * Configure default histogram aggregation.\n * If omitted or null, explicit_bucket_histogram is used.\n */\n default_histogram_aggregation?: ExporterDefaultHistogramAggregation;\n}\n\nexport interface View {\n /**\n * Configure view selector.\n */\n selector?: ViewSelector;\n\n /**\n * Configure view stream.\n */\n stream?: ViewStream;\n}\n\nexport interface ViewSelector {\n /**\n * Configure instrument name selection criteria.\n * If omitted or null, all instrument names match.\n */\n instrument_name?: string;\n\n /**\n * Configure instrument type selection criteria.\n * Values include: counter, gauge, histogram, observable_counter, observable_gauge,\n * observable_up_down_counter, up_down_counter.\n * If omitted or null, all instrument types match.\n */\n instrument_type?: InstrumentType;\n\n /**\n * Configure the instrument unit selection criteria.\n * If omitted or null, all instrument units match.\n */\n unit?: string;\n\n /**\n * Configure meter name selection criteria.\n * If omitted or null, all meter names match.\n */\n meter_name?: string;\n\n /**\n * Configure meter version selection criteria.\n * If omitted or null, all meter versions match.\n */\n meter_version?: string;\n\n /**\n * Configure meter schema url selection criteria.\n * If omitted or null, all meter schema URLs match.\n */\n meter_schema_url?: string;\n}\n\nexport enum InstrumentType {\n Counter = 'counter',\n Gauge = 'gauge',\n Histogram = 'histogram',\n ObservableCounter = 'observable_counter',\n ObservableGauge = 'observable_gauge',\n ObservableUpDownCounter = 'observable_up_down_counter',\n UpDownCounter = 'up_down_counter',\n}\n\nexport interface ViewStream {\n /**\n * Configure metric name of the resulting stream(s).\n * If omitted or null, the instrument's original name is used.\n */\n name?: string;\n\n /**\n * Configure metric description of the resulting stream(s).\n * If omitted or null, the instrument's origin description is used.\n */\n description?: string;\n\n /**\n * Configure aggregation of the resulting stream(s).\n * Values include: default, drop, explicit_bucket_histogram, base2_exponential_bucket_histogram, last_value, sum.\n * If omitted, default is used.\n */\n aggregation?: Aggregation;\n\n /**\n * Configure the aggregation cardinality limit.\n * If omitted or null, the metric reader's default cardinality limit is used.\n */\n aggregation_cardinality_limit?: number;\n\n /**\n * Configure attribute keys retained in the resulting stream(s).\n */\n attribute_keys?: IncludeExclude;\n}\n\nexport interface Aggregation {\n /**\n * Configure aggregation to be default.\n */\n default?: object;\n\n /**\n * Configure aggregation to be drop.\n */\n drop?: object;\n\n /**\n * Configure aggregation to be explicit_bucket_histogram.\n */\n explicit_bucket_histogram?: ExplicitBucketHistogramAggregation;\n\n /**\n * Configure aggregation to be base2_exponential_bucket_histogram.\n */\n base2_exponential_bucket_histogram?: Base2ExponentialBucketHistogramAggregation;\n\n /**\n * Configure aggregation to be last_value.\n */\n last_value?: object;\n\n /**\n * Configure aggregation to be sum.\n */\n sum?: object;\n}\n\nexport interface ExplicitBucketHistogramAggregation {\n /**\n * Configure bucket boundaries.\n * If omitted, [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000] is used.\n */\n boundaries?: number[];\n\n /**\n * Configure record min and max.\n * If omitted or null, true is used.\n */\n record_min_max?: boolean;\n}\n\nexport interface Base2ExponentialBucketHistogramAggregation {\n /**\n * Configure max_scale.\n */\n max_scale?: number;\n\n /**\n * Configure max_size.\n */\n max_size?: number;\n\n /**\n * Configure record min and max.\n * If omitted or null, true is used.\n */\n record_min_max?: boolean;\n}\n"]}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
4
|
*/
|
|
16
5
|
'use strict';
|
|
17
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceModel.js","sourceRoot":"","sources":["../../../src/models/resourceModel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"resourceModel.js","sourceRoot":"","sources":["../../../src/models/resourceModel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,YAAY,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n'use strict';\n\nimport { IncludeExclude } from './commonModel';\n\nexport interface Resource {\n /**\n * Configure resource attributes. Entries have higher priority than entries from .resource.attributes_list.\n * Entries must contain .name and .value, and may optionally include .type. If an entry's .type omitted or null, string is used.\n * The .value's type must match the .type. Values for .type include: string, bool, int, double, string_array, bool_array, int_array, double_array.\n */\n attributes?: AttributeNameValue[];\n\n /**\n * Configure resource attributes. Entries have lower priority than entries from .resource.attributes.\n * The value is a list of comma separated key-value pairs matching the format of OTEL_RESOURCE_ATTRIBUTES.\n * If omitted or null, no resource attributes are added.\n */\n attributes_list?: string;\n\n /**\n * Configure resource schema URL.\n * If omitted or null, no schema URL is used.\n */\n schema_url?: string;\n\n /**\n * Configure resource detection.\n * This type is in development and subject to breaking changes in minor versions.\n * If omitted or null, resource detection is disabled.\n */\n 'detection/development'?: ExperimentalResourceDetection;\n}\n\nexport interface AttributeNameValue {\n name: string;\n value:\n | string\n | boolean\n | number\n | string[]\n | boolean[]\n | number[]\n | undefined;\n type?:\n | 'string'\n | 'bool'\n | 'int'\n | 'double'\n | 'string_array'\n | 'bool_array'\n | 'int_array'\n | 'double_array';\n}\n\nexport interface ExperimentalResourceDetection {\n /**\n * Configure attributes provided by resource detectors.\n */\n attributes?: IncludeExclude;\n\n /**\n * Configure resource detectors.\n * Resource detector names are dependent on the SDK language ecosystem. Please consult documentation for each respective language.\n * If omitted or null, no resource detectors are enabled.\n */\n detectors?: ExperimentalResourceDetector;\n}\n\nexport interface ExperimentalResourceDetector {\n /**\n * Enable the container resource detector, which populates container.* attributes.\n */\n container?: object;\n\n /**\n * Enable the host resource detector, which populates host.* and os.* attributes.\n */\n host?: object;\n\n /**\n * Enable the process resource detector, which populates process.* attributes.\n */\n process?: object;\n\n /**\n * Enable the service detector, which populates service.name based on the OTEL_SERVICE_NAME\n * environment variable and service.instance.id.\n */\n service?: object;\n}\n"]}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright The OpenTelemetry Authors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
15
4
|
*/
|
|
16
5
|
'use strict';
|
|
17
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracerProviderModel.js","sourceRoot":"","sources":["../../../src/models/tracerProviderModel.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tracerProviderModel.js","sourceRoot":"","sources":["../../../src/models/tracerProviderModel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,YAAY,CAAC;;;AAQb,SAAgB,4CAA4C;IAC1D,OAAO;QACL,UAAU,EAAE,EAAE;QACd,MAAM,EAAE;YACN,qBAAqB,EAAE,GAAG;YAC1B,iBAAiB,EAAE,GAAG;YACtB,gBAAgB,EAAE,GAAG;YACrB,2BAA2B,EAAE,GAAG;YAChC,0BAA0B,EAAE,GAAG;SAChC;QACD,OAAO,EAAE;YACP,YAAY,EAAE;gBACZ,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE;gBAC9B,qBAAqB,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE;gBAC/C,yBAAyB,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;gBACpD,oBAAoB,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE;gBAC9C,wBAAwB,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;aACpD;SACF;KACF,CAAC;AACJ,CAAC;AApBD,oGAoBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n'use strict';\n\nimport {\n ExperimentalOtlpFileExporter,\n OtlpGrpcExporter,\n OtlpHttpExporter,\n} from './commonModel';\n\nexport function initializeDefaultTracerProviderConfiguration(): Required<TracerProvider> {\n return {\n processors: [],\n limits: {\n attribute_count_limit: 128,\n event_count_limit: 128,\n link_count_limit: 128,\n event_attribute_count_limit: 128,\n link_attribute_count_limit: 128,\n },\n sampler: {\n parent_based: {\n root: { always_on: undefined },\n remote_parent_sampled: { always_on: undefined },\n remote_parent_not_sampled: { always_off: undefined },\n local_parent_sampled: { always_on: undefined },\n local_parent_not_sampled: { always_off: undefined },\n },\n },\n };\n}\n\nexport interface TracerProvider {\n /**\n * Configure span processors.\n */\n processors: SpanProcessor[];\n\n /**\n * Configure span limits. See also attribute_limits.\n */\n limits?: SpanLimits;\n\n /**\n * Configure the sampler.\n * If omitted, parent based sampler with a root of always_on is used.\n */\n sampler?: Sampler;\n}\n\nexport interface BatchSpanProcessor {\n /**\n * Configure delay interval (in milliseconds) between two consecutive exports.\n * Value must be non-negative.\n * If omitted or null, 5000 is used for traces and 1000 for logs.\n */\n schedule_delay?: number;\n\n /**\n * Configure maximum allowed time (in milliseconds) to export data.\n * Value must be non-negative. A value of 0 indicates no limit (infinity).\n * If omitted or null, 30000 is used.\n */\n export_timeout?: number;\n\n /**\n * Configure maximum queue size. Value must be positive.\n * If omitted or null, 2048 is used.\n */\n max_queue_size?: number;\n\n /**\n * Configure maximum batch size. Value must be positive.\n * If omitted or null, 512 is used.\n */\n max_export_batch_size?: number;\n\n /**\n * Configure exporter.\n */\n exporter: SpanExporter;\n}\n\nexport interface Sampler {\n /**\n * Configure sampler to be parent_based.\n */\n parent_based?: ParentBasedSampler;\n\n /**\n * Configure sampler to be always_off.\n */\n always_off?: object;\n\n /**\n * Configure sampler to be always_on.\n */\n always_on?: object;\n\n /***\n * Configure sampler to be trace_id_ratio_based.\n */\n trace_id_ratio_based?: TraceIdRatioBasedSampler;\n}\n\nexport interface ParentBasedSampler {\n /**\n * Configure root sampler.\n * If omitted or null, always_on is used.\n */\n root?: Sampler;\n\n /**\n * Configure remote_parent_sampled sampler.\n * If omitted or null, always_on is used.\n */\n remote_parent_sampled?: Sampler;\n\n /**\n * Configure remote_parent_not_sampled sampler.\n * If omitted or null, always_off is used.\n */\n remote_parent_not_sampled?: Sampler;\n\n /**\n * Configure local_parent_sampled sampler.\n * If omitted or null, always_on is used.\n */\n local_parent_sampled?: Sampler;\n\n /**\n * Configure local_parent_not_sampled sampler.\n * If omitted or null, always_off is used.\n */\n local_parent_not_sampled?: Sampler;\n}\n\nexport interface TraceIdRatioBasedSampler {\n /**\n * Configure trace_id_ratio.\n */\n ratio?: number;\n}\n\nexport interface SimpleSpanProcessor {\n /**\n * Configure exporter.\n */\n exporter: SpanExporter;\n}\n\nexport interface SpanExporter {\n /**\n * Configure exporter to be OTLP with HTTP transport.\n */\n otlp_http?: OtlpHttpExporter;\n\n /**\n * Configure exporter to be OTLP with gRPC transport.\n */\n otlp_grpc?: OtlpGrpcExporter;\n\n /**\n * Configure exporter to be OTLP with file transport.\n * This type is in development and subject to breaking changes in minor versions.\n */\n 'otlp_file/development'?: ExperimentalOtlpFileExporter;\n\n /**\n * Configure exporter to be console.\n */\n console?: object;\n}\n\nexport interface SpanLimits {\n /**\n * Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit.\n * Value must be non-negative.\n * If omitted or null, there is no limit.\n */\n attribute_value_length_limit?: number;\n\n /**\n * Configure max attribute count. Overrides .attribute_limits.attribute_count_limit.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n attribute_count_limit?: number;\n\n /**\n * Configure max span event count.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n event_count_limit?: number;\n\n /**\n * Configure max span link count.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n link_count_limit?: number;\n\n /**\n * Configure max attributes per span event.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n event_attribute_count_limit?: number;\n\n /**\n * Configure max attributes per span link.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n link_attribute_count_limit?: number;\n}\n\nexport interface SpanProcessor {\n /**\n * Configure a batch span processor.\n */\n batch?: BatchSpanProcessor;\n\n /**\n * Configure a simple span processor.\n */\n simple?: SimpleSpanProcessor;\n}\n"]}
|
package/build/src/utils.js
CHANGED
|
@@ -3,18 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getHttpTlsConfig = exports.getGrpcTlsConfig = exports.envVariableSubstitution = exports.getStringListFromConfigFile = exports.getStringFromConfigFile = exports.getNumberListFromConfigFile = exports.getNumberFromConfigFile = exports.getBooleanListFromConfigFile = exports.getBooleanFromConfigFile = void 0;
|
|
4
4
|
/*
|
|
5
5
|
* Copyright The OpenTelemetry Authors
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
6
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
18
7
|
*/
|
|
19
8
|
const api_1 = require("@opentelemetry/api");
|
|
20
9
|
const core_1 = require("@opentelemetry/core");
|
package/build/src/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,4CAA0C;AAC1C,8CAAuD;AACvD,+BAA+B;AAG/B;;;;;;;;GAQG;AACH,SAAgB,wBAAwB,CAAC,KAAc;IACrD,MAAM,GAAG,GAAG,uBAAuB,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACjE,IAAI,GAAG,KAAK,MAAM,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;SAAM,IAAI,GAAG,KAAK,OAAO,EAAE;QAC1B,OAAO,KAAK,CAAC;KACd;SAAM,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,KAAK,EAAE,EAAE;QACpC,OAAO,SAAS,CAAC;KAClB;SAAM;QACL,UAAI,CAAC,IAAI,CAAC,iBAAiB,IAAA,cAAO,EAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QACvE,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAZD,4DAYC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,4BAA4B,CAC1C,KAAc;IAEd,MAAM,IAAI,GAAG,uBAAuB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACxD,IAAI,IAAI,EAAE;QACR,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,MAAM,OAAO,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAClD,IAAI,OAAO,IAAI,IAAI,EAAE;gBACnB,YAAY,CA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W,CAAC,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;SACvD;QACD,OAAO,WAAW,CAAC;KACpB;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAjBD,0DAiBC;AAED,SAAgB,gBAAgB,CAC9B,eAAwB,EACxB,aAAsB,EACtB,qBAA8B,EAC9B,QAAkB;IAElB,IAAI,eAAe,IAAI,aAAa,IAAI,qBAAqB,EAAE;QAC7D,MAAM,GAAG,GAAY,EAAE,CAAC;QACxB,IAAI,eAAe,EAAE;YACnB,GAAG,CAAC,OAAO,GAAG,eAAe,CAAC;SAC/B;QACD,IAAI,aAAa,EAAE;YACjB,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC;SAC9B;QACD,IAAI,qBAAqB,EAAE;YACzB,GAAG,CAAC,SAAS,GAAG,qBAAqB,CAAC;SACvC;QACD,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;SACzB;QACD,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAvBD,4CAuBC;AAED,SAAgB,gBAAgB,CAC9B,eAAwB,EACxB,aAAsB,EACtB,qBAA8B;IAE9B,IAAI,eAAe,IAAI,aAAa,IAAI,qBAAqB,EAAE;QAC7D,MAAM,GAAG,GAAY,EAAE,CAAC;QACxB,IAAI,eAAe,EAAE;YACnB,GAAG,CAAC,OAAO,GAAG,eAAe,CAAC;SAC/B;QACD,IAAI,aAAa,EAAE;YACjB,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC;SAC9B;QACD,IAAI,qBAAqB,EAAE;YACzB,GAAG,CAAC,SAAS,GAAG,qBAAqB,CAAC;SACvC;QACD,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAnBD,4CAmBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { diag } from '@opentelemetry/api';\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport { inspect } from 'util';\nimport { GrpcTls, HttpTls } from './models/commonModel';\n\n/**\n * Retrieves a boolean value from a configuration file parameter.\n * - Trims leading and trailing whitespace and ignores casing.\n * - Returns `undefined` if the value is empty, unset, or contains only whitespace.\n * - Returns `undefined` and a warning for values that cannot be mapped to a boolean.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace.\n */\nexport function getBooleanFromConfigFile(value: unknown): boolean | undefined {\n const raw = envVariableSubstitution(value)?.trim().toLowerCase();\n if (raw === 'true') {\n return true;\n } else if (raw === 'false') {\n return false;\n } else if (raw == null || raw === '') {\n return undefined;\n } else {\n diag.warn(`Unknown value ${inspect(raw)}, expected 'true' or 'false'`);\n return undefined;\n }\n}\n\n/**\n * Retrieves a list of booleans from a configuration file parameter.\n * - Uses ',' as the delimiter.\n * - Trims leading and trailing whitespace from each entry.\n * - Excludes empty entries.\n * - Returns `undefined` if the variable is empty or contains only whitespace.\n * - Returns an empty array if all entries are empty or whitespace.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {boolean[] | undefined} - The list of strings or `undefined`.\n */\nexport function getBooleanListFromConfigFile(\n value: unknown\n): boolean[] | undefined {\n const list = getStringFromConfigFile(value)?.split(',');\n if (list) {\n const filteredList = [];\n for (let i = 0; i < list.length; i++) {\n const element = getBooleanFromConfigFile(list[i]);\n if (element != null) {\n filteredList.push(element);\n }\n }\n return filteredList;\n }\n return list;\n}\n\n/**\n * Retrieves a number from a configuration file parameter.\n * - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace.\n * - Returns `undefined` and a warning if is not a number.\n * - Returns a number in all other cases.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {number | undefined} - The number value or `undefined`.\n */\nexport function getNumberFromConfigFile(value: unknown): number | undefined {\n const raw = envVariableSubstitution(value)?.trim();\n if (raw == null || raw.trim() === '') {\n return undefined;\n }\n\n const n = Number(raw);\n if (isNaN(n)) {\n diag.warn(`Unknown value ${inspect(raw)}, expected a number`);\n return undefined;\n }\n\n return n;\n}\n\n/**\n * Retrieves a list of numbers from a configuration file parameter.\n * - Uses ',' as the delimiter.\n * - Trims leading and trailing whitespace from each entry.\n * - Excludes empty entries.\n * - Returns `undefined` if the variable is empty or contains only whitespace.\n * - Returns an empty array if all entries are empty or whitespace.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {number[] | undefined} - The list of numbers or `undefined`.\n */\nexport function getNumberListFromConfigFile(\n value: unknown\n): number[] | undefined {\n const list = getStringFromConfigFile(value)?.split(',');\n if (list) {\n const filteredList = [];\n for (let i = 0; i < list.length; i++) {\n const element = getNumberFromConfigFile(list[i]);\n if (element || element === 0) {\n filteredList.push(element);\n }\n }\n return filteredList;\n }\n return list;\n}\n\n/**\n * Retrieves a string from a configuration file parameter.\n * - Returns `undefined` if the variable is empty, unset, or contains only whitespace.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {string | undefined} - The string value or `undefined`.\n */\nexport function getStringFromConfigFile(value: unknown): string | undefined {\n const raw = envVariableSubstitution(value)?.trim();\n if (value == null || raw === '') {\n return undefined;\n }\n return raw;\n}\n\n/**\n * Retrieves a list of strings from a configuration file parameter.\n * - Uses ',' as the delimiter.\n * - Trims leading and trailing whitespace from each entry.\n * - Excludes empty entries.\n * - Returns `undefined` if the variable is empty or contains only whitespace.\n * - Returns an empty array if all entries are empty or whitespace.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {string[] | undefined} - The list of strings or `undefined`.\n */\nexport function getStringListFromConfigFile(\n value: unknown\n): string[] | undefined {\n value = envVariableSubstitution(value);\n return getStringFromConfigFile(value)\n ?.split(',')\n .map(v => v.trim())\n .filter(s => s !== '');\n}\n\nexport function envVariableSubstitution(value: unknown): string | undefined {\n if (value == null) {\n return undefined;\n }\n\n const matches = String(value).match(/\\$\\{[a-zA-Z0-9,=/_:.-]*\\}/g);\n if (matches) {\n let stringValue = String(value);\n for (const match of matches) {\n const v = match.substring(2, match.length - 1).split(':-');\n const defaultValue = v.length === 2 ? v[1] : '';\n const replacement = getStringFromEnv(v[0]) || defaultValue;\n stringValue = stringValue.replace(match, replacement);\n }\n return stringValue;\n }\n return String(value);\n}\n\nexport function getGrpcTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string,\n insecure?: boolean\n): GrpcTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: GrpcTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n if (insecure !== undefined) {\n tls.insecure = insecure;\n }\n return tls;\n }\n return undefined;\n}\n\nexport function getHttpTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string\n): HttpTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: HttpTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n return tls;\n }\n return undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,4CAA0C;AAC1C,8CAAuD;AACvD,+BAA+B;AAG/B;;;;;;;;GAQG;AACH,SAAgB,wBAAwB,CAAC,KAAc;IACrD,MAAM,GAAG,GAAG,uBAAuB,CA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AC;SAC/B;QACD,IAAI,aAAa,EAAE;YACjB,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC;SAC9B;QACD,IAAI,qBAAqB,EAAE;YACzB,GAAG,CAAC,SAAS,GAAG,qBAAqB,CAAC;SACvC;QACD,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;SACzB;QACD,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAvBD,4CAuBC;AAED,SAAgB,gBAAgB,CAC9B,eAAwB,EACxB,aAAsB,EACtB,qBAA8B;IAE9B,IAAI,eAAe,IAAI,aAAa,IAAI,qBAAqB,EAAE;QAC7D,MAAM,GAAG,GAAY,EAAE,CAAC;QACxB,IAAI,eAAe,EAAE;YACnB,GAAG,CAAC,OAAO,GAAG,eAAe,CAAC;SAC/B;QACD,IAAI,aAAa,EAAE;YACjB,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC;SAC9B;QACD,IAAI,qBAAqB,EAAE;YACzB,GAAG,CAAC,SAAS,GAAG,qBAAqB,CAAC;SACvC;QACD,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAnBD,4CAmBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport { inspect } from 'util';\nimport { GrpcTls, HttpTls } from './models/commonModel';\n\n/**\n * Retrieves a boolean value from a configuration file parameter.\n * - Trims leading and trailing whitespace and ignores casing.\n * - Returns `undefined` if the value is empty, unset, or contains only whitespace.\n * - Returns `undefined` and a warning for values that cannot be mapped to a boolean.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace.\n */\nexport function getBooleanFromConfigFile(value: unknown): boolean | undefined {\n const raw = envVariableSubstitution(value)?.trim().toLowerCase();\n if (raw === 'true') {\n return true;\n } else if (raw === 'false') {\n return false;\n } else if (raw == null || raw === '') {\n return undefined;\n } else {\n diag.warn(`Unknown value ${inspect(raw)}, expected 'true' or 'false'`);\n return undefined;\n }\n}\n\n/**\n * Retrieves a list of booleans from a configuration file parameter.\n * - Uses ',' as the delimiter.\n * - Trims leading and trailing whitespace from each entry.\n * - Excludes empty entries.\n * - Returns `undefined` if the variable is empty or contains only whitespace.\n * - Returns an empty array if all entries are empty or whitespace.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {boolean[] | undefined} - The list of strings or `undefined`.\n */\nexport function getBooleanListFromConfigFile(\n value: unknown\n): boolean[] | undefined {\n const list = getStringFromConfigFile(value)?.split(',');\n if (list) {\n const filteredList = [];\n for (let i = 0; i < list.length; i++) {\n const element = getBooleanFromConfigFile(list[i]);\n if (element != null) {\n filteredList.push(element);\n }\n }\n return filteredList;\n }\n return list;\n}\n\n/**\n * Retrieves a number from a configuration file parameter.\n * - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace.\n * - Returns `undefined` and a warning if is not a number.\n * - Returns a number in all other cases.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {number | undefined} - The number value or `undefined`.\n */\nexport function getNumberFromConfigFile(value: unknown): number | undefined {\n const raw = envVariableSubstitution(value)?.trim();\n if (raw == null || raw.trim() === '') {\n return undefined;\n }\n\n const n = Number(raw);\n if (isNaN(n)) {\n diag.warn(`Unknown value ${inspect(raw)}, expected a number`);\n return undefined;\n }\n\n return n;\n}\n\n/**\n * Retrieves a list of numbers from a configuration file parameter.\n * - Uses ',' as the delimiter.\n * - Trims leading and trailing whitespace from each entry.\n * - Excludes empty entries.\n * - Returns `undefined` if the variable is empty or contains only whitespace.\n * - Returns an empty array if all entries are empty or whitespace.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {number[] | undefined} - The list of numbers or `undefined`.\n */\nexport function getNumberListFromConfigFile(\n value: unknown\n): number[] | undefined {\n const list = getStringFromConfigFile(value)?.split(',');\n if (list) {\n const filteredList = [];\n for (let i = 0; i < list.length; i++) {\n const element = getNumberFromConfigFile(list[i]);\n if (element || element === 0) {\n filteredList.push(element);\n }\n }\n return filteredList;\n }\n return list;\n}\n\n/**\n * Retrieves a string from a configuration file parameter.\n * - Returns `undefined` if the variable is empty, unset, or contains only whitespace.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {string | undefined} - The string value or `undefined`.\n */\nexport function getStringFromConfigFile(value: unknown): string | undefined {\n const raw = envVariableSubstitution(value)?.trim();\n if (value == null || raw === '') {\n return undefined;\n }\n return raw;\n}\n\n/**\n * Retrieves a list of strings from a configuration file parameter.\n * - Uses ',' as the delimiter.\n * - Trims leading and trailing whitespace from each entry.\n * - Excludes empty entries.\n * - Returns `undefined` if the variable is empty or contains only whitespace.\n * - Returns an empty array if all entries are empty or whitespace.\n *\n * @param {unknown} value - The value from the config file.\n * @returns {string[] | undefined} - The list of strings or `undefined`.\n */\nexport function getStringListFromConfigFile(\n value: unknown\n): string[] | undefined {\n value = envVariableSubstitution(value);\n return getStringFromConfigFile(value)\n ?.split(',')\n .map(v => v.trim())\n .filter(s => s !== '');\n}\n\nexport function envVariableSubstitution(value: unknown): string | undefined {\n if (value == null) {\n return undefined;\n }\n\n const matches = String(value).match(/\\$\\{[a-zA-Z0-9,=/_:.-]*\\}/g);\n if (matches) {\n let stringValue = String(value);\n for (const match of matches) {\n const v = match.substring(2, match.length - 1).split(':-');\n const defaultValue = v.length === 2 ? v[1] : '';\n const replacement = getStringFromEnv(v[0]) || defaultValue;\n stringValue = stringValue.replace(match, replacement);\n }\n return stringValue;\n }\n return String(value);\n}\n\nexport function getGrpcTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string,\n insecure?: boolean\n): GrpcTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: GrpcTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n if (insecure !== undefined) {\n tls.insecure = insecure;\n }\n return tls;\n }\n return undefined;\n}\n\nexport function getHttpTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string\n): HttpTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: HttpTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n return tls;\n }\n return undefined;\n}\n"]}
|
package/build/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.213.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/build/src/version.js
CHANGED
package/build/src/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.213.0';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentelemetry/configuration",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.213.0",
|
|
4
4
|
"description": "OpenTelemetry Configuration",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"types": "build/src/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@opentelemetry/core": "2.
|
|
41
|
+
"@opentelemetry/core": "2.6.0",
|
|
42
42
|
"yaml": "^2.0.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
},
|
|
58
58
|
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/configuration",
|
|
59
59
|
"sideEffects": false,
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "541e1b4ad83ad2093459794a18283228fe58d199"
|
|
61
61
|
}
|