Package io.opencensus.trace.export
Class RunningSpanStore
- java.lang.Object
-
- io.opencensus.trace.export.RunningSpanStore
-
- Direct Known Subclasses:
InProcessRunningSpanStore
,RunningSpanStore.NoopRunningSpanStore
@ThreadSafe public abstract class RunningSpanStore extends java.lang.Object
This class allows users to access in-process information about all running spans.The running spans tracking is available for all the spans with the option
Span.Options.RECORD_EVENTS
. This functionality allows users to debug stuck operations or long living operations.- Since:
- 0.5
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RunningSpanStore.Filter
Filter for running spans.private static class
RunningSpanStore.NoopRunningSpanStore
static class
RunningSpanStore.PerSpanNameSummary
Summary of all available data for a span name.static class
RunningSpanStore.Summary
The summary of all available data.
-
Field Summary
Fields Modifier and Type Field Description private static RunningSpanStore
NOOP_RUNNING_SPAN_STORE
-
Constructor Summary
Constructors Modifier Constructor Description protected
RunningSpanStore()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) static RunningSpanStore
getNoopRunningSpanStore()
Returns the no-op implementation of theRunningSpanStore
.abstract java.util.Collection<SpanData>
getRunningSpans(RunningSpanStore.Filter filter)
Returns a list of running spans that match theFilter
.abstract RunningSpanStore.Summary
getSummary()
Returns the summary of all available data such, as number of running spans.abstract void
setMaxNumberOfSpans(int maxNumberOfSpans)
Sets the maximum number of Spans in thRunningSpanStore
.
-
-
-
Field Detail
-
NOOP_RUNNING_SPAN_STORE
private static final RunningSpanStore NOOP_RUNNING_SPAN_STORE
-
-
Method Detail
-
getNoopRunningSpanStore
static RunningSpanStore getNoopRunningSpanStore()
Returns the no-op implementation of theRunningSpanStore
.- Returns:
- the no-op implementation of the
RunningSpanStore
.
-
getSummary
public abstract RunningSpanStore.Summary getSummary()
Returns the summary of all available data such, as number of running spans.- Returns:
- the summary of all available data.
- Since:
- 0.5
-
getRunningSpans
public abstract java.util.Collection<SpanData> getRunningSpans(RunningSpanStore.Filter filter)
Returns a list of running spans that match theFilter
.- Parameters:
filter
- used to filter the returned spans.- Returns:
- a list of running spans that match the
Filter
. - Since:
- 0.5
-
setMaxNumberOfSpans
public abstract void setMaxNumberOfSpans(int maxNumberOfSpans)
Sets the maximum number of Spans in thRunningSpanStore
.0
means disabled, by default theRunningSpanStore
is disabled.- Parameters:
maxNumberOfSpans
- the maximum number of Spans in thRunningSpanStore
.- Throws:
java.lang.IllegalArgumentException
- ifmaxNumberOfSpans
is negative.- Since:
- 0.22
-
-