0

I want configure Spring actuator with Prometheus. Prometheus is deployed in Docker container. I followed these steps: added dependencies in Spring Boot

enable all actuators (I can see prometheus at localhost:8080/actuator/prometheus)

prometheus.yaml located at /etc/prometheus

I've started Spring boot application, listening on 8080 port.

I've started docker container with following command: sudo docker run -p 9090:9090 -v /etc/prometheus/ prom/prometheus --config.file=/etc/prometheus/prometheus.yml At localhost:9090 i can see prometheus UI, but prometheus doesn't show Springboot metrics... Prometheus doesen't show my application as target: enter image description here This is my first question, sorry. Could anyone help me?

I've tried a lot of tutorial, but nothing helped me. I expected to understand and solve problem.

  • 2
    Taken from the `how to ask a good question` which you were encouraged to read when you created your account and you probably ignored. `DO NOT post images of code, data, error messages, etc.—copy or type the text into the question. Please reserve the use of images for diagrams or demonstrating rendering bugs, things that are impossible to describe accurately via text.` https://stackoverflow.com/help/how-to-ask remove all images and include all the code properly formatted into your question by using the edit button. – Toerktumlare Mar 28 '23 at 21:16
  • Additional info here https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors/285557#285557 – Toerktumlare Mar 28 '23 at 21:18
  • thank you, and sorry. – Silvio Venturino Mar 29 '23 at 18:15
  • 1
    Don't be sorry, but rather [edit] your question to be more appropriate. On the matter: since you are using docker, `localhost` is [not a good choice](https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach). Try to configure target using ip of your host (or any solution from link above). – markalex Mar 29 '23 at 18:23

0 Answers0