use of org.apache.hudi.metrics.prometheus.PushGatewayMetricsReporter in project hudi by apache.
the class MetricsReporterFactory method createReporter.
public static MetricsReporter createReporter(HoodieWriteConfig config, MetricRegistry registry) {
String reporterClassName = config.getMetricReporterClassName();
if (!StringUtils.isNullOrEmpty(reporterClassName)) {
Object instance = ReflectionUtils.loadClass(reporterClassName, new Class<?>[] { Properties.class, MetricRegistry.class }, config.getProps(), registry);
if (!(instance instanceof CustomizableMetricsReporter)) {
throw new HoodieException(config.getMetricReporterClassName() + " is not a subclass of CustomizableMetricsReporter");
}
return (MetricsReporter) instance;
}
MetricsReporterType type = config.getMetricsReporterType();
MetricsReporter reporter = null;
switch(type) {
case GRAPHITE:
reporter = new MetricsGraphiteReporter(config, registry);
break;
case INMEMORY:
reporter = new InMemoryMetricsReporter();
break;
case JMX:
reporter = new JmxMetricsReporter(config, registry);
break;
case DATADOG:
reporter = new DatadogMetricsReporter(config, registry);
break;
case PROMETHEUS_PUSHGATEWAY:
reporter = new PushGatewayMetricsReporter(config, registry);
break;
case PROMETHEUS:
reporter = new PrometheusReporter(config, registry);
break;
case CONSOLE:
reporter = new ConsoleMetricsReporter(registry);
break;
case CLOUDWATCH:
reporter = new CloudWatchMetricsReporter(config, registry);
break;
default:
LOG.error("Reporter type[" + type + "] is not supported.");
break;
}
return reporter;
}
Aggregations