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

com.fizzed.prometheus.ninja.PrometheusExporter Maven / Gradle / Ivy

There is a newer version: 0.0.4
Show newest version
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