Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module provides a trace reporter that groups recorded spans into batches before sending them to their destination in bulk.
Synopsis
- data BatchOptions
- batchOptions :: ([FinishedSpan] -> IO ()) -> BatchOptions
- boptAtCapacity :: Lens' BatchOptions AtCapacity
- boptBatchSize :: Lens' BatchOptions Word16
- boptErrorLog :: Lens' BatchOptions (Builder -> IO ())
- boptQueueSize :: Lens' BatchOptions Natural
- boptReporter :: Lens' BatchOptions ([FinishedSpan] -> IO ())
- boptTimeoutSec :: Lens' BatchOptions Word
- data AtCapacity
- defaultErrorLog :: Builder -> IO ()
- data BatchEnv
- newBatchEnv :: BatchOptions -> IO BatchEnv
- closeBatchEnv :: BatchEnv -> IO ()
- batchReporter :: MonadIO m => BatchEnv -> FinishedSpan -> m ()
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.
boptErrorLog :: Lens' BatchOptions (Builder -> IO ()) Source #
boptReporter :: Lens' BatchOptions ([FinishedSpan] -> IO ()) Source #
data AtCapacity Source #
Policy to apply to new spans when the internal queue is at capacity.
defaultErrorLog :: Builder -> IO () Source #
An error logging function which prints to stderr.
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.