Search in sources :

Example 1 with MetricsReporterException

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);
        }
    }
}
Also used : MetricsReporter(org.apache.knox.gateway.services.metrics.MetricsReporter) MetricsReporterException(org.apache.knox.gateway.services.metrics.MetricsReporterException)

Aggregations

MetricsReporter (org.apache.knox.gateway.services.metrics.MetricsReporter)1 MetricsReporterException (org.apache.knox.gateway.services.metrics.MetricsReporterException)1