Skip to content

Comments

fix: metrics scraping bug#651

Merged
mergify[bot] merged 3 commits intosigp:release-v1.0.0from
petarjuki7:metrics_scraping_bug
Oct 8, 2025
Merged

fix: metrics scraping bug#651
mergify[bot] merged 3 commits intosigp:release-v1.0.0from
petarjuki7:metrics_scraping_bug

Conversation

@petarjuki7
Copy link
Member

Issue Addressed

Fixes Prometheus unable to scrape metrics from Anchor when running in Docker.

Proposed Changes

Fix a trailing comma and change to host.docker.internal:5154

Additional Info

When Prometheus runs in Docker, localhost refers to the container, not the host. host.docker.internal is Docker's DNS name for accessing the host machine from containers (macOS/Windows).

@petarjuki7 petarjuki7 self-assigned this Oct 6, 2025
@AgeManning
Copy link
Member

Does this still work outside of docker?

@petarjuki7
Copy link
Member Author

Does this still work outside of docker?

Not sure, in our documentation it says

In order to run a metrics server, docker is required to be installed.

So I just followed that.

@dknopik
Copy link
Member

dknopik commented Oct 8, 2025

I assume this is configuration for the provided docker compose file.

So as this is a docker-specific file anyway, it should be fine. Users setting up their own Prometheus servers provide their own scraping config anyway

I am more concerned that this fixes macos and windows but breaks on linux. Will test.

@dknopik
Copy link
Member

dknopik commented Oct 8, 2025

I think it should work without this, as network_mode: host is used. IIRC, docker does not do any bridging when that is used, so localhost should in fact refer to the host.

@mergify mergify bot merged commit 4b4459e into sigp:release-v1.0.0 Oct 8, 2025
15 checks passed
petarjuki7 added a commit to petarjuki7/anchor that referenced this pull request Oct 16, 2025
Fixes Prometheus unable to scrape metrics from Anchor when running in Docker.


  Fix a trailing comma and change to `host.docker.internal:5154`


Co-Authored-By: petarjuki7 <petar.jukic7@gmail.com>

Co-Authored-By: Age Manning <Age@AgeManning.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants