@Override public Callable<FastForwardLifecycle> setup( final SemanticMetricRegistry metricRegistry, final MetricId metricId, final String searchDomain ) { final FastForwardReporter.Builder builder = FastForwardReporter .forRegistry(metricRegistry) .schedule(TimeUnit.SECONDS, interval) .tagExtractor(new EnvironmentTagExtractor()) .prefix(metricId); host.ifPresent(builder::host); port.ifPresent(builder::port); return () -> { final FastForwardReporter reporter = builder.build(); reporter.start(); return reporter::stop; }; } }
public EnvironmentTagExtractor(Supplier<Map<String, String>> enviromentSupplier) { this.environmentTags = filterEnvironmentTags(enviromentSupplier.get()); }
public EnvironmentTagExtractor(Supplier<Map<String, String>> enviromentSupplier) { this.environmentTags = filterEnvironmentTags(enviromentSupplier.get()); }
@Override public Callable<FastForwardLifecycle> setup( final SemanticMetricRegistry metricRegistry, final MetricId metricId, final String searchDomain ) { final HttpClient.Builder httpClient = new HttpClient.Builder(); httpClient.discovery(discovery.toHttpDiscovery()); httpClient.searchDomain(searchDomain); final FastForwardHttpReporter.Builder builder = FastForwardHttpReporter .forRegistry(metricRegistry, httpClient.build()) .tagExtractor(new EnvironmentTagExtractor()) .schedule(interval, TimeUnit.SECONDS) .prefix(metricId); return () -> { final FastForwardHttpReporter reporter = builder.build(); reporter.start(); return reporter::stop; }; } }