Package io.opencensus.trace.export
Class SampledSpanStore.ErrorFilter
java.lang.Object
io.opencensus.trace.export.SampledSpanStore.ErrorFilter
- Direct Known Subclasses:
AutoValue_SampledSpanStore_ErrorFilter
- Enclosing class:
SampledSpanStore
Filter for error based sampled spans. Used to filter results returned by the
SampledSpanStore.getErrorSampledSpans(ErrorFilter)
request.- Since:
- 0.5
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SampledSpanStore.ErrorFilter
create
(String spanName, Status.CanonicalCode canonicalCode, int maxSpansToReturn) Returns a new instance ofErrorFilter
.abstract Status.CanonicalCode
Returns the canonical code used by this filter.abstract int
Returns the maximum number of spans to be returned.abstract String
Returns the span name used by this filter.
-
Constructor Details
-
ErrorFilter
ErrorFilter()
-
-
Method Details
-
create
public static SampledSpanStore.ErrorFilter create(String spanName, @Nullable Status.CanonicalCode canonicalCode, int maxSpansToReturn) Returns a new instance ofErrorFilter
.Filters all the spans based on
spanName
andcanonicalCode
and returns a maximum ofmaxSpansToReturn
.- Parameters:
spanName
- the name of the span.canonicalCode
- the error code of the span.null
can be used to query all error codes.maxSpansToReturn
- the maximum number of results to be returned.0
means all.- Returns:
- a new instance of
ErrorFilter
. - Throws:
NullPointerException
- ifspanName
isnull
.IllegalArgumentException
- ifcanonicalCode
isStatus.CanonicalCode.OK
ormaxSpansToReturn
is negative.- Since:
- 0.5
-
getSpanName
Returns the span name used by this filter.- Returns:
- the span name used by this filter.
- Since:
- 0.5
-
getCanonicalCode
Returns the canonical code used by this filter. Always different thanStatus.CanonicalCode.OK
. Ifnull
then all errors match.- Returns:
- the canonical code used by this filter.
- Since:
- 0.5
-
getMaxSpansToReturn
public abstract int getMaxSpansToReturn()Returns the maximum number of spans to be returned. Used to enforce the number of returnedSpanData
.0
means all.- Returns:
- the maximum number of spans to be returned.
- Since:
- 0.5
-