changed prometheus metrics names

This commit is contained in:
Konstantinos Spyrou 2021-10-12 10:16:37 +00:00
parent 1b6ca905da
commit 03e0b8f472
1 changed files with 4 additions and 4 deletions

View File

@ -33,10 +33,10 @@ public class PrometheusController { // TODO: remove this with migration to Sprin
@RequestMapping(method = RequestMethod.GET, path = "", produces = MediaType.TEXT_PLAIN_VALUE)
public String getPiwikMetrics() {
PrometheusMeterRegistry registry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
registry.counter("total").increment(piWikService.getTotal());
registry.counter("validated").increment(piWikService.getValidated(true));
registry.counter("provide_usagecounts_repositories").increment(piWikService.getTotal());
registry.counter("provide_usagecounts_repositories_validated").increment(piWikService.getValidated(true));
return registry.scrape(TextFormat.CONTENT_TYPE_004);
return registry.scrape(TextFormat.CONTENT_TYPE_OPENMETRICS_100);
}
@RequestMapping(method = RequestMethod.GET, path = "metrics", produces = MediaType.TEXT_PLAIN_VALUE)
@ -49,7 +49,7 @@ public class PrometheusController { // TODO: remove this with migration to Sprin
new ProcessorMetrics().bindTo(registry); // metrics related to the CPU stats
new UptimeMetrics().bindTo(registry);
return registry.scrape(TextFormat.CONTENT_TYPE_004);
return registry.scrape(TextFormat.CONTENT_TYPE_OPENMETRICS_100);
}
}