io.quarkus.micrometer.runtime.export.PrometheusMeterRegistryProducer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-micrometer Show documentation
Show all versions of quarkus-micrometer Show documentation
Instrument the runtime and your application with dimensional metrics using Micrometer.
package io.quarkus.micrometer.runtime.export;
import java.util.Optional;
import jakarta.annotation.Priority;
import jakarta.enterprise.inject.Alternative;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Singleton;
import jakarta.interceptor.Interceptor;
import io.micrometer.core.instrument.Clock;
import io.micrometer.prometheus.PrometheusConfig;
import io.micrometer.prometheus.PrometheusMeterRegistry;
import io.prometheus.client.CollectorRegistry;
import io.prometheus.client.exemplars.ExemplarSampler;
/**
* This producer is only registered if the {@code quarkus.micrometer.export.prometheus.default-registry} is set to {@code true}.
*/
public class PrometheusMeterRegistryProducer {
@Produces
@Singleton
@Alternative
@Priority(Interceptor.Priority.APPLICATION + 100)
public PrometheusMeterRegistry registry(PrometheusConfig config, CollectorRegistry collectorRegistry,
Optional exemplarSampler, Clock clock) {
return new PrometheusMeterRegistry(config, collectorRegistry, clock, exemplarSampler.orElse(null));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy