MetrixWire.Transport (MetrixWire v0.2.4)

Copy Markdown View Source

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).

Every network path is wrapped so a dead or slow MetrixWire API can never crash or block the host app: short timeout, all errors swallowed, sends happen off the request path (in the GenServer, and the HTTP call itself in a detached Task). A final synchronous flush runs on terminate.

Summary

Functions

Returns a specification to start this module under a supervisor.

Enqueue a finished trace. Non-blocking (async cast).

Force a synchronous flush of everything currently buffered.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

enqueue(trace)

Enqueue a finished trace. Non-blocking (async cast).

flush()

Force a synchronous flush of everything currently buffered.

start_link(opts \\ [])