MetrixWire.Telemetry (MetrixWire v0.2.2)

Copy Markdown View Source

The single set of :telemetry handlers that instruments the whole Elixir ecosystem. Attached once at boot by MetrixWire.Application via :telemetry.attach_many/4, so no framework code changes are needed.

Covers:

  • Phoenix request lifecycle → open/close a trace (route, method, status).
  • Ecto [_, :repo, :query]db_query spans (SQL, duration, rowCount).
  • Finch / Teslahttp_call spans (statusCode).

Ecto/Finch telemetry runs in the CALLER process, so the process-dictionary Context correlation attaches those spans to the active request trace. Every handler is wrapped so a bad event can never crash the emitting process.

Summary

Functions

Attach every handler. Idempotent — detaches any prior attachment first. Ecto query events are attached separately (per-repo prefix) via attach_ecto/0.

Attach a db_query handler to every configured Ecto repo's query event.

Functions

attach()

Attach every handler. Idempotent — detaches any prior attachment first. Ecto query events are attached separately (per-repo prefix) via attach_ecto/0.

attach_ecto()

Attach a db_query handler to every configured Ecto repo's query event.

detach()