Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KeyAliases = map[string][]string{
"DD_API_KEY": {"DD-API-KEY"},
"DD_APPSEC_STACK_TRACE_ENABLED": {"DD_APPSEC_STACK_TRACE_ENABLE"},
}
KeyAliases maps canonical configuration keys to their known aliases.
var SensitiveConfigurations = map[string]struct{}{
"OTEL_EXPORTER_OTLP_HEADERS": {},
"OTEL_EXPORTER_OTLP_LOGS_HEADERS": {},
"OTEL_EXPORTER_OTLP_METRICS_HEADERS": {},
"OTEL_EXPORTER_OTLP_TRACES_HEADERS": {},
}
SensitiveConfigurations is the set of configuration keys whose value must not be reported in configuration telemetry. It is seeded from entries marked "sensitive": true in supported_configurations.json.
var SupportedConfigurations = map[string]struct{}{}/* 275 elements not displayed */
SupportedConfigurations is a map of supported configuration keys.
Functions ¶
func Get ¶
Get is a wrapper around env.Get that validates the environment variable against a list of supported environment variables.
If the environment variable has aliases, the function will also check the aliases and return the value of the first alias that is set.
When a environment variable is not supported because it is not listed in the list of supported environment variables, the function will log an error and behave as if the environment variable was not set.
In testing mode, the reader will automatically add the environment variable to the configuration file.
func IsSensitive ¶
IsSensitive reports whether the given configuration name must not have its value reported in configuration telemetry. A name is sensitive if it is listed in the generated SensitiveConfigurations set, or if it is an alias of such a key.
func Lookup ¶
Lookup is a wrapper around os.LookupEnv that validates the environment variable against a list of supported environment variables.
If the environment variable has aliases, the function will also check the aliases. and return the value of the first alias that is set.
When a environment variable is not supported because it is not listed in the list of supported environment variables, the function will log an error and behave as if the environment variable was not set.
In testing mode, the reader will automatically add the environment variable to the configuration file.
Types ¶
This section is empty.