Tapper v0.6.0 Tapper.Reporter.AsyncReporter View Source

Reporter that collects spans and forwards them periodically to another reporter.

Sending every sampled trace separately can create a lot of traffic between the application and the Zipkin server when the server is handling a lot of client traffic. Instead this reporter collects the spans and sends them in batches.

Configuration

keypurposedefault/required
senderReporter to use when reporting a batch; see Tapper.Application for possible reporter formsRequired
flush_intervalMilliseconds to wait between reporting a new batch of spans10000
max_spans_thresholdReaching this number of spans will reset the flush_interval timer and will flush the spans1000
max_concurrent_flush_countNumber of flushes that can work concurrently before we start discarding new spans5

e.g.

config :tapper,
  system_id: "my-application",
  reporter: {Tapper.Reporter.AsyncReporter, []} # start under Tapper supervisor

config :tapper, Tapper.Reporter.AsyncReporter,
  flush_interval: 10000,
  max_spans_threshold: 1000,
  max_concurrent_flush_count: 5,
  sender: Tapper.Reporter.Zipkin

# configuration for sender module
config :tapper, Tapper.Reporter.Zipkin,
  collector_url: "https://my-zipkin.domain.com:9411/api/v1/spans",
  client_opts: [timeout: 10000]

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Flushes collected spans to reporter immediately

Starts this module under a supervisor

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Flushes collected spans to reporter immediately.

Starts this module under a supervisor.

Normally this is called by the Tapper application when this module is configured as the reporter, using the {Tapper.Reporter.AsyncReporter, []} syntax.