use of org.apache.knox.gateway.services.metrics.MetricsReporterException in project knox by apache.
the class DefaultMetricsService method loadAndInitReporters.
private void loadAndInitReporters(GatewayConfig config) {
ServiceLoader<MetricsReporter> reporters = ServiceLoader.load(MetricsReporter.class);
Iterator<MetricsReporter> reportersIterator = reporters.iterator();
while (reportersIterator.hasNext()) {
MetricsReporter metricsReporter = reportersIterator.next();
try {
metricsReporter.init(config);
metricsReporters.add(metricsReporter);
} catch (MetricsReporterException e) {
LOG.failedToInitializeReporter(metricsReporter.getName(), e);
}
}
}
Aggregations