Jidoka.Trace.Policy (Jidoka v0.9.0)

Copy Markdown View Source

Trace projection policy.

Policies are data. They decide whether trace entries are emitted, how much to sample, and which keys should be omitted or redacted before a trace sink sees the event data.

Summary

Functions

Returns the default keys that are removed from trace data.

Returns the default keys whose values are redacted.

Normalizes optional trace policy input.

Builds a trace policy from keyword or map attributes.

Builds a trace policy and raises if the attributes are invalid.

Returns the Zoi schema for a trace policy.

Types

t()

@type t() :: %Jidoka.Trace.Policy{
  enabled: boolean(),
  metadata: map(),
  omit_keys: [binary()],
  redact_keys: [binary()],
  sample_rate: number()
}

Functions

default_omit_keys()

@spec default_omit_keys() :: [String.t()]

Returns the default keys that are removed from trace data.

default_redact_keys()

@spec default_redact_keys() :: [String.t()]

Returns the default keys whose values are redacted.

from_input(policy)

@spec from_input(t() | keyword() | map() | nil) :: {:ok, t()} | {:error, term()}

Normalizes optional trace policy input.

new(attrs \\ [])

@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}

Builds a trace policy from keyword or map attributes.

new!(attrs \\ [])

@spec new!(keyword() | map()) :: t()

Builds a trace policy and raises if the attributes are invalid.

schema()

@spec schema() :: Zoi.schema()

Returns the Zoi schema for a trace policy.