Skip to content

Instructions for collecting Docker metrics using Prometheus from docs is not reproducible #22367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
QazCetelic opened this issue Apr 4, 2025 · 1 comment
Open
1 task done
Labels
area/engine Issue affects Docker engine/daemon status/triage Needs triage

Comments

@QazCetelic
Copy link

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

I have the same issue as #6028, however the suggested solution did not work for me.

I have used 127.0.0.1 in my docker config as recommended.
/etc/docker/daemon.json:

{
  "metrics-addr": "127.0.0.1:9323",
  "default-address-pools": [
    {
      "base" : "172.16.0.0/12",
      "size" : 24
    }
  ]
}

And I'm using host.docker.internal in my Prometheus config as suggested in the docs.

global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: prometheus
    static_configs:
      - targets: ["prometheus:9090"]

  - job_name: docker
    static_configs:
      - targets: ["host.docker.internal:9323"]

However, I'm unable to reach the port from within the Prometheus container even though I can reach it outside using curl http://127.0.0.1:9323/metrics.

Location

https://docs.docker.com/engine/daemon/prometheus/

Suggestion

Update the tutorial page in the documentation

@QazCetelic QazCetelic added the status/triage Needs triage label Apr 4, 2025
@usha-mandya usha-mandya added the area/engine Issue affects Docker engine/daemon label Apr 4, 2025
@QazCetelic
Copy link
Author

For anyone wondering how to get it to work, I just set it to 0.0.0.0.
It does of course expose the metrics to other devices on the network, but as the docs say: consider your threat model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/engine Issue affects Docker engine/daemon status/triage Needs triage
Projects
None yet
Development

No branches or pull requests

2 participants