opentracing-0.3.0: OpenTracing for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

OpenTracing.Reporting.Batch

Description

This module provides a trace reporter that groups recorded spans into batches before sending them to their destination in bulk.

Synopsis

Documentation

data BatchOptions Source #

Options available to construct a batch reporter. Default options are available with batchOptions

batchOptions :: ([FinishedSpan] -> IO ()) -> BatchOptions Source #

Default batch options which can be overridden via lenses.

data AtCapacity Source #

Policy to apply to new spans when the internal queue is at capacity.

Constructors

Drop 
Block 

defaultErrorLog :: Builder -> IO () Source #

An error logging function which prints to stderr.

data BatchEnv Source #

The environment of a batch reporter.

newBatchEnv :: BatchOptions -> IO BatchEnv Source #

Create a new batch environment

closeBatchEnv :: BatchEnv -> IO () Source #

Close a batch reporter, stop consuming any new spans. Any spans in the queue will be drained.

batchReporter :: MonadIO m => BatchEnv -> FinishedSpan -> m () Source #

An implementation of tracerReport that batches the finished spans for transimission to their destination.

If the underlying queue is currently at capacity, the behaviour depends on the setting of boptAtCapacity: if the value is Drop, fspan is dropped, otherwise, if the value is Block, the reporter will block until the queue has enough space to accept the span.

In either case, a log record is emitted.