Class MetricWithFixedMetadata

java.lang.Object
io.prometheus.metrics.core.metrics.Metric
io.prometheus.metrics.core.metrics.MetricWithFixedMetadata
All Implemented Interfaces:
io.prometheus.metrics.model.registry.Collector
Direct Known Subclasses:
Counter, CounterWithCallback, Gauge, GaugeWithCallback, Histogram, Info, StateSet, Summary, SummaryWithCallback

public abstract class MetricWithFixedMetadata extends Metric
Almost all metrics have fixed metadata, i.e. the metric name is known when the metric is created.

An exception would be a metric that is a bridge to a 3rd party metric library, where the metric name has to be retrieved from the 3rd party metric library at scrape time.

  • Field Details

    • labelNames

      protected final String[] labelNames
  • Constructor Details

  • Method Details

    • getMetadata

      protected io.prometheus.metrics.model.snapshots.MetricMetadata getMetadata()
    • getPrometheusName

      public String getPrometheusName()