Skip to content

Conversation

@dvdksn
Copy link
Contributor

@dvdksn dvdksn commented Dec 16, 2024

@dvdksn dvdksn requested a review from thaJeztah December 16, 2024 16:32
@github-actions github-actions bot added the area/engine Issue affects Docker engine/daemon label Dec 16, 2024
@netlify
Copy link

netlify bot commented Dec 16, 2024

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 7e4fd0f
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/67614686d57fd70008e8d8b3
😎 Deploy Preview https://deploy-preview-21643--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
@dvdksn dvdksn force-pushed the daemon-metrics-wildcard-addr branch from 0517f11 to 7e4fd0f Compare December 17, 2024 09:38
@dvdksn dvdksn requested a review from a team December 17, 2024 10:16
@thaJeztah
Copy link
Member

thaJeztah commented Dec 17, 2024

We need to fix some of this; there was a proposal to expose it through the Engine API instead of separate, but I also need to dust off the work I started to expose listeners in docker info

So... I just recalled there may be a different way; as part of docker plugin, there was a PR to allow "metrics plugins";

And the daemon also actually starts the metrics endpoint listening on a socket; https://github.com/moby/moby/blob/8d3ecc28c1e886c59f4d23b9d1e4b35aa40696ba/daemon/metrics_unix.go#L24-L46

docker run --rm -v /var/run/docker/metrics.sock:/var/run/docker/metrics.sock alpine sh -c 'apk add --quiet --no-cache curl && curl -s --unix-socket /var/run/docker/metrics.sock http://localhost/metrics | head -n10'
# HELP builder_builds_failed_total Number of failed image builds
# TYPE builder_builds_failed_total counter
builder_builds_failed_total{reason="build_canceled"} 0
builder_builds_failed_total{reason="build_target_not_reachable_error"} 0
builder_builds_failed_total{reason="command_not_supported_error"} 0
builder_builds_failed_total{reason="dockerfile_empty_error"} 0
builder_builds_failed_total{reason="dockerfile_syntax_error"} 0
builder_builds_failed_total{reason="error_processing_commands_error"} 0
builder_builds_failed_total{reason="missing_onbuild_arguments_error"} 0
builder_builds_failed_total{reason="unknown_instruction_error"} 0

Given that that one is inside /var/run/docker I'm not sure if we should document that though (although it's probably OK(ish)). The alternative may be to configure the daemon to use a socket instead of tcp

We should probably look if we can make the config allow for a unix:/// socket to be set instead of just a tcp address.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for this change though

@dvdksn
Copy link
Contributor Author

dvdksn commented Dec 17, 2024

What's the state of engine plugins anyway?

@dvdksn dvdksn merged commit 3acfc9e into docker:main Dec 17, 2024
14 checks passed
@dvdksn dvdksn deleted the daemon-metrics-wildcard-addr branch December 17, 2024 12:39
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/review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

metrics-addr should be 0.0.0.0:9323 for a dockerized prometheus to reach it

4 participants