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
@Immutable public abstract static class SampledSpanStore.ErrorFilter extends java.lang.ObjectFilter for error based sampled spans. Used to filter results returned by theSampledSpanStore.getErrorSampledSpans(ErrorFilter)request.- Since:
- 0.5
-
-
Constructor Summary
Constructors Constructor Description ErrorFilter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static SampledSpanStore.ErrorFiltercreate(java.lang.String spanName, Status.CanonicalCode canonicalCode, int maxSpansToReturn)Returns a new instance ofErrorFilter.abstract Status.CanonicalCodegetCanonicalCode()Returns the canonical code used by this filter.abstract intgetMaxSpansToReturn()Returns the maximum number of spans to be returned.abstract java.lang.StringgetSpanName()Returns the span name used by this filter.
-
-
-
Method Detail
-
create
public static SampledSpanStore.ErrorFilter create(java.lang.String spanName, @Nullable Status.CanonicalCode canonicalCode, int maxSpansToReturn)
Returns a new instance ofErrorFilter.Filters all the spans based on
spanNameandcanonicalCodeand returns a maximum ofmaxSpansToReturn.- Parameters:
spanName- the name of the span.canonicalCode- the error code of the span.nullcan be used to query all error codes.maxSpansToReturn- the maximum number of results to be returned.0means all.- Returns:
- a new instance of
ErrorFilter. - Throws:
java.lang.NullPointerException- ifspanNameisnull.java.lang.IllegalArgumentException- ifcanonicalCodeisStatus.CanonicalCode.OKormaxSpansToReturnis negative.- Since:
- 0.5
-
getSpanName
public abstract java.lang.String getSpanName()
Returns the span name used by this filter.- Returns:
- the span name used by this filter.
- Since:
- 0.5
-
getCanonicalCode
@Nullable public abstract Status.CanonicalCode getCanonicalCode()
Returns the canonical code used by this filter. Always different thanStatus.CanonicalCode.OK. Ifnullthen 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.0means all.- Returns:
- the maximum number of spans to be returned.
- Since:
- 0.5
-
-