Search in sources :

Example 1 with Builder

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);
}
Also used : Builder(io.prometheus.client.Gauge.Builder) CollectorRegistry(io.prometheus.client.CollectorRegistry) PostConstruct(javax.annotation.PostConstruct)

Aggregations

CollectorRegistry (io.prometheus.client.CollectorRegistry)1 Builder (io.prometheus.client.Gauge.Builder)1 PostConstruct (javax.annotation.PostConstruct)1