# `Excessibility.TelemetryCapture.Enricher`
[🔗](https://github.com/lessthanseventy/excessibility/blob/v0.18.1/lib/telemetry_capture/enricher.ex#L1)

Behaviour for timeline event enrichers.

Enrichers add computed data to timeline events during timeline building.
All enrichers run automatically for every event.

## Example

    defmodule MyApp.CustomEnricher do
      @behaviour Excessibility.TelemetryCapture.Enricher

      def name, do: :custom
      def cost, do: :cheap

      def enrich(assigns, _opts) do
        %{custom_field: compute_value(assigns)}
      end
    end

## Callbacks

- `name/0` - Returns atom identifier for this enricher
- `enrich/2` - Takes assigns and options, returns map of fields to add to timeline event
- `cost/0` - (optional) Returns `:cheap`, `:moderate`, or `:expensive` for filtering

# `cost`
*optional* 

```elixir
@callback cost() :: :cheap | :moderate | :expensive
```

# `enrich`

```elixir
@callback enrich(assigns :: map(), opts :: keyword()) :: map()
```

# `name`

```elixir
@callback name() :: atom()
```

# `get_cost`

Returns the cost of an enricher, defaulting to :cheap if not defined.

---

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