SpandexDatadog.ApiServer (spandex_datadog v1.4.0)
Implements worker for sending spans to datadog as GenServer in order to send traces async.
Summary
Functions
Returns a specification to start this module under a supervisor.
Send spans asynchronously to DataDog.
Starts the ApiServer with given options.
Types
Functions
Link to this function
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
Link to this function
format(span, priority, baggage)
@spec format(Spandex.Span.t(), integer(), Keyword.t()) :: map()
Link to this function
send_and_log(traces, state)
@spec send_and_log([Spandex.Trace.t()], SpandexDatadog.ApiServer.State.t()) :: :ok
Link to this function
send_trace(trace, opts \\ [])
@spec send_trace(Spandex.Trace.t(), Keyword.t()) :: :ok
Send spans asynchronously to DataDog.
Link to this function
start_link(opts \\ [])
@spec start_link(opts :: Keyword.t()) :: GenServer.on_start()
Starts the ApiServer with given options.
Options
:http
- The HTTP module to use for sending spans to the agent. Defaults toHTTPoison
.:host
- The host the agent can be reached at. Defaults to"localhost"
.:port
- The port to use when sending traces to the agent. Defaults to8126
.:verbose?
- Only to be used for debugging: All finished traces will be logged. Defaults tofalse
:batch_size
- The number of traces that should be sent in a single batch. Defaults to10
.:sync_threshold
- The maximum number of processes that may be sending traces at any one time. This adds backpressure. Defaults to20
.:name
- The name the GenServer should have. Currently only used for testing. Defaults toSpandexDatadog.ApiServer
:trap_exits?
- Whether or not to trap exits and attempt to flush traces on shutdown, defaults tofalse
. Useful if you do frequent deploys and you don't want to lose traces each deploy.