@ThreadSafe public abstract class SampledSpanStore extends Object
For all completed spans with the option Span.Options#RECORD_EVENTS
the library can
store samples based on latency for succeeded operations or based on error code for failed
operations. To activate this, users MUST manually configure all the span names for which samples
will be collected (see registerSpanNamesForCollection(Collection)
).
Modifier and Type | Class and Description |
---|---|
static class |
SampledSpanStore.ErrorFilter
Filter for error based sampled spans.
|
static class |
SampledSpanStore.LatencyBucketBoundaries
The latency buckets boundaries.
|
static class |
SampledSpanStore.LatencyFilter
Filter for latency based sampled spans.
|
static class |
SampledSpanStore.PerSpanNameSummary
Summary of all available data for a span name.
|
static class |
SampledSpanStore.Summary
The summary of all available data.
|
Modifier | Constructor and Description |
---|---|
protected |
SampledSpanStore() |
Modifier and Type | Method and Description |
---|---|
abstract Collection<SpanData> |
getErrorSampledSpans(SampledSpanStore.ErrorFilter filter)
|
abstract Collection<SpanData> |
getLatencySampledSpans(SampledSpanStore.LatencyFilter filter)
|
abstract Set<String> |
getRegisteredSpanNamesForCollection()
Returns the set of unique span names registered to the library, for use in tests.
|
abstract SampledSpanStore.Summary |
getSummary()
Returns the summary of all available data, such as number of sampled spans in the latency based
samples or error based samples.
|
abstract void |
registerSpanNamesForCollection(Collection<String> spanNames)
Deprecated.
since 0.18. Use
EndSpanOptions.getSampleToLocalSpanStore() . |
abstract void |
unregisterSpanNamesForCollection(Collection<String> spanNames)
Deprecated.
since 0.18. The need of controlling the registration the span name will be removed
soon.
|
public abstract SampledSpanStore.Summary getSummary()
Data available only for span names registered using registerSpanNamesForCollection(Collection)
.
public abstract Collection<SpanData> getLatencySampledSpans(SampledSpanStore.LatencyFilter filter)
Status
equal to Status.OK
) that
match the filter
.
Latency based sampled spans are available only for span names registered using registerSpanNamesForCollection(Collection)
.
filter
- used to filter the returned sampled spans.filter
.public abstract Collection<SpanData> getErrorSampledSpans(SampledSpanStore.ErrorFilter filter)
Status
other than Status.OK
) that
match the filter
.
Error based sampled spans are available only for span names registered using registerSpanNamesForCollection(Collection)
.
filter
- used to filter the returned sampled spans.filter
.@Deprecated public abstract void registerSpanNamesForCollection(Collection<String> spanNames)
EndSpanOptions.getSampleToLocalSpanStore()
.If called multiple times the library keeps the list of unique span names from all the calls.
spanNames
- list of span names for which the library will collect samples.@Deprecated public abstract void unregisterSpanNamesForCollection(Collection<String> spanNames)
The library keeps the list of unique registered span names for which samples will be called. This method allows users to remove span names from that list.
spanNames
- list of span names for which the library will no longer collect samples.public abstract Set<String> getRegisteredSpanNamesForCollection()
This method is only meant for testing code that uses OpenCensus, and it is not performant.