# `Insider.Collector.Telemetry.Policy`
[🔗](https://github.com/hiivemarkets/insider/blob/v0.1.0/lib/insider/collector/telemetry/policy.ex#L1)

Validated pure-data allowlist for Telemetry collection.

Source keys are existing atoms supplied by application configuration. Output
names are bounded strings, so handling an event never creates atoms.

# `event_rule`

```elixir
@type event_rule() :: %{
  name: [atom()],
  kind: String.t(),
  phase: atom(),
  lifecycle: String.t(),
  failure_event: boolean()
}
```

# `t`

```elixir
@type t() :: %Insider.Collector.Telemetry.Policy{
  correlation: %{optional(atom()) =&gt; atom()},
  event_names: [[atom()]],
  events: %{required(tuple()) =&gt; event_rule()},
  fingerprint: String.t(),
  id: String.t(),
  max_lifecycle_age_events: pos_integer(),
  max_open_lifecycles: pos_integer(),
  measurements: %{optional(atom()) =&gt; String.t()},
  metadata: %{optional(atom()) =&gt; String.t()}
}
```

# `new`

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

# `valid?`

```elixir
@spec valid?(term()) :: boolean()
```

---

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