# `Monitorex.ConsumerIdentifier`

Extracts a consumer label from an inbound `Plug.Conn` for per-consumer dashboard breakdowns.

## Priority order

1. **Custom function** — `consumer_fn` in Application config (arity 1, receives `conn`)
2. **Basic-auth username** — decoded from `authorization` header, password discarded
3. **API key header** — value of `x-api-key` truncated to 8 characters
4. **`nil`** — unknown / anonymous consumer

# `identify`

```elixir
@spec identify(conn :: Plug.Conn.t()) :: String.t() | nil
```

Identifies the consumer from a `Plug.Conn`.

Returns `nil` when no consumer can be determined.

---

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