Class BufferingSpanReporter

  • All Implemented Interfaces:
    org.springframework.cloud.sleuth.exporter.SpanReporter

    public class BufferingSpanReporter
    extends Object
    implements org.springframework.cloud.sleuth.exporter.SpanReporter
    A SpanReporter that buffers finished spans.
    Since:
    3.1.0
    Author:
    Marcin Grzejszczak
    • Constructor Detail

      • BufferingSpanReporter

        public BufferingSpanReporter​(int capacity)
    • Method Detail

      • getFinishedSpans

        public List<org.springframework.cloud.sleuth.exporter.FinishedSpan> getFinishedSpans()
        Return a snapshot of currently buffered spans.

        This will not remove spans from the buffer, see drainFinishedSpans() ()} for its counterpart.

        Returns:
        a snapshot of currently buffered spans.
      • drainFinishedSpans

        public List<org.springframework.cloud.sleuth.exporter.FinishedSpan> drainFinishedSpans()
        Return the timeline by pulling spans from the buffer.

        This removes steps from the buffer, see getFinishedSpans() for its read-only counterpart.

        Returns:
        buffered steps drained from the buffer.
      • report

        public void report​(org.springframework.cloud.sleuth.exporter.FinishedSpan span)
        Specified by:
        report in interface org.springframework.cloud.sleuth.exporter.SpanReporter