# MetrixWire v0.2.4 - Table of Contents

> Zero-config APM SDK for Elixir — Phoenix, Plug, Ecto. Add the dep and set METRIXWIRE_KEY; every request/query/HTTP call is traced automatically.

## Pages

- [metrixwire](readme.md)

## Modules

- [MetrixWire](MetrixWire.md): Zero-config APM SDK for Elixir.
- [MetrixWire.Application](MetrixWire.Application.md): The SDK's OTP application. Declared as `mod:` in `mix.exs`, so it starts
automatically the moment `:metrixwire` is a dependency of the host app.
- [MetrixWire.Config](MetrixWire.Config.md): Resolved configuration. Built once at application boot from `config :metrixwire,
...` merged with ENV fallbacks (`METRIXWIRE_KEY`, `METRIXWIRE_ENDPOINT`,
`METRIXWIRE_ENABLED`). Nothing here throws — bad input degrades to a sensible
default so instrumentation never breaks the host app.
- [MetrixWire.Context](MetrixWire.Context.md): Process-dictionary holder for the "current trace".
- [MetrixWire.Instrument.SourceLocation](MetrixWire.Instrument.SourceLocation.md): Best-effort `file:line` of the application frame that issued a span, so the
dashboard can point at the line that ran a query / HTTP call.
- [MetrixWire.JSON](MetrixWire.JSON.md): Minimal, dependency-free JSON encoder — a fallback used only when neither the
built-in `JSON` module (OTP 27+/Elixir 1.18+) nor `Jason` is available.
- [MetrixWire.Plug](MetrixWire.Plug.md): Drop-in Plug for **bare Plug** apps (no Phoenix). Add one line to your pipeline
- [MetrixWire.Span](MetrixWire.Span.md): A single unit of work within a trace (`db_query` | `http_call` | `custom`).
Users never build these — instrumentation creates them. Serialized to the exact
ingest wire shape.

- [MetrixWire.Telemetry](MetrixWire.Telemetry.md): 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.
- [MetrixWire.Trace](MetrixWire.Trace.md): One request / unit of work. Holds its spans and trace-level meta. Serialized to
the exact ingest wire shape. Not part of any public API — instrumentation opens a
trace on request start, accumulates spans, and closes it on request stop.
- [MetrixWire.Transport](MetrixWire.Transport.md): Batches finished traces in a GenServer and flushes them to the ingest endpoint on
a timer + once a max-batch threshold is reached. Delivery uses the built-in
`:httpc` / `:inets` (no external HTTP client dependency).

