com.fizzed.prometheus.ninja.PrometheusExporter Maven / Gradle / Ivy
package com.fizzed.prometheus.ninja;
import io.prometheus.client.CollectorRegistry;
import io.prometheus.client.hotspot.DefaultExports;
import javax.inject.Inject;
import javax.inject.Provider;
import javax.inject.Singleton;
import ninja.lifecycle.Start;
@Singleton
public class PrometheusExporter {
private final Provider registryProvider;
@Inject
public PrometheusExporter(
Provider registryProvider) {
this.registryProvider = registryProvider;
}
@Start
public void start() {
final CollectorRegistry registry = this.registryProvider.get();
DefaultExports.register(registry);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy