1

I would like to scrape a target on my docker host. I either get 404 or conection refused.

My question is pretty much the same as this one here:

https://stackoverflow.com/questions/56909896/prometheus-in-docker-container-cannot-scrape-target-on-host

But the accepted answer (host.docker.internal:XXXX) did not work for me :/

I am working on a Docker for Windows environment with linux container.

famabenda
  • 80
  • 1
  • 13

1 Answers1

2

Fixed it:

I missed to specify my actual metrics enpoint in prometheus.yaml

Then:

  - job_name: 'spring-exporter'
    static_configs:
      - targets: ['host.docker.internal:8080']

Now:

  - job_name: 'spring-exporter'
    metrics_path: '/actuator/prometheus'
    static_configs:
      - targets: ['host.docker.internal:8080']
Community
  • 1
  • 1
famabenda
  • 80
  • 1
  • 13