Getting error “Get http://localhost:9443/metrics: dial tcp 127.0.0.1:9443: connect: connection refused”

Since the targets are not running inside the prometheus container, they cannot be accessed through localhost. You need to access them through the host private IP or by replacing localhost with docker.for.mac.localhost or host.docker.internal.

On Windows:

  • host.docker.internal (tested on win10, win11)

On Max

  • docker.for.mac.localhost

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)