Tinkex.API.Telemetry (Tinkex v0.3.4)

View Source

Telemetry reporting endpoints.

Uses :telemetry pool to prevent telemetry from starving critical operations. Pool size: 5 connections.

Task Supervision

Tasks spawned by send/2 are not supervised. Failures are logged and ignored. This is intentional - telemetry should never block or fail critical operations.

Summary

Functions

Send telemetry asynchronously (fire and forget).

Send telemetry synchronously (for testing or flush operations).

Functions

send(request, opts)

@spec send(
  map(),
  keyword()
) :: :ok

Send telemetry asynchronously (fire and forget).

Spawns a Task to send telemetry without blocking the caller. Returns :ok immediately; failures are logged but not propagated.

Options:

  • :config - Tinkex.Config.t() (required)
  • :timeout - HTTP timeout in milliseconds (default: 5000)

send_sync(request, opts)

@spec send_sync(
  map(),
  keyword()
) :: {:ok, map()} | {:error, Tinkex.Error.t()}

Send telemetry synchronously (for testing or flush operations).

Blocks until the telemetry request completes. Use this in tests to verify telemetry behavior or during graceful shutdown.

Options:

  • :config - Tinkex.Config.t() (required)
  • :timeout - HTTP timeout in milliseconds (default: 5000)