Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@opentelemetry/configuration

Package Overview
Dependencies
Maintainers
6
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/configuration - npm Package Compare versions

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

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

+3
-1

@@ -8,6 +8,8 @@ "use strict";

exports.createConfigFactory = void 0;
const core_1 = require("@opentelemetry/core");
const EnvironmentConfigFactory_1 = require("./EnvironmentConfigFactory");
const FileConfigFactory_1 = require("./FileConfigFactory");
function createConfigFactory() {
if ((0, FileConfigFactory_1.hasValidConfigFile)()) {
const configFile = (0, core_1.getStringFromEnv)('OTEL_CONFIG_FILE');
if (configFile) {
return new FileConfigFactory_1.FileConfigFactory();

@@ -14,0 +16,0 @@ }

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

{"version":3,"file":"ConfigFactory.js","sourceRoot":"","sources":["../../src/ConfigFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAAsE;AACtE,2DAA4E;AAE5E,SAAgB,mBAAmB;IACjC,IAAI,IAAA,sCAAkB,GAAE,EAAE;QACxB,OAAO,IAAI,qCAAiB,EAAE,CAAC;KAChC;IACD,OAAO,IAAI,mDAAwB,EAAE,CAAC;AACxC,CAAC;AALD,kDAKC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ConfigFactory } from './IConfigFactory';\nimport { EnvironmentConfigFactory } from './EnvironmentConfigFactory';\nimport { FileConfigFactory, hasValidConfigFile } from './FileConfigFactory';\n\nexport function createConfigFactory(): ConfigFactory {\n if (hasValidConfigFile()) {\n return new FileConfigFactory();\n }\n return new EnvironmentConfigFactory();\n}\n"]}
{"version":3,"file":"ConfigFactory.js","sourceRoot":"","sources":["../../src/ConfigFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,8CAAuD;AAEvD,yEAAsE;AACtE,2DAAwD;AAExD,SAAgB,mBAAmB;IACjC,MAAM,UAAU,GAAG,IAAA,uBAAgB,EAAC,kBAAkB,CAAC,CAAC;IACxD,IAAI,UAAU,EAAE;QACd,OAAO,IAAI,qCAAiB,EAAE,CAAC;KAChC;IACD,OAAO,IAAI,mDAAwB,EAAE,CAAC;AACxC,CAAC;AAND,kDAMC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport type { ConfigFactory } from './IConfigFactory';\nimport { EnvironmentConfigFactory } from './EnvironmentConfigFactory';\nimport { FileConfigFactory } from './FileConfigFactory';\n\nexport function createConfigFactory(): ConfigFactory {\n const configFile = getStringFromEnv('OTEL_CONFIG_FILE');\n if (configFile) {\n return new FileConfigFactory();\n }\n return new EnvironmentConfigFactory();\n}\n"]}

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

import type { ConfigurationModel } from './models/configModel';
import type { ConfigFactory } from './IConfigFactory';
import type { ConfigurationModel } from './generated/types';
import type { EnvValues } from './EnvReader';

@@ -4,0 +4,0 @@ /**

@@ -8,9 +8,4 @@ "use strict";

exports.setLoggerProvider = exports.setMeterProvider = exports.setTracerProvider = exports.setSampler = exports.setPropagators = exports.setAttributeLimits = exports.setResources = exports.EnvironmentConfigFactory = void 0;
const configModel_1 = require("./models/configModel");
const core_1 = require("@opentelemetry/core");
const meterProviderModel_1 = require("./models/meterProviderModel");
const commonModel_1 = require("./models/commonModel");
const api_1 = require("@opentelemetry/api");
const tracerProviderModel_1 = require("./models/tracerProviderModel");
const loggerProviderModel_1 = require("./models/loggerProviderModel");
const utils_1 = require("./utils");

@@ -25,8 +20,9 @@ const EnvReader_1 = require("./EnvReader");

constructor() {
this._config = (0, configModel_1.initializeDefaultConfiguration)();
this._config = (0, utils_1.initializeDefaultConfiguration)();
const envValues = (0, EnvReader_1.readAllEnvVars)();
this._config.disabled = envValues.OTEL_SDK_DISABLED;
const logLevel = (0, core_1.diagLogLevelFromString)((0, core_1.getStringFromEnv)('OTEL_LOG_LEVEL'));
if (logLevel) {
this._config.log_level = logLevel;
const logLevelString = (0, core_1.getStringFromEnv)('OTEL_LOG_LEVEL');
if (logLevelString) {
this._config.log_level =
severityNumberConfigFromLogLevelString(logLevelString);
}

@@ -45,2 +41,32 @@ setResources(this._config);

exports.EnvironmentConfigFactory = EnvironmentConfigFactory;
const SEV_NUM_CONFIG_FROM_LOG_LEVEL = {
// Declarative config `log_level` has no "NONE". Using 'fatal' is
// equivalent, because the OTel JS diag API does not have a "fatal" level.
NONE: 'fatal',
ERROR: 'error',
WARN: 'warn',
INFO: 'info',
DEBUG: 'debug',
VERBOSE: 'trace2',
// Declarative config `log_level` has no "ALL". Using 'trace' is
// equivalent, because that is the lowest SeverityNumber level.
ALL: 'trace',
};
/**
* Return a declarative config SeverityNumberConfig value (as used for
* `log_level`) for the given `OTEL_LOG_LEVEL` string value.
*
* See notes at "opentelemetr-sdk-node/src/diag.ts".
*/
function severityNumberConfigFromLogLevelString(str) {
if (!str) {
return undefined;
}
const sevNumConfig = SEV_NUM_CONFIG_FROM_LOG_LEVEL[str.toUpperCase()];
if (!sevNumConfig) {
api_1.diag.warn(`Unknown log level "${str}", expected one of ${Object.keys(SEV_NUM_CONFIG_FROM_LOG_LEVEL)}, using default info`);
return 'info';
}
return sevNumConfig;
}
function setResources(config) {

@@ -133,4 +159,18 @@ if (config.resource == null) {

config.propagator.composite = [];
for (let i = 0; i < composite.length; i++) {
config.propagator.composite.push({ [composite[i]]: null });
for (const name of composite) {
if (name === 'tracecontext') {
config.propagator.composite.push({ tracecontext: {} });
}
else if (name === 'baggage') {
config.propagator.composite.push({ baggage: {} });
}
else if (name === 'b3') {
config.propagator.composite.push({ b3: {} });
}
else if (name === 'b3multi') {
config.propagator.composite.push({ b3multi: {} });
}
else {
config.propagator.composite.push({ [name]: {} });
}
}

@@ -193,3 +233,3 @@ }

}
config.tracer_provider = (0, tracerProviderModel_1.initializeDefaultTracerProviderConfiguration)();
config.tracer_provider = (0, utils_1.initializeDefaultTracerProviderConfiguration)();
setSampler(config, env);

@@ -223,29 +263,22 @@ const attributeValueLengthLimit = (0, core_1.getNumberFromEnv)('OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT');

}
const batch = { exporter: {} };
const scheduleDelay = (0, core_1.getNumberFromEnv)('OTEL_BSP_SCHEDULE_DELAY') ?? 5000;
if (scheduleDelay) {
batch.schedule_delay = scheduleDelay;
}
const exportTimeout = (0, core_1.getNumberFromEnv)('OTEL_BSP_EXPORT_TIMEOUT') ?? 30000;
if (exportTimeout) {
batch.export_timeout = exportTimeout;
}
const maxQueueSize = (0, core_1.getNumberFromEnv)('OTEL_BSP_MAX_QUEUE_SIZE') ?? 2048;
if (maxQueueSize) {
batch.max_queue_size = maxQueueSize;
}
const maxExportBatchSize = (0, core_1.getNumberFromEnv)('OTEL_BSP_MAX_EXPORT_BATCH_SIZE') ?? 512;
if (maxExportBatchSize) {
batch.max_export_batch_size = maxExportBatchSize;
}
const batch = {
exporter: {},
schedule_delay: (0, core_1.getNumberFromEnv)('OTEL_BSP_SCHEDULE_DELAY') ?? 5000,
export_timeout: (0, core_1.getNumberFromEnv)('OTEL_BSP_EXPORT_TIMEOUT') ?? 30000,
max_queue_size: (0, core_1.getNumberFromEnv)('OTEL_BSP_MAX_QUEUE_SIZE') ?? 2048,
max_export_batch_size: (0, core_1.getNumberFromEnv)('OTEL_BSP_MAX_EXPORT_BATCH_SIZE') ?? 512,
};
for (let i = 0; i < exportersType.length; i++) {
const exporterType = exportersType[i];
const batchInfo = { ...batch };
const batchInfo = {
...batch,
exporter: {},
};
if (exporterType === 'console') {
config.tracer_provider.processors.push({
const processor = {
simple: { exporter: { console: {} } },
});
};
config.tracer_provider.processors.push(processor);
}
else {
// 'otlp' and default
const protocol = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_TRACES_PROTOCOL') ??

@@ -268,56 +301,36 @@ (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_PROTOCOL') ??

if (protocol === 'grpc') {
delete batchInfo.exporter.otlp_http;
batchInfo.exporter.otlp_grpc = {};
const endpoint = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT') ??
(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT') ??
'http://localhost:4317';
if (endpoint) {
batchInfo.exporter.otlp_grpc.endpoint = endpoint;
}
const tls = (0, utils_1.getGrpcTlsConfig)(certificateFile, clientKeyFile, clientCertificateFile);
if (tls) {
batchInfo.exporter.otlp_grpc.tls = tls;
}
if (compression) {
batchInfo.exporter.otlp_grpc.compression = compression;
}
if (timeout) {
batchInfo.exporter.otlp_grpc.timeout = timeout;
}
if (headersList) {
batchInfo.exporter.otlp_grpc.headers_list = headersList;
}
const otlpGrpc = {
endpoint: (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT') ??
(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT') ??
'http://localhost:4317',
timeout,
...(tls !== undefined && { tls }),
...(compression !== undefined && { compression }),
...(headersList !== undefined && { headers_list: headersList }),
};
batchInfo.exporter = { otlp_grpc: otlpGrpc };
}
else {
if (batchInfo.exporter.otlp_http == null) {
batchInfo.exporter.otlp_http = {};
}
const endpoint = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT') ??
((0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT')
? `${(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT')}/v1/traces`
: 'http://localhost:4318/v1/traces');
if (endpoint) {
batchInfo.exporter.otlp_http.endpoint = endpoint;
}
const tls = (0, utils_1.getHttpTlsConfig)(certificateFile, clientKeyFile, clientCertificateFile);
if (tls) {
batchInfo.exporter.otlp_http.tls = tls;
}
if (compression) {
batchInfo.exporter.otlp_http.compression = compression;
}
if (timeout) {
batchInfo.exporter.otlp_http.timeout = timeout;
}
if (headersList) {
batchInfo.exporter.otlp_http.headers_list = headersList;
}
if (protocol === 'http/json') {
batchInfo.exporter.otlp_http.encoding = commonModel_1.OtlpHttpEncoding.JSON;
}
else if (protocol === 'http/protobuf') {
batchInfo.exporter.otlp_http.encoding = commonModel_1.OtlpHttpEncoding.Protobuf;
}
const encoding = protocol === 'http/json'
? 'json'
: protocol === 'http/protobuf'
? 'protobuf'
: undefined;
const otlpHttp = {
endpoint: (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT') ??
((0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT')
? `${(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT')}/v1/traces`
: 'http://localhost:4318/v1/traces'),
timeout,
...(tls !== undefined && { tls }),
...(compression !== undefined && { compression }),
...(headersList !== undefined && { headers_list: headersList }),
...(encoding !== undefined && { encoding }),
};
batchInfo.exporter = { otlp_http: otlpHttp };
}
config.tracer_provider.processors.push({ batch: batchInfo });
const processor = { batch: batchInfo };
config.tracer_provider.processors.push(processor);
}

@@ -336,12 +349,7 @@ }

}
config.meter_provider = (0, meterProviderModel_1.initializeDefaultMeterProviderConfiguration)();
const readerPeriodic = { exporter: {} };
config.meter_provider = (0, utils_1.initializeDefaultMeterProviderConfiguration)();
const interval = (0, core_1.getNumberFromEnv)('OTEL_METRIC_EXPORT_INTERVAL') ?? 60000;
if (interval) {
readerPeriodic.interval = interval;
}
for (let i = 0; i < exportersType.length; i++) {
const exporterType = exportersType[i];
if (exporterType === 'prometheus') {
// Prometheus uses a pull reader
const pullReader = {

@@ -353,3 +361,3 @@ exporter: {

without_scope_info: false,
without_target_info: false,
'without_target_info/development': false,
},

@@ -361,7 +369,7 @@ },

}
const readerPeriodicInfo = { ...readerPeriodic };
const timeout = (0, core_1.getNumberFromEnv)('OTEL_METRIC_EXPORT_TIMEOUT') ?? 30000;
if (timeout) {
readerPeriodicInfo.timeout = timeout;
}
const readerPeriodicInfo = {
interval,
timeout: (0, core_1.getNumberFromEnv)('OTEL_METRIC_EXPORT_TIMEOUT') ?? 30000,
exporter: {},
};
if (exporterType === 'console') {

@@ -371,3 +379,2 @@ readerPeriodicInfo.exporter = { console: {} };

else {
// 'otlp' and default
const protocol = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_METRICS_PROTOCOL') ??

@@ -389,132 +396,52 @@ (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_PROTOCOL') ??

(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_HEADERS');
const temporalityPreference = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE') ??
const rawTemporality = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE') ??
'cumulative';
const defaultHistogramAggregation = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION') ?? 'explicit_bucket_histogram';
const validTemporalities = ['cumulative', 'delta', 'low_memory'];
const temporalityPreference = validTemporalities.includes(rawTemporality)
? rawTemporality
: 'cumulative';
const rawHistogramAgg = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION') ?? 'explicit_bucket_histogram';
const validHistogramAggs = [
'explicit_bucket_histogram',
'base2_exponential_bucket_histogram',
];
const defaultHistogramAggregation = validHistogramAggs.includes(rawHistogramAgg)
? rawHistogramAgg
: 'explicit_bucket_histogram';
if (protocol === 'grpc') {
delete readerPeriodicInfo.exporter.otlp_http;
readerPeriodicInfo.exporter.otlp_grpc = {};
const endpoint = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_METRICS_ENDPOINT') ??
(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT') ??
'http://localhost:4317';
if (endpoint) {
readerPeriodicInfo.exporter.otlp_grpc.endpoint = endpoint;
}
const tls = (0, utils_1.getGrpcTlsConfig)(certificateFile, clientKeyFile, clientCertificateFile);
if (tls) {
readerPeriodicInfo.exporter.otlp_grpc.tls = tls;
}
if (compression) {
readerPeriodicInfo.exporter.otlp_grpc.compression = compression;
}
if (timeoutExporter) {
readerPeriodicInfo.exporter.otlp_grpc.timeout = timeoutExporter;
}
if (headersList) {
readerPeriodicInfo.exporter.otlp_grpc.headers_list = headersList;
}
if (temporalityPreference) {
switch (temporalityPreference) {
case 'cumulative':
readerPeriodicInfo.exporter.otlp_grpc.temporality_preference =
meterProviderModel_1.ExporterTemporalityPreference.Cumulative;
break;
case 'delta':
readerPeriodicInfo.exporter.otlp_grpc.temporality_preference =
meterProviderModel_1.ExporterTemporalityPreference.Delta;
break;
case 'low_memory':
readerPeriodicInfo.exporter.otlp_grpc.temporality_preference =
meterProviderModel_1.ExporterTemporalityPreference.LowMemory;
break;
default:
readerPeriodicInfo.exporter.otlp_grpc.temporality_preference =
meterProviderModel_1.ExporterTemporalityPreference.Cumulative;
break;
}
}
if (defaultHistogramAggregation) {
switch (defaultHistogramAggregation) {
case 'explicit_bucket_histogram':
readerPeriodicInfo.exporter.otlp_grpc.default_histogram_aggregation =
meterProviderModel_1.ExporterDefaultHistogramAggregation.ExplicitBucketHistogram;
break;
case 'base2_exponential_bucket_histogram':
readerPeriodicInfo.exporter.otlp_grpc.default_histogram_aggregation =
meterProviderModel_1.ExporterDefaultHistogramAggregation.Base2ExponentialBucketHistogram;
break;
default:
readerPeriodicInfo.exporter.otlp_grpc.default_histogram_aggregation =
meterProviderModel_1.ExporterDefaultHistogramAggregation.ExplicitBucketHistogram;
break;
}
}
const otlpGrpc = {
endpoint: (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_METRICS_ENDPOINT') ??
(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT') ??
'http://localhost:4317',
timeout: timeoutExporter,
temporality_preference: temporalityPreference,
default_histogram_aggregation: defaultHistogramAggregation,
...(tls !== undefined && { tls }),
...(compression !== undefined && { compression }),
...(headersList !== undefined && { headers_list: headersList }),
};
readerPeriodicInfo.exporter = { otlp_grpc: otlpGrpc };
}
else {
if (readerPeriodicInfo.exporter.otlp_http == null) {
readerPeriodicInfo.exporter.otlp_http = {};
}
const endpoint = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_METRICS_ENDPOINT') ??
((0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT')
? `${(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT')}/v1/metrics`
: 'http://localhost:4318/v1/metrics');
if (endpoint) {
readerPeriodicInfo.exporter.otlp_http.endpoint = endpoint;
}
const tls = (0, utils_1.getHttpTlsConfig)(certificateFile, clientKeyFile, clientCertificateFile);
if (tls) {
readerPeriodicInfo.exporter.otlp_http.tls = tls;
}
if (compression) {
readerPeriodicInfo.exporter.otlp_http.compression = compression;
}
if (timeoutExporter) {
readerPeriodicInfo.exporter.otlp_http.timeout = timeoutExporter;
}
if (headersList) {
readerPeriodicInfo.exporter.otlp_http.headers_list = headersList;
}
if (temporalityPreference) {
switch (temporalityPreference) {
case 'cumulative':
readerPeriodicInfo.exporter.otlp_http.temporality_preference =
meterProviderModel_1.ExporterTemporalityPreference.Cumulative;
break;
case 'delta':
readerPeriodicInfo.exporter.otlp_http.temporality_preference =
meterProviderModel_1.ExporterTemporalityPreference.Delta;
break;
case 'low_memory':
readerPeriodicInfo.exporter.otlp_http.temporality_preference =
meterProviderModel_1.ExporterTemporalityPreference.LowMemory;
break;
default:
readerPeriodicInfo.exporter.otlp_http.temporality_preference =
meterProviderModel_1.ExporterTemporalityPreference.Cumulative;
break;
}
}
if (defaultHistogramAggregation) {
switch (defaultHistogramAggregation) {
case 'explicit_bucket_histogram':
readerPeriodicInfo.exporter.otlp_http.default_histogram_aggregation =
meterProviderModel_1.ExporterDefaultHistogramAggregation.ExplicitBucketHistogram;
break;
case 'base2_exponential_bucket_histogram':
readerPeriodicInfo.exporter.otlp_http.default_histogram_aggregation =
meterProviderModel_1.ExporterDefaultHistogramAggregation.Base2ExponentialBucketHistogram;
break;
default:
readerPeriodicInfo.exporter.otlp_http.default_histogram_aggregation =
meterProviderModel_1.ExporterDefaultHistogramAggregation.ExplicitBucketHistogram;
break;
}
}
if (protocol === 'http/json') {
readerPeriodicInfo.exporter.otlp_http.encoding =
commonModel_1.OtlpHttpEncoding.JSON;
}
else if (protocol === 'http/protobuf') {
readerPeriodicInfo.exporter.otlp_http.encoding =
commonModel_1.OtlpHttpEncoding.Protobuf;
}
const encoding = protocol === 'http/json'
? 'json'
: protocol === 'http/protobuf'
? 'protobuf'
: undefined;
const otlpHttp = {
endpoint: (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_METRICS_ENDPOINT') ??
((0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT')
? `${(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT')}/v1/metrics`
: 'http://localhost:4318/v1/metrics'),
timeout: timeoutExporter,
temporality_preference: temporalityPreference,
default_histogram_aggregation: defaultHistogramAggregation,
...(tls !== undefined && { tls }),
...(compression !== undefined && { compression }),
...(headersList !== undefined && { headers_list: headersList }),
...(encoding !== undefined && { encoding }),
};
readerPeriodicInfo.exporter = { otlp_http: otlpHttp };
}

@@ -524,19 +451,7 @@ }

}
const exemplarFilter = (0, core_1.getStringFromEnv)('OTEL_METRICS_EXEMPLAR_FILTER') ?? 'trace_based';
if (exemplarFilter) {
switch (exemplarFilter) {
case 'trace_based':
config.meter_provider.exemplar_filter = meterProviderModel_1.ExemplarFilter.TraceBased;
break;
case 'always_on':
config.meter_provider.exemplar_filter = meterProviderModel_1.ExemplarFilter.AlwaysOn;
break;
case 'always_off':
config.meter_provider.exemplar_filter = meterProviderModel_1.ExemplarFilter.AlwaysOff;
break;
default:
config.meter_provider.exemplar_filter = meterProviderModel_1.ExemplarFilter.TraceBased;
break;
}
}
const rawExemplarFilter = (0, core_1.getStringFromEnv)('OTEL_METRICS_EXEMPLAR_FILTER') ?? 'trace_based';
config.meter_provider.exemplar_filter =
rawExemplarFilter === 'default'
? 'trace_based'
: rawExemplarFilter;
}

@@ -553,3 +468,3 @@ exports.setMeterProvider = setMeterProvider;

}
config.logger_provider = (0, loggerProviderModel_1.initializeDefaultLoggerProviderConfiguration)();
config.logger_provider = (0, utils_1.initializeDefaultLoggerProviderConfiguration)();
const attributeValueLengthLimit = (0, core_1.getNumberFromEnv)('OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT');

@@ -567,29 +482,22 @@ const attributeCountLimit = (0, core_1.getNumberFromEnv)('OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT');

}
const batch = { exporter: {} };
const scheduleDelay = (0, core_1.getNumberFromEnv)('OTEL_BLRP_SCHEDULE_DELAY') ?? 1000;
if (scheduleDelay) {
batch.schedule_delay = scheduleDelay;
}
const exportTimeout = (0, core_1.getNumberFromEnv)('OTEL_BLRP_EXPORT_TIMEOUT') ?? 30000;
if (exportTimeout) {
batch.export_timeout = exportTimeout;
}
const maxQueueSize = (0, core_1.getNumberFromEnv)('OTEL_BLRP_MAX_QUEUE_SIZE') ?? 2048;
if (maxQueueSize) {
batch.max_queue_size = maxQueueSize;
}
const maxExportBatchSize = (0, core_1.getNumberFromEnv)('OTEL_BLRP_MAX_EXPORT_BATCH_SIZE') ?? 512;
if (maxExportBatchSize) {
batch.max_export_batch_size = maxExportBatchSize;
}
const batch = {
exporter: {},
schedule_delay: (0, core_1.getNumberFromEnv)('OTEL_BLRP_SCHEDULE_DELAY') ?? 1000,
export_timeout: (0, core_1.getNumberFromEnv)('OTEL_BLRP_EXPORT_TIMEOUT') ?? 30000,
max_queue_size: (0, core_1.getNumberFromEnv)('OTEL_BLRP_MAX_QUEUE_SIZE') ?? 2048,
max_export_batch_size: (0, core_1.getNumberFromEnv)('OTEL_BLRP_MAX_EXPORT_BATCH_SIZE') ?? 512,
};
for (let i = 0; i < exportersType.length; i++) {
const exporterType = exportersType[i];
const batchInfo = { ...batch };
const batchInfo = {
...batch,
exporter: {},
};
if (exporterType === 'console') {
config.logger_provider.processors.push({
const processor = {
simple: { exporter: { console: {} } },
});
};
config.logger_provider.processors.push(processor);
}
else {
// 'otlp' and default
const protocol = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_LOGS_PROTOCOL') ??

@@ -612,56 +520,36 @@ (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_PROTOCOL') ??

if (protocol === 'grpc') {
delete batchInfo.exporter.otlp_http;
batchInfo.exporter.otlp_grpc = {};
const endpoint = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_LOGS_ENDPOINT') ??
(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT') ??
'http://localhost:4317';
if (endpoint) {
batchInfo.exporter.otlp_grpc.endpoint = endpoint;
}
const tls = (0, utils_1.getGrpcTlsConfig)(certificateFile, clientKeyFile, clientCertificateFile);
if (tls) {
batchInfo.exporter.otlp_grpc.tls = tls;
}
if (compression) {
batchInfo.exporter.otlp_grpc.compression = compression;
}
if (timeout) {
batchInfo.exporter.otlp_grpc.timeout = timeout;
}
if (headersList) {
batchInfo.exporter.otlp_grpc.headers_list = headersList;
}
const otlpGrpc = {
endpoint: (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_LOGS_ENDPOINT') ??
(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT') ??
'http://localhost:4317',
timeout,
...(tls !== undefined && { tls }),
...(compression !== undefined && { compression }),
...(headersList !== undefined && { headers_list: headersList }),
};
batchInfo.exporter = { otlp_grpc: otlpGrpc };
}
else {
if (batchInfo.exporter.otlp_http == null) {
batchInfo.exporter.otlp_http = {};
}
const endpoint = (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_LOGS_ENDPOINT') ??
((0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT')
? `${(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT')}/v1/logs`
: 'http://localhost:4318/v1/logs');
if (endpoint) {
batchInfo.exporter.otlp_http.endpoint = endpoint;
}
const tls = (0, utils_1.getHttpTlsConfig)(certificateFile, clientKeyFile, clientCertificateFile);
if (tls) {
batchInfo.exporter.otlp_http.tls = tls;
}
if (compression) {
batchInfo.exporter.otlp_http.compression = compression;
}
if (timeout) {
batchInfo.exporter.otlp_http.timeout = timeout;
}
if (headersList) {
batchInfo.exporter.otlp_http.headers_list = headersList;
}
if (protocol === 'http/json') {
batchInfo.exporter.otlp_http.encoding = commonModel_1.OtlpHttpEncoding.JSON;
}
else if (protocol === 'http/protobuf') {
batchInfo.exporter.otlp_http.encoding = commonModel_1.OtlpHttpEncoding.Protobuf;
}
const encoding = protocol === 'http/json'
? 'json'
: protocol === 'http/protobuf'
? 'protobuf'
: undefined;
const otlpHttp = {
endpoint: (0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_LOGS_ENDPOINT') ??
((0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT')
? `${(0, core_1.getStringFromEnv)('OTEL_EXPORTER_OTLP_ENDPOINT')}/v1/logs`
: 'http://localhost:4318/v1/logs'),
timeout,
...(tls !== undefined && { tls }),
...(compression !== undefined && { compression }),
...(headersList !== undefined && { headers_list: headersList }),
...(encoding !== undefined && { encoding }),
};
batchInfo.exporter = { otlp_http: otlpHttp };
}
config.logger_provider.processors.push({ batch: batchInfo });
const processor = { batch: batchInfo };
config.logger_provider.processors.push(processor);
}

@@ -668,0 +556,0 @@ }

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

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

@@ -1,9 +0,3 @@

import type { AttributeLimits, Propagator, ConfigurationModel } from './models/configModel';
import type { ConfigFactory } from './IConfigFactory';
import { SeverityNumber } from './models/commonModel';
import type { TracerProvider } from './models/tracerProviderModel';
import type { LoggerProvider } from './models/loggerProviderModel';
import type { AttributeNameValue } from './models/resourceModel';
import type { MeterProvider } from './models/meterProviderModel';
import { ExporterTemporalityPreference } from './models/meterProviderModel';
import type { ConfigurationModel } from './generated/types';
export declare class FileConfigFactory implements ConfigFactory {

@@ -14,12 +8,3 @@ private _config;

}
export declare function hasValidConfigFile(): boolean;
export declare function parseConfigFile(config: ConfigurationModel): void;
export declare function setResourceAttributes(config: ConfigurationModel, attributes: AttributeNameValue[], attributeList: string): void;
export declare function setAttributeLimits(config: ConfigurationModel, attrLimits: AttributeLimits): void;
export declare function setPropagator(config: ConfigurationModel, propagator: Propagator): void;
export declare function setTracerProvider(config: ConfigurationModel, tracerProvider: TracerProvider): void;
export declare function getTemporalityPreference(temporalityPreference?: ExporterTemporalityPreference): ExporterTemporalityPreference;
export declare function setMeterProvider(config: ConfigurationModel, meterProvider: MeterProvider): void;
export declare function getSeverity(severity?: SeverityNumber): SeverityNumber | undefined;
export declare function setLoggerProvider(config: ConfigurationModel, loggerProvider: LoggerProvider): void;
export declare function parseConfigFile(): ConfigurationModel;
//# sourceMappingURL=FileConfigFactory.d.ts.map

@@ -7,18 +7,14 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.setLoggerProvider = exports.getSeverity = exports.setMeterProvider = exports.getTemporalityPreference = exports.setTracerProvider = exports.setPropagator = exports.setAttributeLimits = exports.setResourceAttributes = exports.parseConfigFile = exports.hasValidConfigFile = exports.FileConfigFactory = void 0;
exports.parseConfigFile = exports.FileConfigFactory = void 0;
const core_1 = require("@opentelemetry/core");
const configModel_1 = require("./models/configModel");
const fs = require("fs");
const yaml = require("yaml");
const utils_1 = require("./utils");
const commonModel_1 = require("./models/commonModel");
const tracerProviderModel_1 = require("./models/tracerProviderModel");
const loggerProviderModel_1 = require("./models/loggerProviderModel");
const meterProviderModel_1 = require("./models/meterProviderModel");
const api_1 = require("@opentelemetry/api");
// Pre-compiled ajv validator — eliminates runtime schema compilation on cold start.
// Generated by `npm run generate:config`; do not import ajv directly here.
const validateConfig = require("./generated/validator");
class FileConfigFactory {
_config;
constructor() {
this._config = (0, configModel_1.initializeDefaultConfiguration)();
parseConfigFile(this._config);
this._config = parseConfigFile();
}

@@ -30,1095 +26,314 @@ getConfigModel() {

exports.FileConfigFactory = FileConfigFactory;
function hasValidConfigFile() {
const configFile = (0, core_1.getStringFromEnv)('OTEL_CONFIG_FILE');
if (configFile) {
if (!(configFile.endsWith('.yaml') || configFile.endsWith('.yml')) ||
!fs.existsSync(configFile)) {
api_1.diag.warn(`Config file ${configFile} set on OTEL_CONFIG_FILE is not valid`);
return false;
}
return true;
}
return false;
}
exports.hasValidConfigFile = hasValidConfigFile;
function parseConfigFile(config) {
const supportedFileVersions = ['1.0-rc.3'];
function parseConfigFile() {
const supportedFileVersionPattern = /^1\.0$/;
const configFile = (0, core_1.getStringFromEnv)('OTEL_CONFIG_FILE') || '';
const file = fs.readFileSync(configFile, 'utf8');
const parsedContent = yaml.parse(file);
if (parsedContent['file_format'] &&
supportedFileVersions.includes(parsedContent['file_format'])) {
const disabled = (0, utils_1.getBooleanFromConfigFile)(parsedContent['disabled']);
if (disabled !== undefined) {
config.disabled = disabled;
}
const logLevel = (0, utils_1.getNumberFromConfigFile)((0, core_1.diagLogLevelFromString)(parsedContent['log_level']));
if (logLevel) {
config.log_level = logLevel;
}
if (parsedContent['resource']) {
if (config.resource == null) {
config.resource = {};
}
const schemaUrl = (0, utils_1.getStringFromConfigFile)(parsedContent['resource']?.['schema_url']);
if (schemaUrl) {
config.resource.schema_url = schemaUrl;
}
}
setResourceAttributes(config, parsedContent['resource']?.['attributes'], parsedContent['resource']?.['attributes_list']);
const detectionConfig = parsedContent['resource']?.['detection/development'];
if (detectionConfig) {
config.resource['detection/development'] =
parseDetectionDevelopment(detectionConfig);
}
setAttributeLimits(config, parsedContent['attribute_limits']);
setPropagator(config, parsedContent['propagator']);
setTracerProvider(config, parsedContent['tracer_provider']);
setMeterProvider(config, parsedContent['meter_provider']);
setLoggerProvider(config, parsedContent['logger_provider']);
// Apply env var substitution to all string values before schema parsing
const rawParsed = yaml.parse(file);
const processed = substituteEnvVars(rawParsed);
const fileFormat = processed?.file_format;
if (!fileFormat || !supportedFileVersionPattern.test(String(fileFormat))) {
throw new Error(`${configFile}: Unsupported file_format: "${fileFormat}". Must match ${supportedFileVersionPattern}.`);
}
else {
api_1.diag.warn(`Unsupported File Format: ${parsedContent['file_format']}. It must be one of the following: ${supportedFileVersions}`);
// Normalize YAML null type-tag values to {} before validation
normalizeYamlNulls(processed);
const valid = validateConfig(processed);
if (!valid) {
const firstError = validateConfig.errors?.[0];
const detail = firstError
? `${firstError.instancePath} ${firstError.message}`
: 'unknown error';
throw new Error(`Invalid OpenTelemetry config file: ${detail.trim()}`);
}
const data = processed;
// Strip file_format from output — it's a meta-field, not a config value
delete data['file_format'];
// The generated TypeScript types omit `| null` from unions (see
// generate-config.js) because consumers expect `T | undefined`, not
// `T | null`. To match, we delete any properties still set to `null`
// after YAML parsing so that accessing them returns `undefined`.
// Runs after normalizeYamlNulls, which has already converted type-tag
// nulls (e.g. `console:`) to `{}`.
stripNulls(processed);
applyConfigDefaults(data);
mergeAttributesList(data);
mergeCompositeList(data);
applyBatchProcessorDefaults(data);
applyPeriodicReaderDefaults(data);
applyOtlpHttpEncodingDefaults(data);
return data;
}
exports.parseConfigFile = parseConfigFile;
function setResourceAttributes(config, attributes, attributeList) {
if (attributes || attributeList) {
const addedKeys = [];
if (config.resource == null) {
config.resource = {};
/**
* Apply default encoding ('protobuf') to all otlp_http exporters in the config
* where encoding was not explicitly specified. The spec defines protobuf as the
* default encoding for OTLP HTTP exporters.
*/
function applyOtlpHttpEncodingDefaults(data) {
const applyEncoding = (exporter) => {
if (exporter && exporter.encoding == null) {
exporter.encoding = 'protobuf';
}
if ((0, utils_1.getStringFromConfigFile)(attributeList)) {
config.resource.attributes_list = (0, utils_1.getStringFromConfigFile)(attributeList);
}
const list = (0, utils_1.getStringListFromConfigFile)(attributeList);
if ((list && list.length > 0) || (attributes && attributes.length > 0)) {
config.resource.attributes = [];
if (attributes) {
for (let i = 0; i < attributes.length; i++) {
const att = attributes[i];
let value = att['value'];
switch (att['type']) {
case 'bool':
value = (0, utils_1.getBooleanFromConfigFile)(value);
break;
case 'bool_array':
value = (0, utils_1.getBooleanListFromConfigFile)(value);
break;
case 'int':
case 'double':
value = (0, utils_1.getNumberFromConfigFile)(value);
break;
case 'int_array':
case 'double_array':
value = (0, utils_1.getNumberListFromConfigFile)(value);
break;
case 'string_array':
value = (0, utils_1.getStringListFromConfigFile)(value);
break;
default:
value = (0, utils_1.getStringFromConfigFile)(value);
break;
}
const key = (0, utils_1.getStringFromConfigFile)(att['name']) ?? '';
config.resource.attributes.push({
name: key,
value: value,
type: att['type'] ?? 'string',
});
addedKeys.push(key);
}
}
if (list) {
for (let i = 0; i < list.length; i++) {
const element = list[i].split('=');
if (!addedKeys.includes(element[0])) {
config.resource.attributes.push({
name: element[0],
value: element[1],
type: 'string',
});
}
}
}
}
};
for (const processor of data.tracer_provider?.processors ?? []) {
applyEncoding(processor.batch?.exporter?.otlp_http);
applyEncoding(processor.simple?.exporter?.otlp_http);
}
}
exports.setResourceAttributes = setResourceAttributes;
function parseDetectionDevelopment(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
detection) {
const result = {};
if (detection['attributes']) {
result.attributes = {};
const included = detection['attributes']['included'];
if (Array.isArray(included)) {
result.attributes.included = included.filter(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(v) => typeof v === 'string');
}
const excluded = detection['attributes']['excluded'];
if (Array.isArray(excluded)) {
result.attributes.excluded = excluded.filter(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(v) => typeof v === 'string');
}
for (const reader of data.meter_provider?.readers ?? []) {
applyEncoding(reader.periodic?.exporter?.otlp_http);
}
if (Array.isArray(detection['detectors'])) {
result.detectors = [];
for (let i = 0; i < detection['detectors'].length; i++) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const d = detection['detectors'][i];
if (typeof d !== 'object' || d === null) {
continue;
}
const detector = {};
if ('container' in d)
detector.container = d.container ?? {};
if ('env' in d)
detector.env = d.env ?? {};
if ('host' in d)
detector.host = d.host ?? {};
if ('os' in d)
detector.os = d.os ?? {};
if ('process' in d)
detector.process = d.process ?? {};
if ('service' in d)
detector.service = d.service ?? {};
result.detectors.push(detector);
}
for (const processor of data.logger_provider?.processors ?? []) {
applyEncoding(processor.batch?.exporter?.otlp_http);
applyEncoding(processor.simple?.exporter?.otlp_http);
}
return result;
}
function setAttributeLimits(config, attrLimits) {
if (attrLimits) {
if (config.attribute_limits == null) {
config.attribute_limits = {
attribute_count_limit: 128,
};
}
const lengthLimit = (0, utils_1.getNumberFromConfigFile)(attrLimits['attribute_value_length_limit']);
if (lengthLimit) {
config.attribute_limits.attribute_value_length_limit = lengthLimit;
}
const countLimit = (0, utils_1.getNumberFromConfigFile)(attrLimits['attribute_count_limit']);
if (countLimit) {
config.attribute_limits.attribute_count_limit = countLimit;
}
/**
* Merge resource.attributes_list (comma-separated key=value pairs) into
* resource.attributes, with entries already in attributes taking precedence.
*/
function mergeAttributesList(data) {
const resource = data.resource;
const list = resource?.attributes_list;
if (typeof list !== 'string' || !list.trim())
return;
if (resource.attributes == null) {
resource.attributes = [];
}
}
exports.setAttributeLimits = setAttributeLimits;
function setPropagator(config, propagator) {
if (propagator && (propagator.composite || propagator.composite_list)) {
const auxList = [];
const composite = [];
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 existingKeys = new Set(resource.attributes.map((a) => a.name));
for (const pair of list.split(',')) {
const eqIdx = pair.indexOf('=');
if (eqIdx > 0) {
const key = pair.slice(0, eqIdx).trim();
const value = pair.slice(eqIdx + 1).trim();
if (key && !existingKeys.has(key)) {
resource.attributes.push({ name: key, value, type: 'string' });
}
}
const compositeList = (0, utils_1.getStringListFromConfigFile)(propagator['composite_list']);
if (compositeList) {
for (let i = 0; i < compositeList.length; i++) {
if (!auxList.includes(compositeList[i])) {
composite.push({ [compositeList[i]]: null });
}
}
}
if (composite.length > 0) {
if (config.propagator == null) {
config.propagator = {};
}
config.propagator.composite = composite;
}
const compositeListString = (0, utils_1.getStringFromConfigFile)(propagator['composite_list']);
if (compositeListString) {
config.propagator.composite_list = compositeListString;
}
else if (auxList.length > 0) {
// Generate composite_list from the composite entries
config.propagator.composite_list = auxList.join(',');
}
}
}
exports.setPropagator = setPropagator;
function parseComposableSampler(sampler) {
const samplerType = Object.keys(sampler)[0];
let parsedSampler = {};
switch (samplerType) {
case 'always_on':
parsedSampler = { always_on: sampler['always_on'] ?? undefined };
break;
case 'always_off':
parsedSampler = { always_off: sampler['always_off'] ?? undefined };
break;
case 'parent_threshold': {
const s = sampler['parent_threshold'];
if (s?.root) {
parsedSampler = {
parent_threshold: { root: parseComposableSampler(s.root) },
};
}
break;
}
case 'probability': {
const s = sampler['probability'];
parsedSampler = {
probability: {
ratio: (0, utils_1.getNumberFromConfigFile)(s?.ratio) ?? 1.0,
},
};
break;
}
case 'rule_based': {
const rb = sampler['rule_based'];
if (rb) {
parsedSampler = { rule_based: {} };
if (rb.rules) {
parsedSampler.rule_based.rules = rb.rules.map(rule => ({
...rule,
sampler: rule.sampler ? parseComposableSampler(rule.sampler) : {},
}));
}
}
break;
}
/**
* Merge propagator.composite_list (comma-separated propagator names) into
* propagator.composite, with entries already in composite taking precedence.
*/
function mergeCompositeList(data) {
const propagator = data.propagator;
const list = propagator?.composite_list;
if (typeof list !== 'string' || !list.trim())
return;
if (propagator.composite == null) {
propagator.composite = [];
}
return parsedSampler;
}
function parseSampler(sampler) {
const samplerType = Object.keys(sampler)[0];
let parsedSampler = {};
switch (samplerType) {
case 'always_on':
parsedSampler = { always_on: sampler['always_on'] ?? undefined };
break;
case 'always_off':
parsedSampler = { always_off: sampler['always_off'] ?? undefined };
break;
case 'trace_id_ratio_based': {
const s = sampler['trace_id_ratio_based'];
parsedSampler = {
trace_id_ratio_based: {
ratio: (0, utils_1.getNumberFromConfigFile)(s?.ratio) ?? 1.0,
},
};
break;
}
case 'parent_based': {
const s = sampler['parent_based'];
if (s) {
parsedSampler = { parent_based: {} };
if (s.root) {
parsedSampler.parent_based.root = parseSampler(s.root);
}
if (s.remote_parent_sampled) {
parsedSampler.parent_based.remote_parent_sampled = parseSampler(s.remote_parent_sampled);
}
if (s.remote_parent_not_sampled) {
parsedSampler.parent_based.remote_parent_not_sampled = parseSampler(s.remote_parent_not_sampled);
}
if (s.local_parent_sampled) {
parsedSampler.parent_based.local_parent_sampled = parseSampler(s.local_parent_sampled);
}
if (s.local_parent_not_sampled) {
parsedSampler.parent_based.local_parent_not_sampled = parseSampler(s.local_parent_not_sampled);
}
}
break;
}
case 'probability/development': {
const s = sampler['probability/development'];
parsedSampler = {
'probability/development': {
ratio: (0, utils_1.getNumberFromConfigFile)(s?.ratio) ?? 1.0,
},
};
break;
}
case 'composite/development': {
const s = sampler['composite/development'];
if (s) {
parsedSampler = {
'composite/development': parseComposableSampler(s),
};
}
break;
}
}
return parsedSampler;
}
function getConfigHeaders(h) {
if (h) {
const headers = [];
for (let i = 0; i < h.length; i++) {
const element = h[i];
headers.push({
name: element['name'],
value: element['value'],
const existingNames = new Set(propagator.composite.map(entry => Object.keys(entry)[0]));
for (const name of list.split(',')) {
const trimmed = name.trim();
if (trimmed && !existingNames.has(trimmed)) {
propagator.composite.push({
[trimmed]: {},
});
}
if (headers.length > 0) {
return headers;
}
}
return null;
}
var ProviderType;
(function (ProviderType) {
ProviderType[ProviderType["TRACER"] = 0] = "TRACER";
ProviderType[ProviderType["METER"] = 1] = "METER";
ProviderType[ProviderType["LOGGER"] = 2] = "LOGGER";
})(ProviderType || (ProviderType = {}));
function parseConfigSpanOrLogRecordExporter(exporter, providerType) {
const exporterType = Object.keys(exporter)[0];
let parsedExporter = {};
let e;
let certFile;
let clientCertFile;
let clientKeyFile;
let compression;
let headers;
let headersList;
let insecure;
let endpoint;
switch (providerType) {
case ProviderType.TRACER:
endpoint = 'http://localhost:4318/v1/traces';
parsedExporter = parsedExporter;
break;
case ProviderType.LOGGER:
endpoint = 'http://localhost:4318/v1/logs';
parsedExporter = parsedExporter;
break;
/**
* Apply spec-defined defaults for batch span/log-record processor fields that
* are not encoded in the JSON schema.
*/
function applyBatchProcessorDefaults(data) {
const applyDefaults = (batch) => {
if (batch.schedule_delay == null)
batch.schedule_delay = 5000;
if (batch.export_timeout == null)
batch.export_timeout = 30000;
if (batch.max_queue_size == null)
batch.max_queue_size = 2048;
if (batch.max_export_batch_size == null)
batch.max_export_batch_size = 512;
};
for (const processor of data.tracer_provider?.processors ?? []) {
if (processor.batch)
applyDefaults(processor.batch);
}
switch (exporterType) {
case 'otlp_http':
e = exporter['otlp_http'];
if (e) {
parsedExporter = {
otlp_http: {
endpoint: (0, utils_1.getStringFromConfigFile)(e['endpoint']) ?? endpoint,
timeout: (0, utils_1.getNumberFromConfigFile)(e['timeout']) ?? 10000,
encoding: (0, utils_1.getStringFromConfigFile)(e['encoding']) === 'json'
? commonModel_1.OtlpHttpEncoding.JSON
: commonModel_1.OtlpHttpEncoding.Protobuf,
},
};
compression = (0, utils_1.getStringFromConfigFile)(e['compression']);
if (compression && parsedExporter.otlp_http) {
parsedExporter.otlp_http.compression = compression;
}
headersList = (0, utils_1.getStringFromConfigFile)(e['headers_list']);
if (headersList && parsedExporter.otlp_http) {
parsedExporter.otlp_http.headers_list = headersList;
}
headers = getConfigHeaders(e['headers']);
if (headers && parsedExporter.otlp_http) {
parsedExporter.otlp_http.headers = headers;
}
if (e['tls']) {
certFile = (0, utils_1.getStringFromConfigFile)(e['tls']['ca_file']);
clientCertFile = (0, utils_1.getStringFromConfigFile)(e['tls']['cert_file']);
clientKeyFile = (0, utils_1.getStringFromConfigFile)(e['tls']['key_file']);
const tls = (0, utils_1.getHttpTlsConfig)(certFile, clientKeyFile, clientCertFile);
if (tls) {
parsedExporter.otlp_http.tls = tls;
}
}
}
break;
case 'otlp_grpc':
e = exporter['otlp_grpc'];
if (e) {
parsedExporter = {
otlp_grpc: {
endpoint: (0, utils_1.getStringFromConfigFile)(e['endpoint']) ?? 'http://localhost:4317',
timeout: (0, utils_1.getNumberFromConfigFile)(e['timeout']) ?? 10000,
},
};
compression = (0, utils_1.getStringFromConfigFile)(e['compression']);
if (compression && parsedExporter.otlp_grpc) {
parsedExporter.otlp_grpc.compression = compression;
}
headersList = (0, utils_1.getStringFromConfigFile)(e['headers_list']);
if (headersList && parsedExporter.otlp_grpc) {
parsedExporter.otlp_grpc.headers_list = headersList;
}
headers = getConfigHeaders(e['headers']);
if (headers && parsedExporter.otlp_grpc) {
parsedExporter.otlp_grpc.headers = headers;
}
if (e['tls']) {
certFile = (0, utils_1.getStringFromConfigFile)(e['tls']['ca_file']);
clientCertFile = (0, utils_1.getStringFromConfigFile)(e['tls']['cert_file']);
clientKeyFile = (0, utils_1.getStringFromConfigFile)(e['tls']['key_file']);
insecure = (0, utils_1.getBooleanFromConfigFile)(e['tls']['insecure']);
const tls = (0, utils_1.getGrpcTlsConfig)(certFile, clientKeyFile, clientCertFile, insecure);
if (tls) {
parsedExporter.otlp_grpc.tls = tls;
}
}
}
break;
case 'otlp_file/development':
e = exporter['otlp_file/development'];
if (e) {
parsedExporter = {
'otlp_file/development': {
output_stream: (0, utils_1.getStringFromConfigFile)(e['output_stream']) ?? 'stdout',
},
};
}
break;
case 'console':
parsedExporter = {
console: {},
};
break;
for (const processor of data.logger_provider?.processors ?? []) {
if (processor.batch)
applyDefaults(processor.batch);
}
return parsedExporter;
}
function setTracerProvider(config, tracerProvider) {
if (tracerProvider && tracerProvider.processors?.length > 0) {
config.tracer_provider = (0, tracerProviderModel_1.initializeDefaultTracerProviderConfiguration)();
// Limits
if (tracerProvider['limits']) {
const attributeValueLengthLimit = (0, utils_1.getNumberFromConfigFile)(tracerProvider['limits']['attribute_value_length_limit']);
if (attributeValueLengthLimit) {
config.tracer_provider.limits.attribute_value_length_limit =
attributeValueLengthLimit;
}
const attributeCountLimit = (0, utils_1.getNumberFromConfigFile)(tracerProvider['limits']['attribute_count_limit']);
if (attributeCountLimit) {
config.tracer_provider.limits.attribute_count_limit =
attributeCountLimit;
}
const eventCountLimit = (0, utils_1.getNumberFromConfigFile)(tracerProvider['limits']['event_count_limit']);
if (eventCountLimit) {
config.tracer_provider.limits.event_count_limit = eventCountLimit;
}
const linkCountLimit = (0, utils_1.getNumberFromConfigFile)(tracerProvider['limits']['link_count_limit']);
if (linkCountLimit) {
config.tracer_provider.limits.link_count_limit = linkCountLimit;
}
const eventAttributeCountLimit = (0, utils_1.getNumberFromConfigFile)(tracerProvider['limits']['event_attribute_count_limit']);
if (eventAttributeCountLimit) {
config.tracer_provider.limits.event_attribute_count_limit =
eventAttributeCountLimit;
}
const linkAttributeCountLimit = (0, utils_1.getNumberFromConfigFile)(tracerProvider['limits']['link_attribute_count_limit']);
if (linkAttributeCountLimit) {
config.tracer_provider.limits.link_attribute_count_limit =
linkAttributeCountLimit;
}
/**
* Apply spec-defined defaults for periodic metric reader fields.
*/
function applyPeriodicReaderDefaults(data) {
for (const reader of data.meter_provider?.readers ?? []) {
const periodic = reader.periodic;
if (!periodic)
continue;
if (periodic.interval == null)
periodic.interval = 60000;
if (periodic.timeout == null)
periodic.timeout = 30000;
if (periodic.cardinality_limits == null) {
periodic.cardinality_limits = { default: 2000 };
}
// Sampler
if (tracerProvider['sampler']) {
config.tracer_provider.sampler = parseSampler(tracerProvider['sampler']);
}
// Processors
for (let i = 0; i < tracerProvider['processors'].length; i++) {
const processorType = Object.keys(tracerProvider['processors'][i])[0];
if (processorType === 'batch') {
const element = tracerProvider['processors'][i]['batch'];
if (element) {
const parsedExporter = parseConfigSpanOrLogRecordExporter(element['exporter'], ProviderType.TRACER);
const batchConfig = {
batch: {
schedule_delay: (0, utils_1.getNumberFromConfigFile)(element['schedule_delay']) ?? 5000,
export_timeout: (0, utils_1.getNumberFromConfigFile)(element['export_timeout']) ?? 30000,
max_queue_size: (0, utils_1.getNumberFromConfigFile)(element['max_queue_size']) ?? 2048,
max_export_batch_size: (0, utils_1.getNumberFromConfigFile)(element['max_export_batch_size']) ??
512,
exporter: parsedExporter,
},
};
config.tracer_provider.processors.push(batchConfig);
}
}
else if (processorType === 'simple') {
const element = tracerProvider['processors'][i]['simple'];
if (element) {
const parsedExporter = parseConfigSpanOrLogRecordExporter(element['exporter'], ProviderType.TRACER);
const simpleConfig = {
simple: {
exporter: parsedExporter,
},
};
config.tracer_provider.processors.push(simpleConfig);
}
}
}
}
else if (tracerProvider &&
(tracerProvider.processors == null ||
tracerProvider.processors.length === 0)) {
api_1.diag.warn('TracerProvider must have at least one processor configured');
}
}
exports.setTracerProvider = setTracerProvider;
function getCardinalityLimits(limits) {
if (limits == null) {
limits = {};
/**
* Apply spec-defined defaults that are not encoded in the JSON schema.
* Both FileConfigFactory and EnvironmentConfigFactory apply the same defaults
* so consumers see consistent behaviour regardless of config source.
*/
function applyConfigDefaults(data) {
if (data.disabled == null) {
data.disabled = false;
}
const defaultLimit = (0, utils_1.getNumberFromConfigFile)(limits['default']) ?? 2000;
return {
default: defaultLimit,
counter: (0, utils_1.getNumberFromConfigFile)(limits['counter']) ?? defaultLimit,
gauge: (0, utils_1.getNumberFromConfigFile)(limits['gauge']) ?? defaultLimit,
histogram: (0, utils_1.getNumberFromConfigFile)(limits['histogram']) ?? defaultLimit,
observable_counter: (0, utils_1.getNumberFromConfigFile)(limits['observable_counter']) ?? defaultLimit,
observable_gauge: (0, utils_1.getNumberFromConfigFile)(limits['observable_gauge']) ?? defaultLimit,
observable_up_down_counter: (0, utils_1.getNumberFromConfigFile)(limits['observable_up_down_counter']) ??
defaultLimit,
up_down_counter: (0, utils_1.getNumberFromConfigFile)(limits['up_down_counter']) ?? defaultLimit,
};
}
function getProducers(producers) {
const parsedProducers = [];
if (producers) {
for (let j = 0; j < producers.length; j++) {
const producer = producers[j];
if (Object.keys(producer)[0] === 'opencensus') {
parsedProducers.push({ opencensus: {} });
}
}
if (data.log_level == null) {
data.log_level = 'info';
}
return parsedProducers;
}
function getTemporalityPreference(temporalityPreference) {
const temporalityPreferenceType = (0, utils_1.getStringFromConfigFile)(temporalityPreference);
switch (temporalityPreferenceType) {
case 'cumulative':
return meterProviderModel_1.ExporterTemporalityPreference.Cumulative;
case 'delta':
return meterProviderModel_1.ExporterTemporalityPreference.Delta;
case 'low_memory':
return meterProviderModel_1.ExporterTemporalityPreference.LowMemory;
default:
return meterProviderModel_1.ExporterTemporalityPreference.Cumulative;
if (data.attribute_limits == null) {
data.attribute_limits = { attribute_count_limit: 128 };
}
else if (data.attribute_limits.attribute_count_limit == null) {
data.attribute_limits.attribute_count_limit = 128;
}
}
exports.getTemporalityPreference = getTemporalityPreference;
function getDefaultHistogramAggregation(defaultHistogramAggregation) {
const defaultHistogramAggregationType = (0, utils_1.getStringFromConfigFile)(defaultHistogramAggregation);
switch (defaultHistogramAggregationType) {
case 'explicit_bucket_histogram':
return meterProviderModel_1.ExporterDefaultHistogramAggregation.ExplicitBucketHistogram;
case 'base2_exponential_bucket_histogram':
return meterProviderModel_1.ExporterDefaultHistogramAggregation.Base2ExponentialBucketHistogram;
default:
return meterProviderModel_1.ExporterDefaultHistogramAggregation.ExplicitBucketHistogram;
/**
* Recursively delete object properties whose value is `null`.
*
* YAML `key:` (no value) parses to `{ key: null }`. The generated TypeScript
* types use `?: T` (not `T | null`) because downstream consumers like sdk-node
* assign config values to interfaces that only accept `T | undefined`. The
* codegen script (generate-config.js) strips `| null` from type unions; this
* function makes the runtime data match by deleting null-valued keys so that
* property access returns `undefined` instead of `null`.
*
* Must run AFTER normalizeYamlNulls, which converts type-tag nulls
* (e.g. `console: null` → `console: {}`) — those are already `{}` by the
* time this function runs and won't be affected.
*/
function stripNulls(value) {
if (value == null || typeof value !== 'object')
return;
if (Array.isArray(value)) {
for (const item of value) {
stripNulls(item);
}
}
}
function parseMetricExporter(exporter) {
const exporterType = Object.keys(exporter)[0];
let parsedExporter = {};
let e;
let certFile;
let clientCertFile;
let clientKeyFile;
let compression;
let headers;
let headersList;
let insecure;
switch (exporterType) {
case 'otlp_http':
e = exporter['otlp_http'];
if (e) {
parsedExporter = {
otlp_http: {
endpoint: (0, utils_1.getStringFromConfigFile)(e['endpoint']) ??
'http://localhost:4318/v1/metrics',
timeout: (0, utils_1.getNumberFromConfigFile)(e['timeout']) ?? 10000,
encoding: (0, utils_1.getStringFromConfigFile)(e['encoding']) === 'json'
? commonModel_1.OtlpHttpEncoding.JSON
: commonModel_1.OtlpHttpEncoding.Protobuf,
temporality_preference: getTemporalityPreference(e['temporality_preference']),
default_histogram_aggregation: getDefaultHistogramAggregation(e['default_histogram_aggregation']),
},
};
compression = (0, utils_1.getStringFromConfigFile)(e['compression']);
if (compression && parsedExporter.otlp_http) {
parsedExporter.otlp_http.compression = compression;
}
headersList = (0, utils_1.getStringFromConfigFile)(e['headers_list']);
if (headersList && parsedExporter.otlp_http) {
parsedExporter.otlp_http.headers_list = headersList;
}
headers = getConfigHeaders(e['headers']);
if (headers && parsedExporter.otlp_http) {
parsedExporter.otlp_http.headers = headers;
}
if (e['tls']) {
certFile = (0, utils_1.getStringFromConfigFile)(e['tls']['ca_file']);
clientCertFile = (0, utils_1.getStringFromConfigFile)(e['tls']['cert_file']);
clientKeyFile = (0, utils_1.getStringFromConfigFile)(e['tls']['key_file']);
const tls = (0, utils_1.getHttpTlsConfig)(certFile, clientKeyFile, clientCertFile);
if (tls) {
parsedExporter.otlp_http.tls = tls;
}
}
else {
for (const [key, val] of Object.entries(value)) {
if (val === null) {
delete value[key];
}
break;
case 'otlp_grpc':
e = exporter['otlp_grpc'];
if (e) {
parsedExporter = {
otlp_grpc: {
endpoint: (0, utils_1.getStringFromConfigFile)(e['endpoint']) ?? 'http://localhost:4317',
timeout: (0, utils_1.getNumberFromConfigFile)(e['timeout']) ?? 10000,
temporality_preference: getTemporalityPreference(e['temporality_preference']),
default_histogram_aggregation: getDefaultHistogramAggregation(e['default_histogram_aggregation']),
},
};
compression = (0, utils_1.getStringFromConfigFile)(e['compression']);
if (compression && parsedExporter.otlp_grpc) {
parsedExporter.otlp_grpc.compression = compression;
}
headersList = (0, utils_1.getStringFromConfigFile)(e['headers_list']);
if (headersList && parsedExporter.otlp_grpc) {
parsedExporter.otlp_grpc.headers_list = headersList;
}
headers = getConfigHeaders(e['headers']);
if (headers && parsedExporter.otlp_grpc) {
parsedExporter.otlp_grpc.headers = headers;
}
if (e['tls']) {
certFile = (0, utils_1.getStringFromConfigFile)(e['tls']['ca_file']);
clientCertFile = (0, utils_1.getStringFromConfigFile)(e['tls']['cert_file']);
clientKeyFile = (0, utils_1.getStringFromConfigFile)(e['tls']['key_file']);
insecure = (0, utils_1.getBooleanFromConfigFile)(e['tls']['insecure']);
const tls = (0, utils_1.getGrpcTlsConfig)(certFile, clientKeyFile, clientCertFile, insecure);
if (tls) {
parsedExporter.otlp_grpc.tls = tls;
}
}
else {
stripNulls(val);
}
break;
case 'otlp_file/development':
e = exporter['otlp_file/development'];
if (e) {
parsedExporter = {
'otlp_file/development': {
output_stream: (0, utils_1.getStringFromConfigFile)(e['output_stream']) ?? 'stdout',
temporality_preference: getTemporalityPreference(e['temporality_preference']),
default_histogram_aggregation: getDefaultHistogramAggregation(e['default_histogram_aggregation']),
},
};
}
break;
case 'console':
e = exporter['console'];
if (e) {
parsedExporter = {
console: {
temporality_preference: getTemporalityPreference(e['temporality_preference']),
default_histogram_aggregation: getDefaultHistogramAggregation(e['default_histogram_aggregation']),
},
};
}
break;
}
}
return parsedExporter;
}
function setMeterProvider(config, meterProvider) {
if (meterProvider && meterProvider.readers?.length > 0) {
config.meter_provider = (0, meterProviderModel_1.initializeDefaultMeterProviderConfiguration)();
const exemplarFilter = (0, utils_1.getStringFromConfigFile)(meterProvider['exemplar_filter']);
if (exemplarFilter) {
switch (exemplarFilter) {
case 'trace_based':
config.meter_provider.exemplar_filter = meterProviderModel_1.ExemplarFilter.TraceBased;
break;
case 'always_on':
config.meter_provider.exemplar_filter = meterProviderModel_1.ExemplarFilter.AlwaysOn;
break;
case 'always_off':
config.meter_provider.exemplar_filter = meterProviderModel_1.ExemplarFilter.AlwaysOff;
break;
default:
config.meter_provider.exemplar_filter = meterProviderModel_1.ExemplarFilter.TraceBased;
break;
}
}
for (let i = 0; i < meterProvider.readers.length; i++) {
const readerType = Object.keys(meterProvider['readers'][i])[0];
if (readerType === 'pull') {
const element = meterProvider['readers'][i]['pull'];
if (element) {
const exporter = {
'prometheus/development': {
host: (0, utils_1.getStringFromConfigFile)(element['exporter']['prometheus/development']['host']) ?? 'localhost',
port: (0, utils_1.getNumberFromConfigFile)(element['exporter']['prometheus/development']['port']) ?? 9464,
without_scope_info: (0, utils_1.getBooleanFromConfigFile)(element['exporter']['prometheus/development']['without_scope_info']) ?? false,
without_target_info: (0, utils_1.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: (0, utils_1.getStringListFromConfigFile)(element['exporter']['prometheus/development']['with_resource_constant_labels']?.['included']) ?? [],
excluded: (0, utils_1.getStringListFromConfigFile)(element['exporter']['prometheus/development']['with_resource_constant_labels']?.['excluded']) ?? [],
};
/**
* Object type-tag keys that may appear as nested (non-array-element) properties.
* YAML `console:` (no value) parses to `{ console: null }`, but the SDK checks
* `if (exporter.console)` — truthy — so null must become {}.
*
* We exclude keys that are also used as nullable primitives in other contexts
* (e.g. `host` is a string field in prometheus config; detectors use it as a
* type-tag but only as array elements, which are already handled below).
*/
const NESTED_OBJECT_TYPE_TAGS = new Set([
// Exporter type discriminators (nested inside simple/batch processor or reader)
'console',
'otlp_http',
'otlp_grpc',
// Sampler type discriminators (nested inside tracer_provider.sampler)
'always_on',
'always_off',
'trace_id_ratio_based',
'parent_based',
'jaeger_remote',
// Propagator type discriminators (array elements, but covered here for completeness)
'tracecontext',
'baggage',
'b3',
'b3multi',
'xray',
// Telemetry producer type discriminators
'opencensus',
]);
/**
* Normalizes YAML null values to empty objects for discriminated-union type-tag fields.
*
* YAML `key:` (no value) parses to `{ key: null }`, but the SDK checks `if (obj.key)`
* to determine which type to instantiate — null fails that check. Two cases:
*
* 1. Array element properties: convert ALL null-valued keys to {} (handles detectors,
* composite propagators, and most exporter/processor discriminators).
* 2. Nested NESTED_OBJECT_TYPE_TAGS: convert known type-discriminator keys to {} when
* encountered anywhere in the tree (handles sampler types, console exporter nested
* inside simple/batch, etc.).
*
* Top-level nullable primitive fields (disabled, log_level, endpoint, ca_file, etc.)
* are NOT in NESTED_OBJECT_TYPE_TAGS and are left as-is; applyConfigDefaults()
* handles the boolean/string ones that need defaults.
*/
function normalizeYamlNulls(value) {
if (value == null || typeof value !== 'object')
return;
if (Array.isArray(value)) {
for (const item of value) {
if (item != null && typeof item === 'object' && !Array.isArray(item)) {
// All null-valued properties of array elements are type-tag discriminators.
for (const key of Object.keys(item)) {
if (item[key] === null) {
item[key] = {};
}
if (element['exporter']['prometheus/development']['translation_strategy']) {
const ts = (0, utils_1.getStringFromConfigFile)(element['exporter']['prometheus/development']['translation_strategy']);
switch (ts) {
case 'underscore_escaping_with_suffixes':
exporter['prometheus/development'].translation_strategy =
meterProviderModel_1.ExperimentalPrometheusTranslationStrategy.UnderscoreEscapingWithSuffixes;
break;
case 'underscore_escaping_without_suffixes':
exporter['prometheus/development'].translation_strategy =
meterProviderModel_1.ExperimentalPrometheusTranslationStrategy.UnderscoreEscapingWithoutSuffixes;
break;
case 'no_utf8_escaping_with_suffixes':
exporter['prometheus/development'].translation_strategy =
meterProviderModel_1.ExperimentalPrometheusTranslationStrategy.NoUtf8EscapingWithSuffixes;
break;
case 'no_translation':
exporter['prometheus/development'].translation_strategy =
meterProviderModel_1.ExperimentalPrometheusTranslationStrategy.NoTranslation;
break;
}
}
const pullReader = {
pull: {
exporter: exporter,
cardinality_limits: getCardinalityLimits(element['cardinality_limits']),
},
};
const p = getProducers(element['producers']);
if (p.length > 0 && pullReader.pull) {
pullReader.pull.producers = p;
}
config.meter_provider.readers.push(pullReader);
}
}
else if (readerType === 'periodic') {
const element = meterProvider['readers'][i]['periodic'];
if (element) {
const parsedExporter = parseMetricExporter(element['exporter']);
const periodicReader = {
periodic: {
exporter: parsedExporter,
cardinality_limits: getCardinalityLimits(element['cardinality_limits']),
interval: (0, utils_1.getNumberFromConfigFile)(element['interval']) ?? 60000,
timeout: (0, utils_1.getNumberFromConfigFile)(element['timeout']) ?? 30000,
},
};
const p = getProducers(element['producers']);
if (p.length > 0 && periodicReader.periodic) {
periodicReader.periodic.producers = p;
}
config.meter_provider.readers.push(periodicReader);
}
}
normalizeYamlNulls(item);
}
if (meterProvider['views'] && meterProvider['views'].length > 0) {
config.meter_provider.views = [];
for (let j = 0; j < meterProvider['views'].length; j++) {
const element = meterProvider['views'][j];
const view = {};
if (element['selector']) {
const selector = {};
const instrumentName = (0, utils_1.getStringFromConfigFile)(element['selector']['instrument_name']);
if (instrumentName) {
selector.instrument_name = instrumentName;
}
const unit = (0, utils_1.getStringFromConfigFile)(element['selector']['unit']);
if (unit) {
selector.unit = unit;
}
const meterName = (0, utils_1.getStringFromConfigFile)(element['selector']['meter_name']);
if (meterName) {
selector.meter_name = meterName;
}
const meterVersion = (0, utils_1.getStringFromConfigFile)(element['selector']['meter_version']);
if (meterVersion) {
selector.meter_version = meterVersion;
}
const meterSchemaUrl = (0, utils_1.getStringFromConfigFile)(element['selector']['meter_schema_url']);
if (meterSchemaUrl) {
selector.meter_schema_url = meterSchemaUrl;
}
const instrumentType = (0, utils_1.getStringFromConfigFile)(element['selector']['instrument_type']);
if (instrumentType) {
switch (instrumentType) {
case 'counter':
selector.instrument_type = meterProviderModel_1.InstrumentType.Counter;
break;
case 'gauge':
selector.instrument_type = meterProviderModel_1.InstrumentType.Gauge;
break;
case 'histogram':
selector.instrument_type = meterProviderModel_1.InstrumentType.Histogram;
break;
case 'observable_counter':
selector.instrument_type = meterProviderModel_1.InstrumentType.ObservableCounter;
break;
case 'observable_gauge':
selector.instrument_type = meterProviderModel_1.InstrumentType.ObservableGauge;
break;
case 'observable_up_down_counter':
selector.instrument_type =
meterProviderModel_1.InstrumentType.ObservableUpDownCounter;
break;
case 'up_down_counter':
selector.instrument_type = meterProviderModel_1.InstrumentType.UpDownCounter;
break;
}
}
if (Object.keys(selector).length > 0) {
view.selector = selector;
}
}
if (element['stream']) {
const stream = {};
const name = (0, utils_1.getStringFromConfigFile)(element['stream']['name']);
if (name) {
stream.name = name;
}
const description = (0, utils_1.getStringFromConfigFile)(element['stream']['description']);
if (description) {
stream.description = description;
}
const aggregationCardinalityLimit = (0, utils_1.getNumberFromConfigFile)(element['stream']['aggregation_cardinality_limit']);
if (aggregationCardinalityLimit) {
stream.aggregation_cardinality_limit = aggregationCardinalityLimit;
}
if (element['stream']['attribute_keys']) {
stream.attribute_keys = {
included: (0, utils_1.getStringListFromConfigFile)(element['stream']['attribute_keys']['included']) ?? [],
excluded: (0, utils_1.getStringListFromConfigFile)(element['stream']['attribute_keys']['excluded']) ?? [],
};
}
const rawAgg = element['stream']['aggregation'];
if (rawAgg) {
const aggregation = {};
if (rawAgg['default']) {
aggregation.default = {};
}
if (rawAgg['drop']) {
aggregation.drop = {};
}
if (rawAgg['last_value']) {
aggregation.last_value = {};
}
if (rawAgg['sum']) {
aggregation.sum = {};
}
if (rawAgg['explicit_bucket_histogram']) {
aggregation.explicit_bucket_histogram = {
boundaries: (0, utils_1.getNumberListFromConfigFile)(rawAgg['explicit_bucket_histogram']['boundaries']) ?? [
0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000,
7500, 10000,
],
record_min_max: (0, utils_1.getBooleanFromConfigFile)(rawAgg['explicit_bucket_histogram']['record_min_max']) === false
? false
: true,
};
}
if (rawAgg['base2_exponential_bucket_histogram']) {
aggregation.base2_exponential_bucket_histogram = {
record_min_max: (0, utils_1.getBooleanFromConfigFile)(rawAgg['base2_exponential_bucket_histogram']['record_min_max']) === false
? false
: true,
};
const maxScale = (0, utils_1.getNumberFromConfigFile)(rawAgg['base2_exponential_bucket_histogram']['max_scale']);
if (maxScale) {
aggregation.base2_exponential_bucket_histogram.max_scale =
maxScale;
}
const maxSize = (0, utils_1.getNumberFromConfigFile)(rawAgg['base2_exponential_bucket_histogram']['max_size']);
if (maxSize) {
aggregation.base2_exponential_bucket_histogram.max_size =
maxSize;
}
}
stream.aggregation = aggregation;
}
if (Object.keys(stream).length > 0) {
view.stream = stream;
}
}
config.meter_provider.views.push(view);
}
else {
for (const [key, val] of Object.entries(value)) {
if (val === null &&
// Known type-tag keys, or slash-qualified experimental type-tags
// (e.g. otlp_file/development, prometheus/development)
(NESTED_OBJECT_TYPE_TAGS.has(key) || key.includes('/'))) {
value[key] = {};
}
else {
normalizeYamlNulls(val);
}
}
}
else if (meterProvider &&
(meterProvider.readers == null || meterProvider.readers.length === 0)) {
api_1.diag.warn('MeterProvider must have at least one reader configured');
}
}
exports.setMeterProvider = setMeterProvider;
function getSeverity(severity) {
const severityType = (0, utils_1.getStringFromConfigFile)(severity);
switch (severityType) {
case 'debug':
return commonModel_1.SeverityNumber.DEBUG;
case 'debug2':
return commonModel_1.SeverityNumber.DEBUG2;
case 'debug3':
return commonModel_1.SeverityNumber.DEBUG3;
case 'debug4':
return commonModel_1.SeverityNumber.DEBUG4;
case 'info':
return commonModel_1.SeverityNumber.INFO;
case 'info2':
return commonModel_1.SeverityNumber.INFO2;
case 'info3':
return commonModel_1.SeverityNumber.INFO3;
case 'info4':
return commonModel_1.SeverityNumber.INFO4;
case 'warn':
return commonModel_1.SeverityNumber.WARN;
case 'warn2':
return commonModel_1.SeverityNumber.WARN2;
case 'warn3':
return commonModel_1.SeverityNumber.WARN3;
case 'warn4':
return commonModel_1.SeverityNumber.WARN4;
case 'error':
return commonModel_1.SeverityNumber.ERROR;
case 'error2':
return commonModel_1.SeverityNumber.ERROR2;
case 'error3':
return commonModel_1.SeverityNumber.ERROR3;
case 'error4':
return commonModel_1.SeverityNumber.ERROR4;
case 'fatal':
return commonModel_1.SeverityNumber.FATAL;
case 'fatal2':
return commonModel_1.SeverityNumber.FATAL2;
case 'fatal3':
return commonModel_1.SeverityNumber.FATAL3;
case 'fatal4':
return commonModel_1.SeverityNumber.FATAL4;
case 'trace':
return commonModel_1.SeverityNumber.TRACE;
case 'trace2':
return commonModel_1.SeverityNumber.TRACE2;
case 'trace3':
return commonModel_1.SeverityNumber.TRACE3;
case 'trace4':
return commonModel_1.SeverityNumber.TRACE4;
default:
return undefined;
const ENV_VAR_PATTERN = /\$\{[^}]+\}/;
function substituteEnvVars(obj) {
if (typeof obj === 'string') {
// Only coerce if the string contained env var substitution syntax,
// so that plain YAML strings (e.g. quoted "1234") are not type-coerced.
const hasSubstitution = ENV_VAR_PATTERN.test(obj);
const substituted = (0, utils_1.envVariableSubstitution)(obj);
return hasSubstitution ? yamlCoerce(substituted) : substituted;
}
}
exports.getSeverity = getSeverity;
function setLoggerProvider(config, loggerProvider) {
if (loggerProvider && loggerProvider.processors?.length > 0) {
config.logger_provider = (0, loggerProviderModel_1.initializeDefaultLoggerProviderConfiguration)();
// Limits
if (loggerProvider['limits']) {
const attributeValueLengthLimit = (0, utils_1.getNumberFromConfigFile)(loggerProvider['limits']['attribute_value_length_limit']);
const attributeCountLimit = (0, utils_1.getNumberFromConfigFile)(loggerProvider['limits']['attribute_count_limit']);
if (attributeValueLengthLimit || attributeCountLimit) {
if (attributeValueLengthLimit) {
config.logger_provider.limits.attribute_value_length_limit =
attributeValueLengthLimit;
}
if (attributeCountLimit) {
config.logger_provider.limits.attribute_count_limit =
attributeCountLimit;
}
}
}
// Processors
for (let i = 0; i < loggerProvider['processors'].length; i++) {
const processorType = Object.keys(loggerProvider['processors'][i])[0];
if (processorType === 'batch') {
const element = loggerProvider['processors'][i]['batch'];
if (element) {
const parsedExporter = parseConfigSpanOrLogRecordExporter(element['exporter'], ProviderType.LOGGER);
const batchConfig = {
batch: {
schedule_delay: (0, utils_1.getNumberFromConfigFile)(element['schedule_delay']) ?? 1000,
export_timeout: (0, utils_1.getNumberFromConfigFile)(element['export_timeout']) ?? 30000,
max_queue_size: (0, utils_1.getNumberFromConfigFile)(element['max_queue_size']) ?? 2048,
max_export_batch_size: (0, utils_1.getNumberFromConfigFile)(element['max_export_batch_size']) ??
512,
exporter: parsedExporter,
},
};
config.logger_provider.processors.push(batchConfig);
}
}
else if (processorType === 'simple') {
const element = loggerProvider['processors'][i]['simple'];
if (element) {
const parsedExporter = parseConfigSpanOrLogRecordExporter(element['exporter'], ProviderType.LOGGER);
const simpleConfig = {
simple: {
exporter: parsedExporter,
},
};
config.logger_provider.processors.push(simpleConfig);
}
}
}
// logger_configurator/development
if (loggerProvider['logger_configurator/development']) {
const defaultConfigDisabled = (0, utils_1.getBooleanFromConfigFile)(loggerProvider['logger_configurator/development']['default_config']?.['enabled']);
if (defaultConfigDisabled || defaultConfigDisabled === false) {
config.logger_provider['logger_configurator/development'] = {
default_config: {
enabled: defaultConfigDisabled,
},
};
}
if (loggerProvider['logger_configurator/development'].loggers &&
loggerProvider['logger_configurator/development'].loggers.length > 0) {
const loggers = [];
for (let i = 0; i < loggerProvider['logger_configurator/development'].loggers.length; i++) {
const logger = loggerProvider['logger_configurator/development'].loggers[i];
let enabled = false;
let traceBased;
let minSeverity;
if (logger['config']) {
enabled =
(0, utils_1.getBooleanFromConfigFile)(logger['config']['enabled']) ?? false;
traceBased = (0, utils_1.getBooleanFromConfigFile)(logger['config']['trace_based']);
if (logger['config']['minimum_severity']) {
minSeverity = getSeverity(logger['config']['minimum_severity']);
}
}
const name = (0, utils_1.getStringFromConfigFile)(logger['name']);
if (name) {
const loggerNew = {
name: name,
config: {
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) {
config.logger_provider['logger_configurator/development'] = {};
}
config.logger_provider['logger_configurator/development'].loggers =
loggers;
}
}
if (Array.isArray(obj)) {
return obj.map(substituteEnvVars);
}
else if (loggerProvider &&
(loggerProvider.processors == null ||
loggerProvider.processors.length === 0)) {
api_1.diag.warn('LoggerProvider must have at least one processor configured');
if (typeof obj === 'object' && obj !== null) {
return Object.fromEntries(Object.entries(obj).map(([k, v]) => [k, substituteEnvVars(v)]));
}
return obj;
}
exports.setLoggerProvider = setLoggerProvider;
/**
* Re-coerce a string value to its YAML-equivalent primitive type.
* Env var substitution always returns strings; this converts them back
* to booleans/numbers/null where the schema expects those types.
*/
function yamlCoerce(value) {
if (value === 'true')
return true;
if (value === 'false')
return false;
if (value === 'null' || value === '')
return null;
if (/^-?\d+$/.test(value))
return parseInt(value, 10);
if (/^-?\d+\.\d+$/.test(value))
return parseFloat(value);
return value;
}
//# sourceMappingURL=FileConfigFactory.js.map

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

import type { ConfigurationModel } from './models/configModel';
import type { ConfigurationModel } from './generated/types';
export interface ConfigFactory {

@@ -6,3 +6,3 @@ /**

*
* @returns ConfigurationModel a Configuration Model with all configuration attributes
* @returns ConfigurationModel a ConfigurationModel with all configuration attributes
*/

@@ -9,0 +9,0 @@ getConfigModel(): ConfigurationModel;

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

{"version":3,"file":"IConfigFactory.js","sourceRoot":"","sources":["../../src/IConfigFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ConfigurationModel } from './models/configModel';\n\nexport interface ConfigFactory {\n /**\n * Returns a ConfigurationModel.\n *\n * @returns ConfigurationModel a Configuration Model with all configuration attributes\n */\n getConfigModel(): ConfigurationModel;\n}\n"]}
{"version":3,"file":"IConfigFactory.js","sourceRoot":"","sources":["../../src/IConfigFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ConfigurationModel } from './generated/types';\n\nexport interface ConfigFactory {\n /**\n * Returns a ConfigurationModel.\n *\n * @returns ConfigurationModel a ConfigurationModel with all configuration attributes\n */\n getConfigModel(): ConfigurationModel;\n}\n"]}
export type { ConfigFactory } from './IConfigFactory';
export type { ConfigurationModel } from './models/configModel';
export type { LogRecordExporter as LogRecordExporterConfigModel } from './models/loggerProviderModel';
export type { PushMetricExporter as PushMetricExporterConfigModel, InstrumentType as InstrumentTypeConfigModel, Aggregation as AggregationConfigModel, PeriodicMetricReader as PeriodicMetricReaderConfigModel, } from './models/meterProviderModel';
export type { Sampler as SamplerConfigModel, SpanExporter as SpanExporterConfigModel, SpanProcessor as SpanProcessorConfigModel, } from './models/tracerProviderModel';
export type { NameStringValuePair as NameStringValuePairConfigModel, HttpTls as HttpTlsConfigModel, } from './models/commonModel';
export type { ConfigurationModel, LogRecordExporter as LogRecordExporterConfigModel, PushMetricExporter as PushMetricExporterConfigModel, InstrumentType as InstrumentTypeConfigModel, Aggregation as AggregationConfigModel, PeriodicMetricReader as PeriodicMetricReaderConfigModel, Sampler as SamplerConfigModel, SpanExporter as SpanExporterConfigModel, SpanProcessor as SpanProcessorConfigModel, NameStringValuePair as NameStringValuePairConfigModel, HttpTls as HttpTlsConfigModel, SeverityNumber as SeverityNumberConfigModel, } from './generated/types';
export { createConfigFactory } from './ConfigFactory';
//# sourceMappingURL=index.d.ts.map

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

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

@@ -1,69 +0,9 @@

import type { GrpcTls, HttpTls } from './models/commonModel';
/**
* Retrieves a boolean value from a configuration file parameter.
* - Trims leading and trailing whitespace and ignores casing.
* - Returns `undefined` if the value is empty, unset, or contains only whitespace.
* - Returns `undefined` and a warning for values that cannot be mapped to a boolean.
*
* @param {unknown} value - The value from the config file.
* @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace.
*/
export declare function getBooleanFromConfigFile(value: unknown): boolean | undefined;
/**
* Retrieves a list of booleans from a configuration file parameter.
* - Uses ',' as the delimiter.
* - Trims leading and trailing whitespace from each entry.
* - Excludes empty entries.
* - Returns `undefined` if the variable is empty or contains only whitespace.
* - Returns an empty array if all entries are empty or whitespace.
*
* @param {unknown} value - The value from the config file.
* @returns {boolean[] | undefined} - The list of strings or `undefined`.
*/
export declare function getBooleanListFromConfigFile(value: unknown): boolean[] | undefined;
/**
* Retrieves a number from a configuration file parameter.
* - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace.
* - Returns `undefined` and a warning if is not a number.
* - Returns a number in all other cases.
*
* @param {unknown} value - The value from the config file.
* @returns {number | undefined} - The number value or `undefined`.
*/
export declare function getNumberFromConfigFile(value: unknown): number | undefined;
/**
* Retrieves a list of numbers from a configuration file parameter.
* - Uses ',' as the delimiter.
* - Trims leading and trailing whitespace from each entry.
* - Excludes empty entries.
* - Returns `undefined` if the variable is empty or contains only whitespace.
* - Returns an empty array if all entries are empty or whitespace.
*
* @param {unknown} value - The value from the config file.
* @returns {number[] | undefined} - The list of numbers or `undefined`.
*/
export declare function getNumberListFromConfigFile(value: unknown): number[] | undefined;
/**
* Retrieves a string from a configuration file parameter.
* - Returns `undefined` if the variable is empty, unset, or contains only whitespace.
*
* @param {unknown} value - The value from the config file.
* @returns {string | undefined} - The string value or `undefined`.
*/
export declare function getStringFromConfigFile(value: unknown): string | undefined;
/**
* Retrieves a list of strings from a configuration file parameter.
* - Uses ',' as the delimiter.
* - Trims leading and trailing whitespace from each entry.
* - Excludes empty entries.
* - Returns `undefined` if the variable is empty or contains only whitespace.
* - Returns an empty array if all entries are empty or whitespace.
*
* @param {unknown} value - The value from the config file.
* @returns {string[] | undefined} - The list of strings or `undefined`.
*/
export declare function getStringListFromConfigFile(value: unknown): string[] | undefined;
export declare function envVariableSubstitution(value: unknown): string | undefined;
import type { ConfigurationModel, GrpcTls, HttpTls } from './generated/types';
export declare function envVariableSubstitution(value: string): string;
export declare function getGrpcTlsConfig(certificateFile?: string, clientKeyFile?: string, clientCertificateFile?: string, insecure?: boolean): GrpcTls | undefined;
export declare function initializeDefaultConfiguration(): ConfigurationModel;
export declare function initializeDefaultTracerProviderConfiguration(): NonNullable<ConfigurationModel['tracer_provider']>;
export declare function initializeDefaultMeterProviderConfiguration(): NonNullable<ConfigurationModel['meter_provider']>;
export declare function initializeDefaultLoggerProviderConfiguration(): NonNullable<ConfigurationModel['logger_provider']>;
export declare function getHttpTlsConfig(certificateFile?: string, clientKeyFile?: string, clientCertificateFile?: string): HttpTls | undefined;
//# sourceMappingURL=utils.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHttpTlsConfig = exports.getGrpcTlsConfig = exports.envVariableSubstitution = exports.getStringListFromConfigFile = exports.getStringFromConfigFile = exports.getNumberListFromConfigFile = exports.getNumberFromConfigFile = exports.getBooleanListFromConfigFile = exports.getBooleanFromConfigFile = void 0;
/*

@@ -8,156 +6,27 @@ * Copyright The OpenTelemetry Authors

*/
const api_1 = require("@opentelemetry/api");
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHttpTlsConfig = exports.initializeDefaultLoggerProviderConfiguration = exports.initializeDefaultMeterProviderConfiguration = exports.initializeDefaultTracerProviderConfiguration = exports.initializeDefaultConfiguration = exports.getGrpcTlsConfig = exports.envVariableSubstitution = void 0;
const core_1 = require("@opentelemetry/core");
const util_1 = require("util");
/**
* Retrieves a boolean value from a configuration file parameter.
* - Trims leading and trailing whitespace and ignores casing.
* - Returns `undefined` if the value is empty, unset, or contains only whitespace.
* - Returns `undefined` and a warning for values that cannot be mapped to a boolean.
*
* @param {unknown} value - The value from the config file.
* @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace.
*/
function getBooleanFromConfigFile(value) {
const raw = envVariableSubstitution(value)?.trim().toLowerCase();
if (raw === 'true') {
return true;
}
else if (raw === 'false') {
return false;
}
else if (raw == null || raw === '') {
return undefined;
}
else {
api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)}, expected 'true' or 'false'`);
return undefined;
}
}
exports.getBooleanFromConfigFile = getBooleanFromConfigFile;
/**
* Retrieves a list of booleans from a configuration file parameter.
* - Uses ',' as the delimiter.
* - Trims leading and trailing whitespace from each entry.
* - Excludes empty entries.
* - Returns `undefined` if the variable is empty or contains only whitespace.
* - Returns an empty array if all entries are empty or whitespace.
*
* @param {unknown} value - The value from the config file.
* @returns {boolean[] | undefined} - The list of strings or `undefined`.
*/
function getBooleanListFromConfigFile(value) {
const list = getStringFromConfigFile(value)?.split(',');
if (list) {
const filteredList = [];
for (let i = 0; i < list.length; i++) {
const element = getBooleanFromConfigFile(list[i]);
if (element != null) {
filteredList.push(element);
}
function envVariableSubstitution(value) {
const str = String(value);
// Spec ABNF: $$ is a literal $; ${VAR}, ${VAR:-default}, ${env:VAR}, ${env:VAR:-default}
const TOKEN_RE = /\$\$|\$\{(?:env:)?([a-zA-Z_][a-zA-Z0-9_]*)(?::-(.*?))?\}/g;
let result = '';
let lastIndex = 0;
let match;
while ((match = TOKEN_RE.exec(str)) !== null) {
result += str.slice(lastIndex, match.index);
if (match[0] === '$$') {
result += '$';
}
return filteredList;
}
return list;
}
exports.getBooleanListFromConfigFile = getBooleanListFromConfigFile;
/**
* Retrieves a number from a configuration file parameter.
* - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace.
* - Returns `undefined` and a warning if is not a number.
* - Returns a number in all other cases.
*
* @param {unknown} value - The value from the config file.
* @returns {number | undefined} - The number value or `undefined`.
*/
function getNumberFromConfigFile(value) {
const raw = envVariableSubstitution(value)?.trim();
if (raw == null || raw.trim() === '') {
return undefined;
}
const n = Number(raw);
if (isNaN(n)) {
api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)}, expected a number`);
return undefined;
}
return n;
}
exports.getNumberFromConfigFile = getNumberFromConfigFile;
/**
* Retrieves a list of numbers from a configuration file parameter.
* - Uses ',' as the delimiter.
* - Trims leading and trailing whitespace from each entry.
* - Excludes empty entries.
* - Returns `undefined` if the variable is empty or contains only whitespace.
* - Returns an empty array if all entries are empty or whitespace.
*
* @param {unknown} value - The value from the config file.
* @returns {number[] | undefined} - The list of numbers or `undefined`.
*/
function getNumberListFromConfigFile(value) {
const list = getStringFromConfigFile(value)?.split(',');
if (list) {
const filteredList = [];
for (let i = 0; i < list.length; i++) {
const element = getNumberFromConfigFile(list[i]);
if (element || element === 0) {
filteredList.push(element);
}
else {
const varName = match[1];
const defaultValue = match[2] ?? '';
result += (0, core_1.getStringFromEnv)(varName) || defaultValue;
}
return filteredList;
lastIndex = TOKEN_RE.lastIndex;
}
return list;
result += str.slice(lastIndex);
return result;
}
exports.getNumberListFromConfigFile = getNumberListFromConfigFile;
/**
* Retrieves a string from a configuration file parameter.
* - Returns `undefined` if the variable is empty, unset, or contains only whitespace.
*
* @param {unknown} value - The value from the config file.
* @returns {string | undefined} - The string value or `undefined`.
*/
function getStringFromConfigFile(value) {
const raw = envVariableSubstitution(value)?.trim();
if (value == null || raw === '') {
return undefined;
}
return raw;
}
exports.getStringFromConfigFile = getStringFromConfigFile;
/**
* Retrieves a list of strings from a configuration file parameter.
* - Uses ',' as the delimiter.
* - Trims leading and trailing whitespace from each entry.
* - Excludes empty entries.
* - Returns `undefined` if the variable is empty or contains only whitespace.
* - Returns an empty array if all entries are empty or whitespace.
*
* @param {unknown} value - The value from the config file.
* @returns {string[] | undefined} - The list of strings or `undefined`.
*/
function getStringListFromConfigFile(value) {
value = envVariableSubstitution(value);
return getStringFromConfigFile(value)
?.split(',')
.map(v => v.trim())
.filter(s => s !== '');
}
exports.getStringListFromConfigFile = getStringListFromConfigFile;
function envVariableSubstitution(value) {
if (value == null) {
return undefined;
}
const matches = String(value).match(/\$\{[a-zA-Z0-9,=/_:.-]*\}/g);
if (matches) {
let stringValue = String(value);
for (const match of matches) {
const v = match.substring(2, match.length - 1).split(':-');
const defaultValue = v.length === 2 ? v[1] : '';
const replacement = (0, core_1.getStringFromEnv)(v[0]) || defaultValue;
stringValue = stringValue.replace(match, replacement);
}
return stringValue;
}
return String(value);
}
exports.envVariableSubstitution = envVariableSubstitution;

@@ -184,2 +53,50 @@ function getGrpcTlsConfig(certificateFile, clientKeyFile, clientCertificateFile, insecure) {

exports.getGrpcTlsConfig = getGrpcTlsConfig;
function initializeDefaultConfiguration() {
return {
disabled: false,
resource: {},
attribute_limits: {
attribute_count_limit: 128,
},
};
}
exports.initializeDefaultConfiguration = initializeDefaultConfiguration;
function initializeDefaultTracerProviderConfiguration() {
return {
processors: [],
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 },
},
},
};
}
exports.initializeDefaultTracerProviderConfiguration = initializeDefaultTracerProviderConfiguration;
function initializeDefaultMeterProviderConfiguration() {
return {
readers: [],
views: [],
exemplar_filter: 'trace_based',
};
}
exports.initializeDefaultMeterProviderConfiguration = initializeDefaultMeterProviderConfiguration;
function initializeDefaultLoggerProviderConfiguration() {
return {
processors: [],
limits: { attribute_count_limit: 128 },
'logger_configurator/development': {},
};
}
exports.initializeDefaultLoggerProviderConfiguration = initializeDefaultLoggerProviderConfiguration;
function getHttpTlsConfig(certificateFile, clientKeyFile, clientCertificateFile) {

@@ -186,0 +103,0 @@ if (certificateFile || clientKeyFile || clientCertificateFile) {

@@ -1,1 +0,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,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,MA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ACvC;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 type { 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"]}
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,8CAAuD;AAGvD,SAAgB,uBAAuB,CAAC,KAAa;IACnD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,yFAAyF;IACzF,MAAM,QAAQ,GAAG,2DAA2D,CAAC;IAC7E,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,SAAS,GAA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e,CAAC;SAC/B;QACD,IAAI,aAAa,EAAE;YACjB,GAAG,CAAC,QAAQ,GAAG,aAAa,CAAC;SAC9B;QACD,IAAI,qBAAqB,EAAE;YACzB,GAAG,CAAC,SAAS,GAAG,qBAAqB,CAAC;SACvC;QACD,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAnBD,4CAmBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport type { ConfigurationModel, GrpcTls, HttpTls } from './generated/types';\n\nexport function envVariableSubstitution(value: string): string {\n const str = String(value);\n // Spec ABNF: $$ is a literal $; ${VAR}, ${VAR:-default}, ${env:VAR}, ${env:VAR:-default}\n const TOKEN_RE = /\\$\\$|\\$\\{(?:env:)?([a-zA-Z_][a-zA-Z0-9_]*)(?::-(.*?))?\\}/g;\n let result = '';\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n while ((match = TOKEN_RE.exec(str)) !== null) {\n result += str.slice(lastIndex, match.index);\n if (match[0] === '$$') {\n result += '$';\n } else {\n const varName = match[1];\n const defaultValue = match[2] ?? '';\n result += getStringFromEnv(varName) || defaultValue;\n }\n lastIndex = TOKEN_RE.lastIndex;\n }\n\n result += str.slice(lastIndex);\n return result;\n}\n\nexport function getGrpcTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string,\n insecure?: boolean\n): GrpcTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: GrpcTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n if (insecure !== undefined) {\n tls.insecure = insecure;\n }\n return tls;\n }\n return undefined;\n}\n\nexport function initializeDefaultConfiguration(): ConfigurationModel {\n return {\n disabled: false,\n resource: {},\n attribute_limits: {\n attribute_count_limit: 128,\n },\n };\n}\n\nexport function initializeDefaultTracerProviderConfiguration(): NonNullable<\n ConfigurationModel['tracer_provider']\n> {\n return {\n processors: [],\n limits: {\n attribute_count_limit: 128,\n event_count_limit: 128,\n link_count_limit: 128,\n event_attribute_count_limit: 128,\n link_attribute_count_limit: 128,\n },\n sampler: {\n parent_based: {\n root: { always_on: undefined },\n remote_parent_sampled: { always_on: undefined },\n remote_parent_not_sampled: { always_off: undefined },\n local_parent_sampled: { always_on: undefined },\n local_parent_not_sampled: { always_off: undefined },\n },\n },\n };\n}\n\nexport function initializeDefaultMeterProviderConfiguration(): NonNullable<\n ConfigurationModel['meter_provider']\n> {\n return {\n readers: [],\n views: [],\n exemplar_filter: 'trace_based',\n };\n}\n\nexport function initializeDefaultLoggerProviderConfiguration(): NonNullable<\n ConfigurationModel['logger_provider']\n> {\n return {\n processors: [],\n limits: { attribute_count_limit: 128 },\n 'logger_configurator/development': {},\n };\n}\n\nexport function getHttpTlsConfig(\n certificateFile?: string,\n clientKeyFile?: string,\n clientCertificateFile?: string\n): HttpTls | undefined {\n if (certificateFile || clientKeyFile || clientCertificateFile) {\n const tls: HttpTls = {};\n if (certificateFile) {\n tls.ca_file = certificateFile;\n }\n if (clientKeyFile) {\n tls.key_file = clientKeyFile;\n }\n if (clientCertificateFile) {\n tls.cert_file = clientCertificateFile;\n }\n return tls;\n }\n return undefined;\n}\n"]}

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

export declare const VERSION = "0.216.0";
export declare const VERSION = "0.217.0";
//# sourceMappingURL=version.d.ts.map

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

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

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

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

@@ -12,2 +12,3 @@ "main": "build/src/index.js",

"clean": "tsc --build --clean",
"generate:config": "node ./scripts/generate-config.js",
"test": "nyc mocha test/**/*.test.ts",

@@ -53,2 +54,4 @@ "lint": "eslint . --ext .ts",

"@types/sinon": "17.0.4",
"ajv": "^8.0.0",
"json-schema-to-typescript": "^15.0.0",
"mocha": "11.7.5",

@@ -62,3 +65,3 @@ "nyc": "17.1.0",

"sideEffects": false,
"gitHead": "2400d8389a4469f7a81ccd3be2f0b2c2dd6faaf7"
"gitHead": "74cde1b674508ccc0ed2601ac43a80ff2d35114c"
}
+122
-13

@@ -1,3 +0,4 @@

# OpenTelemetry SDK for Node.js
# OpenTelemetry Declarative Configuration
[![NPM Published Version][npm-img]][npm-url]
[![Apache License][license-image]][license-image]

@@ -7,23 +8,130 @@

This package provides the configuration for OpenTelemetry JavaScript SDK.
This package implements the [OpenTelemetry declarative configuration](https://github.com/open-telemetry/opentelemetry-configuration) specification for Node.js. It parses configuration from a YAML file or environment variables and produces a `ConfigurationModel` that the OpenTelemetry SDK uses to initialize providers.
## Quick Start
## Installation
**Note: Much of OpenTelemetry JS documentation is written assuming the compiled application is run as CommonJS.**
For more details on ECMAScript Modules vs CommonJS, refer to [esm-support](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md).
```sh
npm install @opentelemetry/configuration
```
To get started you need to install `@opentelemetry/configuration`.
## Usage
### Installation
`createConfigFactory()` selects the configuration source automatically:
- If `OTEL_CONFIG_FILE` points to a valid `.yaml`/`.yml` file, configuration is read from that file.
- Otherwise, configuration is assembled from standard OpenTelemetry environment variables.
```typescript
import { createConfigFactory } from '@opentelemetry/configuration';
const factory = createConfigFactory();
const config = factory.getConfigModel();
```
### YAML file configuration
Set `OTEL_CONFIG_FILE` to the path of your configuration file:
```sh
# Install the package
npm install @opentelemetry/configuration
OTEL_CONFIG_FILE=./otel-config.yaml node app.js
```
Example:
```yaml
file_format: "1.0"
resource:
attributes:
- name: service.name
value: my-service
tracer_provider:
processors:
- batch:
exporter:
otlp_http:
endpoint: http://localhost:4318/v1/traces
```
Environment variable substitution is supported using `${VAR_NAME}`, `${VAR_NAME:-default}`, `${env:VAR_NAME}`, and `${env:VAR_NAME:-default}` syntax. Use `$$` for a literal `$`.
```yaml
tracer_provider:
processors:
- batch:
exporter:
otlp_http:
endpoint: ${OTEL_EXPORTER_ENDPOINT:-http://localhost:4318}/v1/traces
```
### Environment variable configuration
When no config file is set, the factory reads from the standard OpenTelemetry SDK environment variables:
| Variable | Description |
| --- | --- |
| `OTEL_SDK_DISABLED` | Disable the SDK entirely |
| `OTEL_LOG_LEVEL` | Internal SDK log level |
| `OTEL_SERVICE_NAME` | Service name resource attribute |
| `OTEL_RESOURCE_ATTRIBUTES` | Comma-separated resource attributes |
| `OTEL_TRACES_EXPORTER` | Traces exporter(s): `otlp`, `console`, `none` |
| `OTEL_METRICS_EXPORTER` | Metrics exporter(s): `otlp`, `prometheus`, `console`, `none` |
| `OTEL_LOGS_EXPORTER` | Logs exporter(s): `otlp`, `console`, `none` |
| `OTEL_EXPORTER_OTLP_PROTOCOL` | OTLP protocol: `grpc`, `http/protobuf`, `http/json` |
| `OTEL_PROPAGATORS` | Propagators: `tracecontext`, `baggage`, `b3`, `b3multi` |
## Development
### Generated files
`src/generated/` is auto-generated — do not edit manually. It contains:
- `types.ts` — TypeScript interfaces derived from the JSON schema (via `json-schema-to-typescript`)
- `schema.ts` — The raw JSON schema exported as a constant (retained for reference; not used at runtime)
- `validator.js` — Pre-compiled ajv validator (ahead-of-time compiled from the schema at build time; eliminates runtime `ajv.compile()`)
- `validator.d.ts` — TypeScript declarations for `validator.js`
### Regenerating after a schema version bump
1. Update the `CONFIG_VERSION` variable in `scripts/config/generate-config.sh`
2. Run from this package directory:
```sh
npm run generate:config
```
3. Review the diff in `src/generated/types.ts`, `src/generated/schema.ts`, and `src/generated/validator.js`
4. Update `supportedFileVersionPattern` in `src/FileConfigFactory.ts` if the new version falls outside the current regex
5. Update `EnvironmentConfigFactory.ts` and `utils.ts` if new fields need env var mapping
The generation script (`scripts/config/generate-config.js`) handles several post-processing steps:
- Renames the root type from `OpenTelemetryConfiguration` to `ConfigurationModel`
- Makes `file_format` optional (required at parse time but not needed when constructing the model in code)
- Replaces narrow index signatures (`[k: string]: {} | null`) with `[k: string]: unknown`
- Deduplicates structurally-identical TLS types (`GrpcTls1`/`HttpTls1` → `GrpcTls`/`HttpTls`)
- Produces a pre-compiled ajv validator (`validator.js` + `validator.d.ts`) for use at runtime
### Defaults
Both config paths apply the same spec-defined defaults so consumers see consistent behaviour regardless of config source:
| Field | Default |
| --- | --- |
| `disabled` | `false` |
| `log_level` | `info` |
| `attribute_limits.attribute_count_limit` | `128` |
`FileConfigFactory` applies these via `applyConfigDefaults()` after schema validation. `EnvironmentConfigFactory` applies them via `initializeDefaultConfiguration()` in the constructor, then overlays env var values on top.
One intentional exception in both paths: `AttributeNameValue.type` is **not** defaulted even though the spec says "if omitted, string is used". This is a semantic default for SDK code interpreting resource attributes, not a config-parser concern. SDK code reading `resource.attributes` should apply `attr.type ?? 'string'` at the point of use.
## Supported schema versions
- `1.0`
## Useful links
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]
- [OpenTelemetry Declarative Configuration Specification](https://github.com/open-telemetry/opentelemetry-configuration)
- [OpenTelemetry for Node.js](https://github.com/open-telemetry/opentelemetry-js)
- [OpenTelemetry Community](https://opentelemetry.io/)

@@ -34,4 +142,5 @@ ## License

[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
[npm-url]: https://www.npmjs.com/package/@opentelemetry/configuration
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fconfiguration.svg
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
export interface IncludeExclude {
/**
* 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?: string[];
/**
* 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?: string[];
}
export interface NameStringValuePair {
name: string;
value: string;
}
export interface OtlpHttpExporter {
/**
* Configure endpoint, including the trace, metric or log specific path.
* If omitted or null, http://localhost:4318/v1/traces is used for trace,
* http://localhost:4318/v1/metrics for metrics
* and http://localhost:4318/v1/logs is used for logs.
*/
endpoint?: string;
/**
* Configure TLS settings for the exporter.
*/
tls?: HttpTls;
/**
* Configure compression.
* Values include: gzip, none. Implementations may support other compression algorithms.
* If omitted or null, none is used.
*/
compression?: string;
/**
* Configure max time (in milliseconds) to wait for each export.
* Value must be non-negative. A value of 0 indicates no limit (infinity).
* If omitted or null, 10000 is used.
*/
timeout?: number;
/**
* Configure headers. Entries have higher priority than entries from .headers_list.
* If an entry's .value is null, the entry is ignored.
*/
headers?: NameStringValuePair[];
/**
* Configure headers. Entries have lower priority than entries from .headers.
* The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS.
* If omitted or null, no headers are added.
*/
headers_list?: string;
/**
* Configure the encoding used for messages.
* Values include: protobuf, json. Implementations may not support json.
* If omitted or null, protobuf is used.
*/
encoding?: OtlpHttpEncoding;
}
export declare enum OtlpHttpEncoding {
JSON = "json",
Protobuf = "protobuf"
}
export interface OtlpGrpcExporter {
/**
* Configure endpoint.
* If omitted or null, http://localhost:4317 is used.
*/
endpoint?: string;
/**
* Configure TLS settings for the exporter.
*/
tls?: GrpcTls;
/**
* Configure headers. Entries have higher priority than entries from .headers_list.
* If an entry's .value is null, the entry is ignored.
*/
headers?: NameStringValuePair[];
/**
* Configure headers. Entries have lower priority than entries from .headers.
* The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS.
* If omitted or null, no headers are added.
*/
headers_list?: string;
/**
* Configure compression.
* Values include: gzip, none. Implementations may support other compression algorithms.
* If omitted or null, none is used.
*/
compression?: string;
/**
* Configure max time (in milliseconds) to wait for each export.
* Value must be non-negative. A value of 0 indicates no limit (infinity).
* If omitted or null, 10000 is used.
*/
timeout?: number;
}
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.
* 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;
}
export declare 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"
}
//# sourceMappingURL=commonModel.d.ts.map
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.SeverityNumber = exports.OtlpHttpEncoding = void 0;
var OtlpHttpEncoding;
(function (OtlpHttpEncoding) {
OtlpHttpEncoding["JSON"] = "json";
OtlpHttpEncoding["Protobuf"] = "protobuf";
})(OtlpHttpEncoding = exports.OtlpHttpEncoding || (exports.OtlpHttpEncoding = {}));
var SeverityNumber;
(function (SeverityNumber) {
SeverityNumber["DEBUG"] = "debug";
SeverityNumber["DEBUG2"] = "debug2";
SeverityNumber["DEBUG3"] = "debug3";
SeverityNumber["DEBUG4"] = "debug4";
SeverityNumber["ERROR"] = "error";
SeverityNumber["ERROR2"] = "error2";
SeverityNumber["ERROR3"] = "error3";
SeverityNumber["ERROR4"] = "error4";
SeverityNumber["FATAL"] = "fatal";
SeverityNumber["FATAL2"] = "fatal2";
SeverityNumber["FATAL3"] = "fatal3";
SeverityNumber["FATAL4"] = "fatal4";
SeverityNumber["INFO"] = "info";
SeverityNumber["INFO2"] = "info2";
SeverityNumber["INFO3"] = "info3";
SeverityNumber["INFO4"] = "info4";
SeverityNumber["TRACE"] = "trace";
SeverityNumber["TRACE2"] = "trace2";
SeverityNumber["TRACE3"] = "trace3";
SeverityNumber["TRACE4"] = "trace4";
SeverityNumber["WARN"] = "warn";
SeverityNumber["WARN2"] = "warn2";
SeverityNumber["WARN3"] = "warn3";
SeverityNumber["WARN4"] = "warn4";
})(SeverityNumber = exports.SeverityNumber || (exports.SeverityNumber = {}));
//# sourceMappingURL=commonModel.js.map
{"version":3,"file":"commonModel.js","sourceRoot":"","sources":["../../../src/models/commonModel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,YAAY,CAAC;;;AA4Eb,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,yCAAqB,CAAA;AACvB,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AAwGD,IAAY,cAyBX;AAzBD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;IACb,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;IACb,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,iCAAe,CAAA;AACjB,CAAC,EAzBW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAyBzB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n'use strict';\n\nexport interface IncludeExclude {\n /**\n * Configure list of attribute key patterns to include from resource detectors.\n * Attribute keys from resource detectors are evaluated to match as follows:\n * * If the value of the attribute key exactly matches.\n * * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * If omitted, all attributes are included.\n */\n included?: string[];\n\n /**\n * 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).\n * Attribute keys from resource detectors are evaluated to match as follows:\n * * If the value of the attribute key exactly matches.\n * * If the value of the attribute key matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\n * If omitted, .included attributes are included.\n */\n excluded?: string[];\n}\n\nexport interface NameStringValuePair {\n name: string;\n value: string;\n}\n\nexport interface OtlpHttpExporter {\n /**\n * Configure endpoint, including the trace, metric or log specific path.\n * If omitted or null, http://localhost:4318/v1/traces is used for trace,\n * http://localhost:4318/v1/metrics for metrics\n * and http://localhost:4318/v1/logs is used for logs.\n */\n endpoint?: string;\n\n /**\n * Configure TLS settings for the exporter.\n */\n tls?: HttpTls;\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 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 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\nexport enum OtlpHttpEncoding {\n JSON = 'json',\n Protobuf = 'protobuf',\n}\n\nexport interface OtlpGrpcExporter {\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\nexport interface ExperimentalOtlpFileExporter {\n /**\n * Configure output stream.\n * Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.\n * If omitted or null, stdout is used.\n */\n output_stream?: string;\n}\n\nexport interface HttpTls {\n /**\n * Configure certificate used to verify a server's TLS credentials.\n * Absolute path to certificate file in PEM format.\n * If omitted or null, system default certificate verification is used for secure connections.\n */\n ca_file?: string;\n\n /**\n * Configure mTLS private client key.\n * Absolute path to client key file in PEM format. If set, .client_certificate must also be set.\n * If omitted or null, mTLS is not used.\n */\n key_file?: string;\n\n /**\n * Configure mTLS client certificate.\n * Absolute path to client certificate file in PEM format. If set, .client_key must also be set.\n * If omitted or null, mTLS is not used.\n */\n cert_file?: string;\n}\n\nexport interface GrpcTls {\n /**\n * Configure certificate used to verify a server's TLS credentials.\n * Absolute path to certificate file in PEM format.\n * If omitted or null, system default certificate verification is used for secure connections.\n */\n ca_file?: string;\n\n /**\n * Configure mTLS private client key.\n * Absolute path to client key file in PEM format. If set, .client_certificate must also be set.\n * If omitted or null, mTLS is not used.\n */\n key_file?: string;\n\n /**\n * Configure mTLS client certificate.\n * Absolute path to client certificate file in PEM format. If set, .client_key must also be set.\n * If omitted or null, mTLS is not used.\n */\n cert_file?: string;\n\n /**\n * Configure client transport security for the exporter's connection.\n * Only applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure.\n * If omitted or null, false is used.\n */\n insecure?: boolean;\n}\n\nexport enum SeverityNumber {\n DEBUG = 'debug',\n DEBUG2 = 'debug2',\n DEBUG3 = 'debug3',\n DEBUG4 = 'debug4',\n ERROR = 'error',\n ERROR2 = 'error2',\n ERROR3 = 'error3',\n ERROR4 = 'error4',\n FATAL = 'fatal',\n FATAL2 = 'fatal2',\n FATAL3 = 'fatal3',\n FATAL4 = 'fatal4',\n INFO = 'info',\n INFO2 = 'info2',\n INFO3 = 'info3',\n INFO4 = 'info4',\n TRACE = 'trace',\n TRACE2 = 'trace2',\n TRACE3 = 'trace3',\n TRACE4 = 'trace4',\n WARN = 'warn',\n WARN2 = 'warn2',\n WARN3 = 'warn3',\n WARN4 = 'warn4',\n}\n"]}
import type { TracerProvider } from './tracerProviderModel';
import type { LoggerProvider } from './loggerProviderModel';
import type { Resource } from './resourceModel';
import type { MeterProvider } from './meterProviderModel';
export interface ConfigurationModel {
/**
* Configure if the SDK is disabled or not.
* If omitted or null, false is used.
*/
disabled?: boolean;
/**
* Configure the log level of the internal logger used by the SDK.
* If omitted, info is used.
*/
log_level?: number;
/**
* Configure resource for all signals.
* If omitted, the default resource is used.
*/
resource?: Resource;
/**
* Configure general attribute limits.
* See also tracer_provider.limits, logger_provider.limits.
*/
attribute_limits?: AttributeLimits;
/**
* Configure text map context propagators.
*/
propagator?: Propagator;
/**
* Configure tracer provider.
*/
tracer_provider?: TracerProvider;
/**
* Configure meter provider.
*/
meter_provider?: MeterProvider;
/**
* Configure logger provider.
*/
logger_provider?: LoggerProvider;
}
export declare function initializeDefaultConfiguration(): ConfigurationModel;
export interface AttributeLimits {
/**
* Configure max attribute value size.
* Value must be non-negative.
* If omitted or null, there is no limit.
*/
attribute_value_length_limit?: number;
/**
* Configure max attribute count.
* Value must be non-negative.
* If omitted or null, 128 is used.
*/
attribute_count_limit: number;
}
export interface 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?: object[];
/**
* 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.
* 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?: string;
}
//# sourceMappingURL=configModel.d.ts.map
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.initializeDefaultConfiguration = void 0;
const api_1 = require("@opentelemetry/api");
function initializeDefaultConfiguration() {
const config = {
disabled: false,
log_level: api_1.DiagLogLevel.INFO,
resource: {},
attribute_limits: {
attribute_count_limit: 128,
},
};
return config;
}
exports.initializeDefaultConfiguration = initializeDefaultConfiguration;
//# sourceMappingURL=configModel.js.map
{"version":3,"file":"configModel.js","sourceRoot":"","sources":["../../../src/models/configModel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,YAAY,CAAC;;;AAEb,4CAAkD;AAoDlD,SAAgB,8BAA8B;IAC5C,MAAM,MAAM,GAAuB;QACjC,QAAQ,EAAE,KAAK;QACf,SAAS,EAAE,kBAAY,CAAC,IAAI;QAC5B,QAAQ,EAAE,EAAE;QACZ,gBAAgB,EAAE;YAChB,qBAAqB,EAAE,GAAG;SAC3B;KACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAXD,wEAWC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n'use strict';\n\nimport { DiagLogLevel } from '@opentelemetry/api';\nimport type { TracerProvider } from './tracerProviderModel';\nimport type { LoggerProvider } from './loggerProviderModel';\nimport type { Resource } from './resourceModel';\nimport type { MeterProvider } from './meterProviderModel';\n\nexport interface ConfigurationModel {\n /**\n * Configure if the SDK is disabled or not.\n * If omitted or null, false is used.\n */\n disabled?: boolean;\n\n /**\n * Configure the log level of the internal logger used by the SDK.\n * If omitted, info is used.\n */\n log_level?: number;\n\n /**\n * Configure resource for all signals.\n * If omitted, the default resource is used.\n */\n resource?: Resource;\n\n /**\n * Configure general attribute limits.\n * See also tracer_provider.limits, logger_provider.limits.\n */\n attribute_limits?: AttributeLimits;\n\n /**\n * Configure text map context propagators.\n */\n propagator?: Propagator;\n\n /**\n * Configure tracer provider.\n */\n tracer_provider?: TracerProvider;\n\n /**\n * Configure meter provider.\n */\n meter_provider?: MeterProvider;\n\n /**\n * Configure logger provider.\n */\n logger_provider?: LoggerProvider;\n}\n\nexport function initializeDefaultConfiguration(): ConfigurationModel {\n const config: ConfigurationModel = {\n disabled: false,\n log_level: DiagLogLevel.INFO,\n resource: {},\n attribute_limits: {\n attribute_count_limit: 128,\n },\n };\n\n return config;\n}\nexport interface AttributeLimits {\n /**\n * Configure max attribute value size.\n * Value must be non-negative.\n * If omitted or null, there is no limit.\n */\n attribute_value_length_limit?: number;\n\n /**\n * Configure max attribute count.\n * Value must be non-negative.\n * If omitted or null, 128 is used.\n */\n attribute_count_limit: number;\n}\n\nexport interface Propagator {\n /**\n * Configure the propagators in the composite text map propagator.\n * Entries from .composite_list are appended to the list here with duplicates filtered out.\n * Built-in propagator keys include: tracecontext, baggage, b3, b3multi, jaeger, ottrace.\n * Known third party keys include: xray.\n * If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used.\n */\n composite?: object[];\n\n /**\n * Configure the propagators in the composite text map propagator.\n * Entries are appended to .composite with duplicates filtered out.\n * The value is a comma separated list of propagator identifiers matching the format of OTEL_PROPAGATORS.\n * Built-in propagator identifiers include: tracecontext, baggage, b3, b3multi, jaeger, ottrace.\n * Known third party identifiers include: xray.\n * If the resolved list of propagators (from .composite and .composite_list) is empty, a noop propagator is used.\n */\n composite_list?: string;\n}\n"]}
import type { ExperimentalOtlpFileExporter, OtlpGrpcExporter, OtlpHttpExporter, SeverityNumber } from './commonModel';
export declare function initializeDefaultLoggerProviderConfiguration(): Required<LoggerProvider>;
export interface LoggerProvider {
/**
* Configure log record processors.
*/
processors: LogRecordProcessor[];
/**
* Configure log record limits. See also attribute_limits.
*/
limits?: LogRecordLimits;
/**
* Configure loggers.
* This type is in development and subject to breaking changes in minor versions.
*/
'logger_configurator/development'?: ExperimentalLoggerConfigurator;
}
export interface SimpleLogRecordProcessor {
/**
* Configure exporter.
*/
exporter: LogRecordExporter;
}
export interface BatchLogRecordProcessor {
/**
* Configure delay interval (in milliseconds) between two consecutive exports.
* Value must be non-negative.
* If omitted or null, 1000 is used for traces and 1000 for logs.
*/
schedule_delay?: number;
/**
* 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.
*/
max_queue_size?: number;
/**
* Configure maximum batch size. Value must be positive.
* If omitted or null, 512 is used.
*/
max_export_batch_size?: number;
/**
* Configure exporter.
*/
exporter: LogRecordExporter;
}
export interface LogRecordExporter {
/**
* Configure exporter to be OTLP with HTTP transport.
*/
otlp_http?: OtlpHttpExporter;
/**
* Configure exporter to be OTLP with gRPC transport.
*/
otlp_grpc?: OtlpGrpcExporter;
/**
* Configure exporter to be OTLP with file transport.
* This type is in development and subject to breaking changes in minor versions.
*/
'otlp_file/development'?: ExperimentalOtlpFileExporter;
/**
* Configure exporter to be console.
*/
console?: object;
}
export interface LogRecordLimits {
/**
* 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;
/**
* 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?: number;
}
export interface LogRecordProcessor {
/**
* Configure a batch log record processor.
*/
batch?: BatchLogRecordProcessor;
/**
* Configure a simple log record processor.
*/
simple?: SimpleLogRecordProcessor;
}
export interface ExperimentalLoggerConfigurator {
/**
* Configure the default logger config used there is no matching entry in .logger_configurator/development.loggers.
*/
default_config?: ExperimentalLoggerConfig;
/**
* Configure loggers.
*/
loggers?: ExperimentalLoggerMatcherAndConfig[];
}
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;
/**
* The logger config.
*/
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;
}
//# sourceMappingURL=loggerProviderModel.d.ts.map
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.initializeDefaultLoggerProviderConfiguration = void 0;
function initializeDefaultLoggerProviderConfiguration() {
return {
processors: [],
limits: {
attribute_count_limit: 128,
},
'logger_configurator/development': {},
};
}
exports.initializeDefaultLoggerProviderConfiguration = initializeDefaultLoggerProviderConfiguration;
//# sourceMappingURL=loggerProviderModel.js.map
{"version":3,"file":"loggerProviderModel.js","sourceRoot":"","sources":["../../../src/models/loggerProviderModel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,YAAY,CAAC;;;AASb,SAAgB,4CAA4C;IAC1D,OAAO;QACL,UAAU,EAAE,EAAE;QACd,MAAM,EAAE;YACN,qBAAqB,EAAE,GAAG;SAC3B;QACD,iCAAiC,EAAE,EAAE;KACtC,CAAC;AACJ,CAAC;AARD,oGAQC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n'use strict';\n\nimport type {\n ExperimentalOtlpFileExporter,\n OtlpGrpcExporter,\n OtlpHttpExporter,\n SeverityNumber,\n} from './commonModel';\n\nexport function initializeDefaultLoggerProviderConfiguration(): Required<LoggerProvider> {\n return {\n processors: [],\n limits: {\n attribute_count_limit: 128,\n },\n 'logger_configurator/development': {},\n };\n}\n\nexport interface LoggerProvider {\n /**\n * Configure log record processors.\n */\n processors: LogRecordProcessor[];\n\n /**\n * Configure log record limits. See also attribute_limits.\n */\n limits?: LogRecordLimits;\n\n /**\n * Configure loggers.\n * This type is in development and subject to breaking changes in minor versions.\n */\n 'logger_configurator/development'?: ExperimentalLoggerConfigurator;\n}\n\nexport interface SimpleLogRecordProcessor {\n /**\n * Configure exporter.\n */\n exporter: LogRecordExporter;\n}\n\nexport interface BatchLogRecordProcessor {\n /**\n * Configure delay interval (in milliseconds) between two consecutive exports.\n * Value must be non-negative.\n * If omitted or null, 1000 is used 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: LogRecordExporter;\n}\n\nexport interface LogRecordExporter {\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 LogRecordLimits {\n /**\n * Configure max attribute value size. Overrides .attribute_limits.attribute_value_length_limit.\n * Value must be non-negative.\n * If omitted or null, there is no limit.\n */\n attribute_value_length_limit?: number;\n\n /**\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\nexport interface LogRecordProcessor {\n /**\n * Configure a batch log record processor.\n */\n batch?: BatchLogRecordProcessor;\n\n /**\n * Configure a simple log record processor.\n */\n simple?: SimpleLogRecordProcessor;\n}\n\nexport interface ExperimentalLoggerConfigurator {\n /**\n * Configure the default logger config used there is no matching entry in .logger_configurator/development.loggers.\n */\n default_config?: ExperimentalLoggerConfig;\n\n /**\n * Configure loggers.\n */\n loggers?: ExperimentalLoggerMatcherAndConfig[];\n}\n\nexport interface ExperimentalLoggerMatcherAndConfig {\n /**\n * Configure logger names to match, evaluated as follows:\n * * If the logger name exactly matches.\n * * If the logger name matches the wildcard pattern, where '?' matches any single character\n * and '*' matches any number of characters including none.\n */\n name: string;\n\n /**\n * The logger config.\n */\n config: ExperimentalLoggerConfig;\n}\n\nexport interface ExperimentalLoggerConfig {\n /**\n * Configure if the logger is enabled or not.\n */\n enabled?: boolean;\n\n /**\n * Configure severity filtering.\n * Log records with an non-zero (i.e. unspecified) severity number which is less than minimum_severity are not processed.\n */\n minimum_severity?: SeverityNumber;\n\n /**\n * Configure trace based filtering.\n * If true, log records associated with unsampled trace contexts traces are not processed. If false, or if a log record is not associated with a trace context, trace based filtering is not applied.\n */\n trace_based?: boolean;\n}\n"]}
import type { GrpcTls, HttpTls, IncludeExclude, NameStringValuePair, OtlpHttpEncoding } from './commonModel';
export declare function initializeDefaultMeterProviderConfiguration(): Required<MeterProvider>;
export interface MeterProvider {
/**
* Configure metric readers.
*/
readers: MetricReader[];
/**
* Configure views.
* Each view has a selector which determines the instrument(s) it applies to,
* and a configuration for the resulting stream(s).
*/
views?: View[];
/**
* Configure the exemplar filter.
* Values include: trace_based, always_on, always_off.
* If omitted or null, trace_based is used.
*/
exemplar_filter?: ExemplarFilter;
}
export declare enum ExemplarFilter {
AlwaysOff = "always_off",
AlwaysOn = "always_on",
TraceBased = "trace_based"
}
export interface PeriodicMetricReader {
/**
* Configure delay interval (in milliseconds) between start of two consecutive exports.
* Value must be non-negative.
* If omitted or null, 60000 is used.
*/
interval?: number;
/**
* 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?: number;
/**
* Configure exporter.
*/
exporter: PushMetricExporter;
/**
* Configure metric producers.
*/
producers?: MetricProducer[];
/**
* Configure cardinality limits.
*/
cardinality_limits?: CardinalityLimits;
}
export interface PullMetricReader {
/**
* Configure exporter.
*/
exporter: PullMetricExporter;
/**
* Configure metric producers.
*/
producers?: MetricProducer[];
/**
* Configure cardinality limits.
*/
cardinality_limits?: CardinalityLimits;
}
export interface CardinalityLimits {
/**
* Configure default cardinality limit for all instrument types.
* Instrument-specific cardinality limits take priority.
* If omitted or null, 2000 is used.
*/
default?: number;
/**
* Configure default cardinality limit for counter instruments.
* If omitted or null, the value from .default is used.
*/
counter?: number;
/**
* Configure default cardinality limit for gauge instruments.
* If omitted or null, the value from .default is used.
*/
gauge?: number;
/**
* Configure default cardinality limit for histogram instruments.
* If omitted or null, the value from .default is used.
*/
histogram?: number;
/**
* Configure default cardinality limit for observable_counter instruments.
* If omitted or null, the value from .default is used.
*/
observable_counter?: number;
/**
* Configure default cardinality limit for observable_gauge instruments.
* If omitted or null, the value from .default is used.
*/
observable_gauge?: number;
/**
* Configure default cardinality limit for observable_up_down_counter instruments.
* If omitted or null, the value from .default is used.
*/
observable_up_down_counter?: number;
/**
* Configure default cardinality limit for up_down_counter instruments.
* If omitted or null, the value from .default is used.
*/
up_down_counter?: number;
}
export interface PushMetricExporter {
/**
* Configure exporter to be OTLP with HTTP transport.
*/
otlp_http?: OtlpHttpMetricExporter;
/**
* Configure exporter to be OTLP with gRPC transport.
*/
otlp_grpc?: OtlpGrpcMetricExporter;
/**
* Configure exporter to be OTLP with file transport.
* This type is in development and subject to breaking changes in minor versions.
*/
'otlp_file/development'?: ExperimentalOtlpFileMetricExporter;
/**
* Configure exporter to be console.
*/
console?: ConsoleMetricExporter;
}
export interface PullMetricExporter {
/**
* Configure exporter to be prometheus.
* This type is in development and subject to breaking changes in minor versions.
*/
'prometheus/development': ExperimentalPrometheusMetricExporter;
}
export interface MetricProducer {
/**
* Configure metric producer to be opencensus.
*/
opencensus?: object;
}
export interface ExperimentalPrometheusMetricExporter {
/**
* Configure host.
* If omitted or null, localhost is used.
*/
host?: string;
/**
* Configure port.
* If omitted or null, 9464 is used.
*/
port?: number;
/**
* Configure Prometheus Exporter to produce metrics without a scope info metric.
* If omitted or null, false is used.
*/
without_scope_info?: boolean;
/**
* Configure Prometheus Exporter to produce metrics without a target info metric for the resource.
* If omitted or null, false is used.
*/
without_target_info?: boolean;
/**
* Configure Prometheus Exporter to add resource attributes as metrics attributes.
*/
with_resource_constant_labels?: IncludeExclude;
/**
* Configure how metric names are translated to Prometheus metric names.
*/
translation_strategy?: ExperimentalPrometheusTranslationStrategy;
}
export declare enum ExperimentalPrometheusTranslationStrategy {
UnderscoreEscapingWithSuffixes = "underscore_escaping_with_suffixes",
UnderscoreEscapingWithoutSuffixes = "underscore_escaping_without_suffixes",
NoUtf8EscapingWithSuffixes = "no_utf8_escaping_with_suffixes",
NoTranslation = "no_translation"
}
export interface MetricReader {
/**
* Configure a periodic metric reader.
*/
periodic?: PeriodicMetricReader;
/**
* Configure a pull based metric reader.
*/
pull?: PullMetricReader;
}
export interface OtlpHttpMetricExporter {
/**
* Configure endpoint, including the metric specific path.
* If omitted or null, http://localhost:4318/v1/metrics is used.
*/
endpoint?: string;
/**
* Configure TLS settings for the exporter.
*/
tls?: HttpTls;
/**
* Configure headers. Entries have higher priority than entries from .headers_list.
* If an entry's .value is null, the entry is ignored.
*/
headers?: NameStringValuePair[];
/**
* Configure headers. Entries have lower priority than entries from .headers.
* The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS.
* If omitted or null, no headers are added.
*/
headers_list?: string;
/**
* Configure compression.
* Values include: gzip, none. Implementations may support other compression algorithms.
* If omitted or null, none is used.
*/
compression?: string;
/**
* Configure max time (in milliseconds) to wait for each export.
* Value must be non-negative. A value of 0 indicates no limit (infinity).
* If omitted or null, 10000 is used.
*/
timeout?: number;
/**
* Configure the encoding used for messages.
* Values include: protobuf, json. Implementations may not support json.
* If omitted or null, protobuf is used.
*/
encoding?: OtlpHttpEncoding;
/**
* Configure temporality preference.
* Values include: cumulative, delta, low_memory.
* If omitted or null, cumulative is used.
*/
temporality_preference?: ExporterTemporalityPreference;
/**
* Configure default histogram aggregation.
* Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram.
* If omitted or null, explicit_bucket_histogram is used.
*/
default_histogram_aggregation?: ExporterDefaultHistogramAggregation;
}
export interface OtlpGrpcMetricExporter {
/**
* Configure endpoint.
* If omitted or null, http://localhost:4317 is used.
*/
endpoint?: string;
/**
* Configure TLS settings for the exporter.
*/
tls?: GrpcTls;
/**
* Configure headers. Entries have higher priority than entries from .headers_list.
* If an entry's .value is null, the entry is ignored.
*/
headers?: NameStringValuePair[];
/**
* Configure headers. Entries have lower priority than entries from .headers.
* The value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS.
* If omitted or null, no headers are added.
*/
headers_list?: string;
/**
* Configure compression.
* Values include: gzip, none. Implementations may support other compression algorithms.
* If omitted or null, none is used.
*/
compression?: string;
/**
* Configure max time (in milliseconds) to wait for each export.
* Value must be non-negative. A value of 0 indicates no limit (infinity).
* If omitted or null, 10000 is used.
*/
timeout?: number;
/**
* Configure temporality preference.
* Values include: cumulative, delta, low_memory.
* If omitted or null, cumulative is used.
*/
temporality_preference?: ExporterTemporalityPreference;
/**
* Configure default histogram aggregation.
* Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram.
* If omitted or null, explicit_bucket_histogram is used.
*/
default_histogram_aggregation?: ExporterDefaultHistogramAggregation;
}
export interface ExperimentalOtlpFileMetricExporter {
/**
* Configure output stream.
* Values include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.
* If omitted or null, stdout is used.
*/
output_stream?: string;
/**
* Configure temporality preference.
* Values include: cumulative, delta, low_memory.
* If omitted or null, cumulative is used.
*/
temporality_preference?: ExporterTemporalityPreference;
/**
* Configure default histogram aggregation.
* Values include: explicit_bucket_histogram, base2_exponential_bucket_histogram.
* If omitted or null, explicit_bucket_histogram is used.
*/
default_histogram_aggregation?: ExporterDefaultHistogramAggregation;
}
export declare enum ExporterTemporalityPreference {
Cumulative = "cumulative",
Delta = "delta",
LowMemory = "low_memory"
}
export declare enum ExporterDefaultHistogramAggregation {
Base2ExponentialBucketHistogram = "base2_exponential_bucket_histogram",
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.
*/
selector?: ViewSelector;
/**
* Configure view stream.
*/
stream?: ViewStream;
}
export interface ViewSelector {
/**
* Configure instrument name selection criteria.
* If omitted or null, all instrument names match.
*/
instrument_name?: string;
/**
* 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?: InstrumentType;
/**
* Configure the instrument unit selection criteria.
* If omitted or null, all instrument units match.
*/
unit?: string;
/**
* Configure meter name selection criteria.
* If omitted or null, all meter names match.
*/
meter_name?: string;
/**
* Configure meter version selection criteria.
* If omitted or null, all meter versions match.
*/
meter_version?: string;
/**
* Configure meter schema url selection criteria.
* If omitted or null, all meter schema URLs match.
*/
meter_schema_url?: string;
}
export declare enum InstrumentType {
Counter = "counter",
Gauge = "gauge",
Histogram = "histogram",
ObservableCounter = "observable_counter",
ObservableGauge = "observable_gauge",
ObservableUpDownCounter = "observable_up_down_counter",
UpDownCounter = "up_down_counter"
}
export interface ViewStream {
/**
* Configure metric name of the resulting stream(s).
* If omitted or null, the instrument's original name is used.
*/
name?: string;
/**
* Configure metric description of the resulting stream(s).
* If omitted or null, the instrument's origin description is used.
*/
description?: string;
/**
* Configure aggregation of the resulting stream(s).
* Values include: default, drop, explicit_bucket_histogram, base2_exponential_bucket_histogram, last_value, sum.
* If omitted, default is used.
*/
aggregation?: Aggregation;
/**
* Configure the aggregation cardinality limit.
* If omitted or null, the metric reader's default cardinality limit is used.
*/
aggregation_cardinality_limit?: number;
/**
* Configure attribute keys retained in the resulting stream(s).
*/
attribute_keys?: IncludeExclude;
}
export interface Aggregation {
/**
* Configure aggregation to be default.
*/
default?: object;
/**
* Configure aggregation to be drop.
*/
drop?: object;
/**
* Configure aggregation to be explicit_bucket_histogram.
*/
explicit_bucket_histogram?: ExplicitBucketHistogramAggregation;
/**
* Configure aggregation to be base2_exponential_bucket_histogram.
*/
base2_exponential_bucket_histogram?: Base2ExponentialBucketHistogramAggregation;
/**
* Configure aggregation to be last_value.
*/
last_value?: object;
/**
* Configure aggregation to be sum.
*/
sum?: object;
}
export interface ExplicitBucketHistogramAggregation {
/**
* Configure bucket boundaries.
* If omitted, [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000] is used.
*/
boundaries?: number[];
/**
* Configure record min and max.
* If omitted or null, true is used.
*/
record_min_max?: boolean;
}
export interface Base2ExponentialBucketHistogramAggregation {
/**
* Configure max_scale.
*/
max_scale?: number;
/**
* Configure max_size.
*/
max_size?: number;
/**
* Configure record min and max.
* If omitted or null, true is used.
*/
record_min_max?: boolean;
}
//# sourceMappingURL=meterProviderModel.d.ts.map
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.InstrumentType = exports.ExporterDefaultHistogramAggregation = exports.ExporterTemporalityPreference = exports.ExperimentalPrometheusTranslationStrategy = exports.ExemplarFilter = exports.initializeDefaultMeterProviderConfiguration = void 0;
function initializeDefaultMeterProviderConfiguration() {
return {
readers: [],
views: [],
exemplar_filter: ExemplarFilter.TraceBased,
};
}
exports.initializeDefaultMeterProviderConfiguration = initializeDefaultMeterProviderConfiguration;
var ExemplarFilter;
(function (ExemplarFilter) {
ExemplarFilter["AlwaysOff"] = "always_off";
ExemplarFilter["AlwaysOn"] = "always_on";
ExemplarFilter["TraceBased"] = "trace_based";
})(ExemplarFilter = exports.ExemplarFilter || (exports.ExemplarFilter = {}));
var ExperimentalPrometheusTranslationStrategy;
(function (ExperimentalPrometheusTranslationStrategy) {
ExperimentalPrometheusTranslationStrategy["UnderscoreEscapingWithSuffixes"] = "underscore_escaping_with_suffixes";
ExperimentalPrometheusTranslationStrategy["UnderscoreEscapingWithoutSuffixes"] = "underscore_escaping_without_suffixes";
ExperimentalPrometheusTranslationStrategy["NoUtf8EscapingWithSuffixes"] = "no_utf8_escaping_with_suffixes";
ExperimentalPrometheusTranslationStrategy["NoTranslation"] = "no_translation";
})(ExperimentalPrometheusTranslationStrategy = exports.ExperimentalPrometheusTranslationStrategy || (exports.ExperimentalPrometheusTranslationStrategy = {}));
var ExporterTemporalityPreference;
(function (ExporterTemporalityPreference) {
ExporterTemporalityPreference["Cumulative"] = "cumulative";
ExporterTemporalityPreference["Delta"] = "delta";
ExporterTemporalityPreference["LowMemory"] = "low_memory";
})(ExporterTemporalityPreference = exports.ExporterTemporalityPreference || (exports.ExporterTemporalityPreference = {}));
var ExporterDefaultHistogramAggregation;
(function (ExporterDefaultHistogramAggregation) {
ExporterDefaultHistogramAggregation["Base2ExponentialBucketHistogram"] = "base2_exponential_bucket_histogram";
ExporterDefaultHistogramAggregation["ExplicitBucketHistogram"] = "explicit_bucket_histogram";
})(ExporterDefaultHistogramAggregation = exports.ExporterDefaultHistogramAggregation || (exports.ExporterDefaultHistogramAggregation = {}));
var InstrumentType;
(function (InstrumentType) {
InstrumentType["Counter"] = "counter";
InstrumentType["Gauge"] = "gauge";
InstrumentType["Histogram"] = "histogram";
InstrumentType["ObservableCounter"] = "observable_counter";
InstrumentType["ObservableGauge"] = "observable_gauge";
InstrumentType["ObservableUpDownCounter"] = "observable_up_down_counter";
InstrumentType["UpDownCounter"] = "up_down_counter";
})(InstrumentType = exports.InstrumentType || (exports.InstrumentType = {}));
//# sourceMappingURL=meterProviderModel.js.map
{"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 type {\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"]}
import type { IncludeExclude } from './commonModel';
export interface 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?: AttributeNameValue[];
/**
* 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.
* If omitted or null, no resource attributes are added.
*/
attributes_list?: string;
/**
* Configure resource schema URL.
* If omitted or null, no schema URL is used.
*/
schema_url?: string;
/**
* 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'?: ExperimentalResourceDetection;
}
export interface AttributeNameValue {
name: string;
value: string | boolean | number | string[] | boolean[] | number[] | undefined;
type?: 'string' | 'bool' | 'int' | 'double' | 'string_array' | 'bool_array' | 'int_array' | 'double_array';
}
export interface ExperimentalResourceDetection {
/**
* Configure attributes provided by resource detectors.
*/
attributes?: IncludeExclude;
/**
* 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?: ExperimentalResourceDetector[];
}
export interface ExperimentalResourceDetector {
/**
* Enable the container resource detector, which populates container.* attributes.
*/
container?: object;
/**
* Enable the environment variable resource detector (Node.js only, no spec equivalent).
* Reads OTEL_RESOURCE_ATTRIBUTES and OTEL_SERVICE_NAME environment variables.
*/
env?: object;
/**
* Enable the host resource detector, which populates host.* attributes.
*/
host?: object;
/**
* Enable the OS resource detector (Node.js only, no spec equivalent).
* Populates os.type and os.version attributes.
*/
os?: object;
/**
* Enable the process resource detector, which populates process.* attributes.
*/
process?: object;
/**
* Enable the service detector, which populates service.instance.id.
*/
service?: object;
}
//# sourceMappingURL=resourceModel.d.ts.map
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=resourceModel.js.map
{"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 type { 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 environment variable resource detector (Node.js only, no spec equivalent).\n * Reads OTEL_RESOURCE_ATTRIBUTES and OTEL_SERVICE_NAME environment variables.\n */\n env?: object;\n\n /**\n * Enable the host resource detector, which populates host.* attributes.\n */\n host?: object;\n\n /**\n * Enable the OS resource detector (Node.js only, no spec equivalent).\n * Populates os.type and os.version attributes.\n */\n os?: 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.instance.id.\n */\n service?: object;\n}\n"]}
import type { ExperimentalOtlpFileExporter, OtlpGrpcExporter, OtlpHttpExporter } from './commonModel';
export declare function initializeDefaultTracerProviderConfiguration(): Required<TracerProvider>;
export interface TracerProvider {
/**
* Configure span processors.
*/
processors: SpanProcessor[];
/**
* Configure span limits. See also attribute_limits.
*/
limits?: SpanLimits;
/**
* Configure the sampler.
* If omitted, parent based sampler with a root of always_on is used.
*/
sampler?: 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;
/**
* 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.
*/
max_queue_size?: number;
/**
* Configure maximum batch size. Value must be positive.
* If omitted or null, 512 is used.
*/
max_export_batch_size?: number;
/**
* Configure exporter.
*/
exporter: SpanExporter;
}
export interface Sampler {
/**
* Configure sampler to be parent_based.
*/
parent_based?: ParentBasedSampler;
/**
* Configure sampler to be always_off.
*/
always_off?: object;
/**
* Configure sampler to be always_on.
*/
always_on?: object;
/***
* Configure sampler to be trace_id_ratio_based.
*/
trace_id_ratio_based?: TraceIdRatioBasedSampler;
/**
* Configure sampler to be probability/development.
*/
'probability/development'?: ExperimentalProbabilitySampler;
/**
* Configure sampler to be composite/development.
*/
'composite/development'?: ExperimentalComposableSampler;
}
export interface ParentBasedSampler {
/**
* Configure root sampler.
* If omitted or null, always_on is used.
*/
root?: Sampler;
/**
* Configure remote_parent_sampled sampler.
* If omitted or null, always_on is used.
*/
remote_parent_sampled?: Sampler;
/**
* Configure remote_parent_not_sampled sampler.
* If omitted or null, always_off is used.
*/
remote_parent_not_sampled?: Sampler;
/**
* Configure local_parent_sampled sampler.
* If omitted or null, always_on is used.
*/
local_parent_sampled?: Sampler;
/**
* Configure local_parent_not_sampled sampler.
* If omitted or null, always_off is used.
*/
local_parent_not_sampled?: Sampler;
}
export interface TraceIdRatioBasedSampler {
/**
* Configure trace_id_ratio.
* If omitted or null, 1.0 is used.
*/
ratio?: number;
}
export interface ExperimentalProbabilitySampler {
/**
* Configure probability ratio.
* If omitted or null, 1.0 is used.
*/
ratio?: number;
}
export interface ExperimentalComposableSampler {
/**
* Configure composable sampler to be always_off.
*/
always_off?: object;
/**
* Configure composable sampler to be always_on.
*/
always_on?: object;
/**
* Configure composable sampler to be parent_threshold.
*/
parent_threshold?: ExperimentalComposableParentThresholdSampler;
/**
* Configure composable sampler to be probability.
*/
probability?: ExperimentalComposableProbabilitySampler;
/**
* Configure composable sampler to be rule_based.
*/
rule_based?: ExperimentalComposableRuleBasedSampler;
}
export interface ExperimentalComposableParentThresholdSampler {
/**
* Sampler to use when there is no parent.
*/
root: ExperimentalComposableSampler;
}
export interface ExperimentalComposableProbabilitySampler {
/**
* Configure probability ratio.
* If omitted or null, 1.0 is used.
*/
ratio?: number;
}
export interface ExperimentalComposableRuleBasedSampler {
/**
* The rules for the sampler, matched in order.
*/
rules?: ExperimentalComposableRuleBasedSamplerRule[];
}
export interface ExperimentalComposableRuleBasedSamplerRule {
/**
* Values to match against a single attribute.
*/
attribute_values?: {
key: string;
values: string[];
};
/**
* Patterns to match against a single attribute.
*/
attribute_patterns?: {
key: string;
included?: string[];
excluded?: string[];
};
/**
* The span kinds to match.
*/
span_kinds?: string[];
/**
* The parent span types to match.
*/
parent?: string[];
/**
* The sampler to use for matching spans.
*/
sampler: ExperimentalComposableSampler;
}
export interface SimpleSpanProcessor {
/**
* Configure exporter.
*/
exporter: SpanExporter;
}
export interface SpanExporter {
/**
* Configure exporter to be OTLP with HTTP transport.
*/
otlp_http?: OtlpHttpExporter;
/**
* Configure exporter to be OTLP with gRPC transport.
*/
otlp_grpc?: OtlpGrpcExporter;
/**
* Configure exporter to be OTLP with file transport.
* This type is in development and subject to breaking changes in minor versions.
*/
'otlp_file/development'?: ExperimentalOtlpFileExporter;
/**
* Configure exporter to be console.
*/
console?: object;
}
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;
/**
* 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?: number;
/**
* Configure max span event count.
* Value must be non-negative.
* If omitted or null, 128 is used.
*/
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 SpanProcessor {
/**
* Configure a batch span processor.
*/
batch?: BatchSpanProcessor;
/**
* Configure a simple span processor.
*/
simple?: SimpleSpanProcessor;
}
//# sourceMappingURL=tracerProviderModel.d.ts.map
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.initializeDefaultTracerProviderConfiguration = void 0;
function initializeDefaultTracerProviderConfiguration() {
return {
processors: [],
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 },
},
},
};
}
exports.initializeDefaultTracerProviderConfiguration = initializeDefaultTracerProviderConfiguration;
//# sourceMappingURL=tracerProviderModel.js.map
{"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 type {\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 /**\n * Configure sampler to be probability/development.\n */\n 'probability/development'?: ExperimentalProbabilitySampler;\n\n /**\n * Configure sampler to be composite/development.\n */\n 'composite/development'?: ExperimentalComposableSampler;\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 * If omitted or null, 1.0 is used.\n */\n ratio?: number;\n}\n\nexport interface ExperimentalProbabilitySampler {\n /**\n * Configure probability ratio.\n * If omitted or null, 1.0 is used.\n */\n ratio?: number;\n}\n\nexport interface ExperimentalComposableSampler {\n /**\n * Configure composable sampler to be always_off.\n */\n always_off?: object;\n\n /**\n * Configure composable sampler to be always_on.\n */\n always_on?: object;\n\n /**\n * Configure composable sampler to be parent_threshold.\n */\n parent_threshold?: ExperimentalComposableParentThresholdSampler;\n\n /**\n * Configure composable sampler to be probability.\n */\n probability?: ExperimentalComposableProbabilitySampler;\n\n /**\n * Configure composable sampler to be rule_based.\n */\n rule_based?: ExperimentalComposableRuleBasedSampler;\n}\n\nexport interface ExperimentalComposableParentThresholdSampler {\n /**\n * Sampler to use when there is no parent.\n */\n root: ExperimentalComposableSampler;\n}\n\nexport interface ExperimentalComposableProbabilitySampler {\n /**\n * Configure probability ratio.\n * If omitted or null, 1.0 is used.\n */\n ratio?: number;\n}\n\nexport interface ExperimentalComposableRuleBasedSampler {\n /**\n * The rules for the sampler, matched in order.\n */\n rules?: ExperimentalComposableRuleBasedSamplerRule[];\n}\n\nexport interface ExperimentalComposableRuleBasedSamplerRule {\n /**\n * Values to match against a single attribute.\n */\n attribute_values?: {\n key: string;\n values: string[];\n };\n /**\n * Patterns to match against a single attribute.\n */\n attribute_patterns?: {\n key: string;\n included?: string[];\n excluded?: string[];\n };\n /**\n * The span kinds to match.\n */\n span_kinds?: string[];\n /**\n * The parent span types to match.\n */\n parent?: string[];\n /**\n * The sampler to use for matching spans.\n */\n sampler: ExperimentalComposableSampler;\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"]}

Sorry, the diff of this file is too big to display