Interface MetricStorage

    • Field Detail

      • DEFAULT_MAX_CARDINALITY

        static final int DEFAULT_MAX_CARDINALITY
        The default max number of distinct metric points for a particular MetricStorage.
        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 storing AggregationTemporality.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.