Class BaseMetrics<T extends io.prometheus.client.SimpleCollector,C>
- java.lang.Object
-
- org.apache.skywalking.oap.server.telemetry.prometheus.BaseMetrics<T,C>
-
- Direct Known Subclasses:
PrometheusCounterMetrics,PrometheusGaugeMetrics
public abstract class BaseMetrics<T extends io.prometheus.client.SimpleCollector,C> extends Object
BaseMetrics parent class represents the metrics
-
-
Field Summary
Fields Modifier and Type Field Description protected MetricsTag.Keyslabelsprotected Stringnameprotected Stringtipsprotected MetricsTag.Valuesvalues
-
Constructor Summary
Constructors Constructor Description BaseMetrics(String name, String tips, MetricsTag.Keys labels, MetricsTag.Values values)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Tcreate(String[] labelNames)protected CgetMetric()Create real prometheus metrics with SkyWalking native labels, and provide to all metrics implementation.protected booleanisIDReady()
-
-
-
Field Detail
-
name
protected final String name
-
tips
protected final String tips
-
labels
protected final MetricsTag.Keys labels
-
values
protected final MetricsTag.Values values
-
-
Constructor Detail
-
BaseMetrics
public BaseMetrics(String name, String tips, MetricsTag.Keys labels, MetricsTag.Values values)
-
-
Method Detail
-
isIDReady
protected boolean isIDReady()
-
getMetric
protected C getMetric()
Create real prometheus metrics with SkyWalking native labels, and provide to all metrics implementation. Metrics name should be unique.- Returns:
- metric reference if the service instance id has been initialized. Or NULL.
-
-