Interface MetricStorage
- All Known Subinterfaces:
SynchronousMetricStorage
- All Known Implementing Classes:
AsynchronousMetricStorage
,DefaultSynchronousMetricStorage
,EmptyMetricStorage
public interface MetricStorage
Stores collected
MetricData
.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Attributes
Attributes capturing overflow measurements recorded when cardinality limit is exceeded.static final int
The default max number of distinct metric points for a particularMetricStorage
. -
Method Summary
Modifier and TypeMethodDescriptioncollect
(Resource resource, InstrumentationScopeInfo instrumentationScopeInfo, long startEpochNanos, long epochNanos) Collects the metrics from this storage.Returns a description of the metric produced in this storage.default boolean
isEmpty()
Determines whether this storage is an empty metric storage.
-
Field Details
-
DEFAULT_MAX_CARDINALITY
static final int DEFAULT_MAX_CARDINALITYThe default max number of distinct metric points for a particularMetricStorage
.- See Also:
-
CARDINALITY_OVERFLOW
Attributes capturing overflow measurements recorded when cardinality limit is exceeded.
-
-
Method Details
-
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.DELTA
metrics, 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
MetricData
from this collection period.
-
isEmpty
default boolean isEmpty()Determines whether this storage is an empty metric storage.Uses the reference comparison since
EmptyMetricStorage
is singleton.- Returns:
- true if is empty.
-