Class BufferingSpanReporter
- java.lang.Object
-
- org.springframework.cloud.sleuth.autoconfig.actuate.BufferingSpanReporter
-
- All Implemented Interfaces:
org.springframework.cloud.sleuth.exporter.SpanReporter
public class BufferingSpanReporter extends Object implements org.springframework.cloud.sleuth.exporter.SpanReporter
ASpanReporterthat buffers finished spans.- Since:
- 3.1.0
- Author:
- Marcin Grzejszczak
-
-
Constructor Summary
Constructors Constructor Description BufferingSpanReporter(int capacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.springframework.cloud.sleuth.exporter.FinishedSpan>drainFinishedSpans()Return thetimelineby pulling spans from the buffer.List<org.springframework.cloud.sleuth.exporter.FinishedSpan>getFinishedSpans()Return a snapshot of currently buffered spans.voidreport(org.springframework.cloud.sleuth.exporter.FinishedSpan span)
-
-
-
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 thetimelineby 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:
reportin interfaceorg.springframework.cloud.sleuth.exporter.SpanReporter
-
-