Module env_reader

Module env_reader 

Source
Expand description

Builds the typed configuration base by reading environment variables directly and decoding them into the nested configuration shape. Builds the typed configuration base from environment variables.

The Datadog Agent reads configuration by iterating its table of known keys and, for each, looking up that key’s exact environment variable names, never by scanning the environment or splitting on a separator. This module mirrors that: [DATADOG_ENV_KEYS] is generated from the vendored schema, and apply_datadog_env looks up each key’s real names, decodes the first non-empty value into the JSON shape the schema declares (see crate::env_decode), and writes it at the key’s nested path.

Each value is decoded and written directly to the nested path the typed deserializer reads. Precedence relative to the config file is controlled by the caller through overwrite.

Structs§

EnvKey
One modeled configuration key and how to read it from the environment.

Functions§

apply_datadog_env
Reads every modeled Datadog key from the environment and writes decoded values into base.
apply_env_at_path
Reads one key from the environment and writes it into root.
datadog_leaf_paths
The nested path of every modeled Datadog key.