Internal module. Not part of TraceGuard's public API: it may change in
any release. Use the functions in TraceGuard instead.
Validated TraceGuard configuration.
Configuration is read from the :trace_guard application environment when
the application starts, validated, and cached in :persistent_term so the
request hot path never re-validates it.
config :trace_guard,
failure_status: 500,
max_events: 100,
max_reports: 50,
redact_keys: ["card_number"],
capture_request_headers: ["accept", "content-type"],
ecto_telemetry_prefixes: [[:my_app, :repo]]See docs/configuration.md for the full reference.
Summary
Functions
Sensitive keys that are always redacted, in normalized form.
Default option values.
Returns the active configuration.
Loads, validates and caches configuration from the application environment.
Validates opts, merges them over the defaults and caches the result.
Validates opts without caching them.
Types
@type t() :: %TraceGuard.Config{ capture_exception_message: boolean(), capture_path: boolean(), capture_path_params: boolean(), capture_request_headers: [String.t()], capture_sql: boolean(), drop_record_ttl: pos_integer(), ecto_telemetry_prefixes: [[atom()]], enabled: boolean(), failure_status: 100..599, incoming_header: String.t() | nil, max_drop_records: pos_integer(), max_events: pos_integer(), max_pending_reports: pos_integer(), max_reports: pos_integer(), max_stacktrace_frames: non_neg_integer(), max_string_length: pos_integer(), max_task_collectors: pos_integer(), redact_keys: [String.t()], response_header: String.t() | nil, storage: module() | {module(), keyword()}, task_collector_lifetime: pos_integer(), task_drain_timeout: non_neg_integer() }
Functions
@spec default_redact_keys() :: [String.t()]
Sensitive keys that are always redacted, in normalized form.
@spec defaults() :: keyword()
Default option values.
@spec get() :: t()
Returns the active configuration.
Falls back to loading from the application environment if nothing has been cached yet (for example when TraceGuard functions are called before the application has started).
@spec load!() :: t()
Loads, validates and caches configuration from the application environment.
Validates opts, merges them over the defaults and caches the result.
Raises ArgumentError on invalid configuration. Intended for application
start-up and tests; changing configuration at runtime rewrites a
:persistent_term, which triggers a global GC and should be rare.
Validates opts without caching them.