use of io.prometheus.client.Gauge.Builder in project promregator by promregator.
the class AbstractMetricsEndpoint method setupOwnRequestScopedMetrics.
@PostConstruct
public void setupOwnRequestScopedMetrics() {
this.requestRegistry = new CollectorRegistry();
Builder builder = Gauge.build("promregator_up", "Indicator, whether the target of promregator is available");
if (this.isLabelEnrichmentEnabled()) {
builder = builder.labelNames(CFAllLabelsMetricFamilySamplesEnricher.getEnrichingLabelNames());
} else {
builder = builder.labelNames(NullMetricFamilySamplesEnricher.getEnrichingLabelNames());
}
this.up = builder.register(this.requestRegistry);
}
Aggregations