ScoutApm.Error.ErrorService (scout_apm v2.0.0)
Copy MarkdownBackground GenServer that batches and sends errors to Scout APM's error endpoint.
Implements a queue with batching (default 5 errors per batch) and a maximum queue size (default 500) to prevent memory issues.
Summary
Functions
Returns a specification to start this module under a supervisor.
Waits for the queue to drain. Used in tests and shutdown.
Forces an immediate flush of queued errors. Used in tests.
Sends an error to the service for batched delivery. Non-blocking - returns immediately.
Types
@type t() :: %ScoutApm.Error.ErrorService{ queue: :queue.queue(ScoutApm.Error.ErrorData.t()), queue_size: non_neg_integer(), timer_ref: reference() | nil }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec drain(timeout :: non_neg_integer()) :: :ok | :timeout
Waits for the queue to drain. Used in tests and shutdown.
@spec flush() :: :ok
Forces an immediate flush of queued errors. Used in tests.
@spec send(ScoutApm.Error.ErrorData.t()) :: :ok
Sends an error to the service for batched delivery. Non-blocking - returns immediately.