Revision 61665
Added by Konstantinos Spyrou over 2 years ago
PrometheusController.java | ||
---|---|---|
33 | 33 |
@RequestMapping(method = RequestMethod.GET, path = "", produces = MediaType.TEXT_PLAIN_VALUE) |
34 | 34 |
public String getPiwikMetrics() { |
35 | 35 |
PrometheusMeterRegistry registry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT); |
36 |
registry.counter("total").increment(piWikService.getTotal());
|
|
37 |
registry.counter("validated").increment(piWikService.getValidated(true)); |
|
36 |
registry.counter("provide_usagecounts_repositories").increment(piWikService.getTotal());
|
|
37 |
registry.counter("provide_usagecounts_repositories_validated").increment(piWikService.getValidated(true));
|
|
38 | 38 |
|
39 |
return registry.scrape(TextFormat.CONTENT_TYPE_004);
|
|
39 |
return registry.scrape(TextFormat.CONTENT_TYPE_OPENMETRICS_100);
|
|
40 | 40 |
} |
41 | 41 |
|
42 | 42 |
@RequestMapping(method = RequestMethod.GET, path = "metrics", produces = MediaType.TEXT_PLAIN_VALUE) |
... | ... | |
49 | 49 |
new ProcessorMetrics().bindTo(registry); // metrics related to the CPU stats |
50 | 50 |
new UptimeMetrics().bindTo(registry); |
51 | 51 |
|
52 |
return registry.scrape(TextFormat.CONTENT_TYPE_004);
|
|
52 |
return registry.scrape(TextFormat.CONTENT_TYPE_OPENMETRICS_100);
|
|
53 | 53 |
} |
54 | 54 |
|
55 | 55 |
} |
Also available in: Unified diff
changed prometheus metrics names