use of io.prometheus.client.exporter.HTTPServer in project infrautils by opendaylight.
the class MetricsPrometheusExampleMain method main.
public static void main(String[] args) throws IOException {
// see also OsgiWebInitializer
CollectorRegistry collectorRegistry = new CollectorRegistrySingleton();
PrometheusMetricProviderImpl metricProvider = new PrometheusMetricProviderImpl(collectorRegistry);
MetricsExample metricsExample = new MetricsExample(metricProvider);
metricsExample.init();
HTTPServer server = new HTTPServer(new InetSocketAddress("localhost", 1234), collectorRegistry);
System.in.read();
server.stop();
metricsExample.close();
metricProvider.close();
}
Aggregations