Repository navigation
API: expose per-container resource usage (memory/CPU), including Docker Compose services #12190
FaberVi
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi! We run several Docker Compose stacks on Coolify and manage them only through the REST API. Today the API doesn't return any resource usage, and for compose services there are no metrics in the UI either.
What we'd like is a read-only endpoint that returns current usage per container on a server, compose services included. For example:
GET /api/v1/servers/{uuid}/containers/metricsFor each container it would return the name, the linked resource (application, database or service and its uuid), CPU %, memory used and limit in bytes, memory used %, and a timestamp. An optional
?container=<name>&minutes=Ncould return the history, which is useful to see the peak. It would need only thereadability, and the Sentinel token would never leave the server.It looks like most of the pieces are already there in
release/v4.5(SentinelMetricsClient::containersCurrent()). This would extend #11431 / #11432, which cover server-level metrics only.Our use case is sizing
mem_limitfrom real usage after a deploy: we raise the limit when usage stays above about 80% and lower it below about 30%. Today we have to readdocker statsby hand on the server.If this direction is welcome, I'm happy to open a PR against
release/v4.5with the endpoint, the OpenAPI docs and tests.All reactions