NAME
OpenTelemetry::SDK::Trace::Span::Processor::Batch - A batched OpenTelemetry span processor
SYNOPSIS
...
DESCRIPTION
This is a batched span processor that receives read-only OpenTelemetry::Trace::Span instances and forwards them to an exporter as readable instances of OpenTelemetry::SDK::Trace::Span::Readable.
This processor is intended to be used in production environments where performance is important. It will maintain a queue of spans to export, and periodically exports these in batches in a parallel process, which should allow the main process to continue executing without any delay added by exporting the spans.
METHODS
This class inherits from OpenTelemetry::Processor::Batch and implements the OpenTelemetry::Trace::Span::Processor role. Please consult the documentation of those modules for details on the behaviours they provide. The description below will only refer to those behaviours that differ.
on_start
$processor->on_start( $span, $parent_context );
Called when a span is started. In this class, this method does nothing.
on_end
$processor->on_end( $span );
Called when a span is ended, with the span that has just ended as its only parameter. This should be called after the span has been ended.
This method internally passes the span to "process" in OpenTelemetry::Processor::Batch.
METRICS
This processor generates a number of metrics to keep track of its regular operation. At the time of writing, these metrics are non-standard, but their inclusion in the standard is being discussed.
otel.processor.batch.failure-
Incremented every time the span processing failed irrecoverably.
otel.processor.batch.success-
Incremented every time the span processing completed successfully.
otel.processor.batch.spans.dropped-
The number of spans that have been dropped and not successfully exported. This could be because they were never set to the exporter, or because the exporter reported some error.
Reported with the following attributes:
reason-
buffer-full-
The internal queue is full and can receive no more spans.
export-failure-
The exporter reported an error while exporting the spans.
force-flush-
The internal queue was flushed and not all queued spans could be exported in the specified time.
terminating-
The processor was shutdown and some spans remained in its internal queue.
otel.processor.batch.spans.processed-
The number of spans successfully processed.
SEE ALSO
- Future
- OpenTelemetry::Exporter
- OpenTelemetry::SDK::Trace::Span::Readable
- OpenTelemetry::Trace::Span
- OpenTelemetry::Processor::Batch
COPYRIGHT AND LICENSE
This software is copyright (c) 2023 by José Joaquín Atria.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.