Trying to integrate Coda Hale Metrics into spring boot without measuring metrics in / metrics

I followed the indication that adding the coda hale metrics library to the classpath will automatically automatically configure the metrics.

This works, I get the entered metricRegistry bean.

However, how do I show these new metrics at the endpoint / metric?

Thank!

+2
source share
3 answers

, . Codahale , Spring Boot, API- Codahale , . Boot Gauge Counter .

UPDATE: Spring Boot Codahale /metrics 1.2.0 (. MetricRegistryMetricReader).

+2

- , http://www.ryantenney.com/metrics-spring/, /health.

compile 'com.ryantenney.metrics:metrics-spring:3.0.0-RC2'

"enableMetrics"

@EnableMetrics
public class ApplicationConfiguration {
    ...

@timed:

@Timed
@RequestMapping(method=RequestMethod.GET)
public @ResponseBody
Foo foo() {
    ...

MetricRegistry /health.

, :

https://github.com/benschw/consul-cluster-puppet/tree/master/demo

: http://txt.fliglio.com/2014/10/spring-boot-actuator/

+4

I am updating the bar chart with spring-boot as follows:

        gauge.submit("histogram." + name + ".millis", durationMillis);
+1
source

Source: https://habr.com/ru/post/1584901/


All Articles