Hi,
I'm not sure it's a bug but im trying to implement your library in the past
day without any results.
I thinking maybe its a conflicts with the dependencies versions but i tried
everything.
So i have a very simple spring boot project that serve /test endpoint and i
configure
1. Counter
2. Histogram
Now i have the prometheus metrics under **/actuator/prometheus**
The desire result is that the metrics will contain the following additional
metrics:
1. requests_test_total
2. requests_latency_seconds
I'm triggering the /test endpoint but these metrics are not shown in the
prometheus metrics
Am I missing something ? thanks in advanced!
This are my dependencies:
```
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('io.micrometer:micrometer-registry-prometheus')
compile "io.prometheus:simpleclient:0.8.1"
compile "io.prometheus:simpleclient_hotspot:0.8.1"
compile "io.prometheus:simpleclient_httpserver:0.8.1"
compile "io.prometheus:simpleclient_pushgateway:0.8.1"
compile group: 'io.prometheus', name: 'simpleclient_spring_boot', version:
'0.8.1'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
compile group: 'ch.qos.logback.contrib', name: 'logback-json-classic',
version: '0.1.5'
compile group: 'ch.qos.logback.contrib', name: 'logback-jackson', version:
'0.1.5'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind',
version: '2.9.3'
compile group: 'net.logstash.logback', name: 'logstash-logback-encoder',
version: '6.3'
}
```
And this is the endpoint class implementation
```
package prometheus.prometheusclientexample;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.prometheus.client.Counter;
import io.prometheus.client.Histogram;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class SimpleEndpoint {
private static final Logger logger =
LoggerFactory.getLogger("MainLogger");
static final Counter test_requests =
Counter.build().name("requests_test_total").help("Total /test
requests.").register();
static final Histogram requestLatency = Histogram.build()
.name("requests_latency_seconds").help("Request latency in
seconds.").register();
@RequestMapping("/test")
public String test2() throws InterruptedException {
Histogram.Timer requestTimer = requestLatency.startTimer();
try {
logger.info("Before");
test_requests.inc();
logger.info("This is a simple endpint");
}
finally {
requestTimer.observeDuration();
}
return "OK";
}
}
```
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/d43bdf6d-34e8-451f-ad72-e3aa8d11ff11%40googlegroups.com.