Underlying implementation for making calls to the Segment HTTP API, built on Req.
Configuration
config :segmentry,
send_to_http: true,
retry_attempts: 3,
retry_expiry: 10_000,
retry_start: 100:retry_attempts— number of times to retry against the Segment API. Default3.:retry_expiry— maximum delay (ms) between retries. Default10_000.:retry_start— base delay (ms) for the first retry. Default100.:send_to_http— iffalse, swaps in a no-op adapter that logs at:debugand replies200. Defaulttrue.:req_options— keyword list merged into everyReqclient. Useful for:plug(seeReq.Test) or to override:receive_timeout.
Summary
Types
@type client() :: Req.Request.t()
Functions
@spec batch(client(), [Segmentry.segment_event()], map() | nil, map() | nil) :: :ok | :error
Send a list of Segment events as a batch.
Optional context and integrations maps are applied to the entire batch — see
Segment's docs.
Build a Req client for the given Segment write key.
Build a Req client and merge in the supplied Req options (used to inject test stubs).
@spec send(client(), [Segmentry.segment_event()]) :: :ok | :error
@spec send(client(), Segmentry.segment_event()) :: :ok | :error
Send a single Segment event (or a list of events as a batch).