All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.micrometer.registry.stackdriver.ConditionalRegistryProducer Maven / Gradle / Ivy

package io.quarkiverse.micrometer.registry.stackdriver;

import javax.enterprise.inject.Produces;
import javax.inject.Singleton;
import javax.interceptor.Interceptor;

import io.micrometer.core.instrument.Clock;
import io.micrometer.stackdriver.StackdriverConfig;
import io.micrometer.stackdriver.StackdriverMeterRegistry;
import io.quarkus.arc.AlternativePriority;

@Singleton
public class ConditionalRegistryProducer {
    /**
     * This producer is added as a bean by the Processor IFF the default registry
     * instance has been enabled.
     */
    @Produces
    @Singleton
    @AlternativePriority(Interceptor.Priority.APPLICATION + 100)
    public StackdriverMeterRegistry registry(StackdriverConfig config, Clock clock) {
        return StackdriverMeterRegistry.builder(config).clock(clock).build();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy