# `Honeybadger.Insights.Plug`
[🔗](https://github.com/honeybadger-io/honeybadger-elixir/blob/v0.30.2/lib/honeybadger/insights/plug.ex#L1)

Captures telemetry events from HTTP requests processed by Plug and Phoenix.

## Default Configuration

By default, this module listens for the standard Phoenix endpoint telemetry event:

    "phoenix.endpoint.stop"

This is compatible with the default Phoenix configuration that adds telemetry
via `Plug.Telemetry`:

    plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint]

## Custom Configuration

You can customize the telemetry events to listen for by updating the insights_config:

    config :honeybadger, insights_config: %{
      plug: %{
        telemetry_events: [[:my, :prefix, :stop]]
      }
    }

# `attach`

Attaches telemetry handlers if all required dependencies are available.

# `attach_event`

Attaches a telemetry handler for a specific event.

# `dependencies_available?`

# `event_filter`

# `extract_metadata`

Extracts metadata from the telemetry event.
Child modules should override this for specific events.

# `get_insights_config`

# `get_telemetry_events`

# `handle_event_impl`

Implementation of handle_telemetry that can be called by overriding methods.

# `handle_telemetry`

Handles telemetry events and processes the data.
This implementation forwards to handle_event_impl which can be overridden
by child modules to customize behavior while still calling the parent implementation.

# `ignore?`

Determines if an event should be ignored based on its metadata.
Child modules should override this for specific filtering logic.
Note: this is the metadata before any transformations.

# `process_event`

Process the event data. Child modules can override this for custom
processing.

---

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