Interface MetricStorage
-
- All Known Subinterfaces:
SynchronousMetricStorage
- All Known Implementing Classes:
AsynchronousMetricStorage,DefaultSynchronousMetricStorage,EmptyMetricStorage
public interface MetricStorageStores collectedMetricData.This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
-
Field Summary
Fields Modifier and Type Field Description static AttributesCARDINALITY_OVERFLOWAttributes capturing overflow measurements recorded when cardinality limit is exceeded.static intDEFAULT_MAX_CARDINALITYThe default max number of distinct metric points for a particularMetricStorage.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MetricDatacollect(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long startEpochNanos, long epochNanos)Collects the metrics from this storage.MetricDescriptorgetMetricDescriptor()Returns a description of the metric produced in this storage.default booleanisEmpty()Determines whether this storage is an empty metric storage.
-
-
-
Field Detail
-
DEFAULT_MAX_CARDINALITY
static final int DEFAULT_MAX_CARDINALITY
The default max number of distinct metric points for a particularMetricStorage.- See Also:
- Constant Field Values
-
CARDINALITY_OVERFLOW
static final Attributes CARDINALITY_OVERFLOW
Attributes capturing overflow measurements recorded when cardinality limit is exceeded.
-
-
Method Detail
-
getMetricDescriptor
MetricDescriptor getMetricDescriptor()
Returns a description of the metric produced in this storage.
-
collect
MetricData collect(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long startEpochNanos, long epochNanos)
Collects the metrics from this storage. If storingAggregationTemporality.DELTAmetrics, reset for the next collection period.Note: This is a stateful operation and will reset any interval-related state for the
collector.- Parameters:
resource- The resource associated with the metrics.instrumentationScopeInfo- The instrumentation scope generating the metrics.startEpochNanos- The start timestamp for this SDK.epochNanos- The timestamp for this collection.- Returns:
- The
MetricDatafrom this collection period.
-
isEmpty
default boolean isEmpty()
Determines whether this storage is an empty metric storage.Uses the reference comparison since
EmptyMetricStorageis singleton.- Returns:
- true if is empty.
-
-