# `ExWapp.Telemetry`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/telemetry.ex#L1)

Optional instrumentation and canonical event list for ExWapp.

Session events use the `[:ex_wapp, :session, ...]` prefix. Store, app-state,
safety, quota, and client events use their corresponding ExWapp domain prefix.

Events are ignored unless the host application configures an adapter:

    config :ex_wapp, :telemetry_adapter, :telemetry

Add `:telemetry` to your application's dependencies to use that backend, or
configure a module implementing `ExWapp.Telemetry.Adapter`. Emission is best
effort: an unavailable or failing adapter never interrupts protocol work.
Adapter callbacks execute in the caller's process and should return promptly.

# `event_name`

```elixir
@type event_name() :: [atom()]
```

# `handler`

```elixir
@type handler() :: (event_name(), map(), map(), term() -&gt; term())
```

# `attach_many`

```elixir
@spec attach_many(handler_id :: term(), handler :: handler(), config :: term()) ::
  :ok | {:error, term()}
```

Attaches one handler to all canonical ExWapp events using the adapter.

Returns `{:error, :telemetry_not_configured}` when disabled or
`{:error, {:unsupported_telemetry_callback, :attach_many}}` for an adapter
that only supports emission.

# `detach`

```elixir
@spec detach(term()) :: :ok | {:error, term()}
```

Detaches a handler using the configured adapter.

Returns an error if instrumentation or adapter handler management is unavailable.

# `events`

```elixir
@spec events() :: [event_name()]
```

Returns all canonical ExWapp telemetry events.

# `execute`

```elixir
@spec execute(atom() | [atom()], map(), map()) :: :ok
```

Emits an event through the configured adapter, or does nothing if disabled.

Atoms expand to the session prefix; lists are passed through unchanged.
Adapter errors are ignored so instrumentation cannot fail an operation.

---

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