use of org.cloudfoundry.promregator.fetcher.CFMetricsFetcher in project promregator by promregator.
the class AbstractMetricsEndpoint method createMetricsFetchers.
protected List<MetricsFetcher> createMetricsFetchers(List<Instance> instanceList) {
List<MetricsFetcher> callablesList = new LinkedList<>();
for (Instance instance : instanceList) {
log.info(String.format("Instance %s", instance.getInstanceId()));
Target target = instance.getTarget();
String orgName = target.getOrgName();
String spaceName = target.getSpaceName();
String appName = target.getApplicationName();
String accessURL = instance.getAccessUrl();
if (accessURL == null) {
log.warn(String.format("Unable to retrieve hostname for %s/%s/%s; skipping", orgName, spaceName, appName));
continue;
}
AbstractMetricFamilySamplesEnricher mfse = new CFMetricFamilySamplesEnricher(orgName, spaceName, appName, instance.getInstanceId());
MetricsFetcherMetrics mfm = new MetricsFetcherMetrics(mfse, up);
MetricsFetcher mf = null;
if (this.proxyHost != null && this.proxyPort != 0) {
mf = new CFMetricsFetcher(accessURL, instance.getInstanceId(), this.ae, mfse, this.proxyHost, this.proxyPort, mfm);
} else {
mf = new CFMetricsFetcher(accessURL, instance.getInstanceId(), this.ae, mfse, mfm);
}
callablesList.add(mf);
}
return callablesList;
}
Aggregations