Spandex v1.6.0 Spandex.Datadog.ApiServer View Source

Implements worker for sending spans to datadog as GenServer in order to send traces async.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Builds server state

Send spans asynchronously to DataDog

Starts genserver with given options

Link to this section Types

Link to this type t() View Source
t() :: %Spandex.Datadog.ApiServer{agent_pid: term, asynchronous_send?: term, batch_size: term, host: term, http: term, port: term, sync_threshold: term, url: term, verbose?: term, waiting_traces: term}

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function init(opts) View Source
init(opts :: Keyword.t) :: {:ok, t}

Builds server state.

Link to this function send_and_log(traces, state) View Source
send_and_log(traces :: [[map]], any) :: :ok
Link to this function send_spans(spans, opts \\ []) View Source
send_spans(spans :: [map], Keyword.t) :: :ok

Send spans asynchronously to DataDog.

Starts genserver with given options.


Opts

  • http(:atom) Required: The HTTP module to use for sending spans to the agent. Currently only HTTPoison has been tested
  • host(:string): The host the agent can be reached at - Default: “localhost”
  • port([:integer, :string]): The port to use when sending traces to the agent - Default: 8126
  • verbose?(:boolean): Only to be used for debugging: All finished traces will be logged - Default: false
  • batch_size(:integer): The number of traces that should be sent in a single batch - Default: 10
  • sync_threshold(:integer): The maximum number of processes that may be sending traces at any one time. This adds backpressure - Default: 20
  • api_adapter(:atom): Which api adapter to use. Currently only used for testing - Default: Spandex.Datadog.ApiServer