A
APM & Infrastructure

APM Agent

`FunnelAgent` attaches `:telemetry` handlers for Phoenix, Ecto, Oban, Bandit — zero-code.

How it works

On boot the agent attaches to the standard `:telemetry` events that Elixir libraries already emit. Each event becomes a span (with parent-child stitching via process dictionary) and / or a metric. Outbound `Finch.Request`s are wrapped with `traceparent` headers so downstream services join the same trace. Works the same way as Datadog or Honeycomb's auto-instrumentation, but with no native deps.

What this lets you do

  • Phoenix request latency, status codes, and route names — for free
  • Ecto query times, row counts, slow-query flagging — for free
  • Oban job durations and failure rates with the queue + worker tagged
  • Distributed traces across services with W3C trace-context propagation

Get it running

  1. 1 Add `{:funnel_agent, "~> 0.1"}` to mix.exs deps
  2. 2 Call `FunnelAgent.start/1` in your application supervisor
  3. 3 Done — every Phoenix request now produces a root span

Code examples

# mix.exs
defp deps, do: [
  {:funnel_agent, "~> 0.1"}
]

# lib/my_app/application.ex
def start(_type, _args) do
  FunnelAgent.start(
    endpoint:     "https://funnel.example.com/v1",
    api_key:      System.fetch_env!("FUNNEL_KEY"),
    service_name: "my-app",
    sample_rate:  1.0
  )

  Supervisor.start_link([...], strategy: :one_for_one, name: MyApp.Sup)
end
Where to find it
/app/p/:org/:project/service_map
Open in app →