Skip to main content

Crate oxtel_config

Crate oxtel_config 

Source
Expand description

OpenTelemetry declarative configuration for oxtel: the YAML file OTEL_CONFIG_FILE names, read into a typed Config.

  • Environment variables are substituted in values (${NAME}, ${env:NAME}, ${NAME:-default}, $$ for a literal $). Unquoted values are then typed as YAML scalars, so ${OTEL_SDK_DISABLED:-false} is a boolean, while quoted values stay strings. A substituted value is never read as YAML structure.
  • file_format must be 1.x.
  • Values of the wrong type are errors, naming the field’s path.
  • Keys and components oxtel doesn’t support, such as views or the gRPC exporter, are reported in Parsed::warnings and otherwise ignored.

The oxtel crate builds its pipelines from the result when OTEL_CONFIG_FILE is set.

let parsed = oxtel_config::parse_with(
    "file_format: \"1.2\"\ndisabled: ${DISABLED:-false}\n",
    &|_| None,
)
.unwrap();
assert!(!parsed.config.disabled);

Structs§

Config
A whole configuration file.
Limits
Attribute, event and link limits.
LoggerProviderConfig
logger_provider.
MeterProviderConfig
meter_provider.
OtlpHttpConfig
otlp_http.
Parsed
A configuration and what in it was ignored.
ResourceConfig
resource.
TracerProviderConfig
tracer_provider.

Enums§

AttributeValue
An attribute’s value.
Error
Why a configuration couldn’t be read.
ExporterConfig
An exporter.
ProcessorConfig
A span or log record processor.
ReaderConfig
A metric reader.
SamplerConfig
A sampler.

Functions§

from_file
Read the configuration file at path.
parse
Read the configuration in text, substituting the process’s environment variables.
parse_with
Read the configuration in text, substituting variables from lookup.