# `Jidoka.Trace.Policy`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/trace/policy.ex#L1)

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.

# `t`

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

# `default_omit_keys`

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

Returns the default keys that are removed from trace data.

# `default_redact_keys`

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

Returns the default keys whose values are redacted.

# `from_input`

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

Normalizes optional trace policy input.

# `new`

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

Builds a trace policy from keyword or map attributes.

# `new!`

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

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

# `schema`

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

Returns the Zoi schema for a trace policy.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
