removed kpi metrics from /metrics

This commit is contained in:
Michele Artini 2021-12-02 14:35:53 +01:00
parent 2f99954a4f
commit 52a53e6484
1 changed files with 1 additions and 2 deletions

View File

@ -16,7 +16,6 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import io.micrometer.core.instrument.Metrics;
import io.prometheus.client.Collector.MetricFamilySamples; import io.prometheus.client.Collector.MetricFamilySamples;
import io.prometheus.client.GaugeMetricFamily; import io.prometheus.client.GaugeMetricFamily;
import io.prometheus.client.exporter.common.TextFormat; import io.prometheus.client.exporter.common.TextFormat;
@ -32,7 +31,7 @@ public class MetricUtils {
@PostConstruct @PostConstruct
public void registerToMainEndpoint() { public void registerToMainEndpoint() {
if (kpiMetrics != null) { if (kpiMetrics != null) {
kpiMetrics.forEach((k, v) -> Metrics.gauge(k, v, o -> o.obtainValue())); // kpiMetrics.forEach((k, v) -> Metrics.gauge(k, v, o -> o.obtainValue()));
log.info("KPI METRICS REGISTERED: " + StringUtils.join(kpiMetrics.keySet(), ", ")); log.info("KPI METRICS REGISTERED: " + StringUtils.join(kpiMetrics.keySet(), ", "));
} }
} }