How to integration test prometheus metrics with no http requests

Viewed 83

I have a server running that exposes metrics on port 8126. I want to test the metrics recorded when I hit an endpoint in my tests.

Im now sending a http request to the exposed port, to get the recorded metrics. for some reason, when no metrics has been recorded i get the following error

java.lang.IllegalArgumentException: Both 'Content-Length: 0' and 'Transfer-Encoding: chunked' found

How do I capture the actual metrics recorded by my server and use them in my integration test? I saw lots of code examples on Github but they were all unit tests.

0 Answers
Related