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

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

There is a newer version: 3.2.4
Show newest version
package io.quarkiverse.micrometer.registry.datadog;

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

import io.micrometer.core.instrument.Clock;
import io.micrometer.datadog.DatadogConfig;
import io.micrometer.datadog.DatadogMeterRegistry;
import io.quarkus.arc.Priority;

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy