Search in sources :

Example 1 with ManageLifecycle

use of org.apache.druid.guice.ManageLifecycle in project druid by druid-io.

the class EmitterModule method getServiceEmitter.

@Provides
@ManageLifecycle
public ServiceEmitter getServiceEmitter(@Self Supplier<DruidNode> configSupplier, Emitter emitter, @ExtraServiceDimensions Map<String, String> extraServiceDimensions) {
    final DruidNode config = configSupplier.get();
    log.info("Using emitter [%s] for metrics and alerts, with dimensions [%s].", emitter, extraServiceDimensions);
    final ServiceEmitter retVal = new ServiceEmitter(config.getServiceName(), config.getHostAndPortToUse(), emitter, ImmutableMap.copyOf(extraServiceDimensions));
    EmittingLogger.registerEmitter(retVal);
    return retVal;
}
Also used : ServiceEmitter(org.apache.druid.java.util.emitter.service.ServiceEmitter) DruidNode(org.apache.druid.server.DruidNode) ManageLifecycle(org.apache.druid.guice.ManageLifecycle) Provides(com.google.inject.Provides)

Aggregations

Provides (com.google.inject.Provides)1 ManageLifecycle (org.apache.druid.guice.ManageLifecycle)1 ServiceEmitter (org.apache.druid.java.util.emitter.service.ServiceEmitter)1 DruidNode (org.apache.druid.server.DruidNode)1