pub enum EnvDecode {
Show 18 variants
Json,
CommaSeparated,
CommaAndSpaceSeparated,
CommaThenSpaceSeparated,
CsvCommaSeparated,
JsonListOrCommaSeparated,
JsonListOrSpaceSeparated,
TracesSpan,
RawString,
Bool,
Integer,
Float,
StringList,
DurationString,
JsonValue,
DecimalInteger,
DecimalFloat,
WhitespaceList,
}Expand description
How to decode a raw environment string into a JSON value for one leaf.
The named-parser variants mirror the schema’s env_parser, and the type fallbacks are the casts
the Agent applies when no env_parser is declared, keyed by the leaf’s declared type. The
remaining variants are for Saluki-only keys, which have no Agent cast to match; the Datadog table
never uses them.
Variants§
Json
env_parser: json: parse the string as a JSON document.
CommaSeparated
env_parser: comma_separated: split on ,, no trimming.
CommaAndSpaceSeparated
env_parser: comma_and_space_separated: split on , or space, dropping empties.
CommaThenSpaceSeparated
env_parser: comma_then_space_separated: split on , if present else space, trimmed.
CsvCommaSeparated
env_parser: csv_comma_separated: the first CSV record, with leading spaces trimmed and lazy quotes.
JsonListOrCommaSeparated
env_parser: json_list_or_comma_separated: a [...] JSON list, else split on ,.
JsonListOrSpaceSeparated
env_parser: json_list_or_space_separated: a [...] JSON list, else split on space.
TracesSpan
env_parser: traces_span: svc|op=rate,... into a {name: rate} object.
RawString
Type fallback: a plain string, taken verbatim.
Bool
Type fallback: a boolean, parsed with Go’s strconv.ParseBool grammar.
Integer
Type fallback: a signed integer, in Go’s strconv.ParseInt base-0 grammar (the Agent’s int
cast): optional sign, 0x/0o/0b prefixes, a leading 0 as octal, and _ separators.
Float
Type fallback: a finite floating-point number, in Go’s strconv.ParseFloat grammar.
StringList
Type fallback: a string list (the Agent’s []string cast). A JSON array of strings or null
is decoded as JSON; anything else is split on whitespace.
DurationString
Type fallback: a duration, carried through as a string for crate::duration_de.
JsonValue
Type fallback: a map/object (or any non-scalar), parsed as a JSON document.
DecimalInteger
Saluki-only: a signed decimal integer, optionally followed by an all-zero fraction. A leading
0 is decimal.
DecimalFloat
Saluki-only: a decimal floating-point number, with no _ separators or hexadecimal form.
WhitespaceList
Saluki-only: a string list split on whitespace, with no JSON form.