Skip to content

feat(orchestrator): ship per-container metrics via prometheus#1071

Merged
binarybaron merged 4 commits into
masterfrom
feat/orchestrator-prometheus-metrics
Jun 5, 2026
Merged

feat(orchestrator): ship per-container metrics via prometheus#1071
binarybaron merged 4 commits into
masterfrom
feat/orchestrator-prometheus-metrics

Conversation

@binarybaron

@binarybaron binarybaron commented Jun 5, 2026

Copy link
Copy Markdown

Adds an opt-in metrics pipeline to the orchestrator-generated docker-compose, parallel to the existing Promtail log shipping. Setting METRICS_REMOTE_WRITE_URL adds two services: cadvisor, which exposes per-container cpu, memory, pids, network and filesystem metrics, and a prometheus agent that scrapes cadvisor locally and remote_writes the samples to a central endpoint. This mirrors the push-only model the asb hosts already use for logs, since the hosts only make outbound connections and cannot be scraped.

Metrics deliberately reuse the Promtail bearer token and the host instance label rather than introducing their own, so the central collector authorizes logs and metrics with the same token and a deployment selects its metrics and logs with the same host query in Grafana. Because of that reuse, enabling metrics without Promtail configured is a hard error rather than a silent unauthenticated push.

binarybaron added 3 commits June 5, 2026 12:52
Adds optional cadvisor + prometheus-agent services to the generated
docker-compose.yml, gated by METRICS_REMOTE_WRITE_URL. cadvisor exposes
per-container cpu/memory/pids/network/fs metrics; the prometheus agent
scrapes it locally and remote_writes to a central endpoint, mirroring the
push-only model the asb hosts already use for logs. The bearer token and
host label are reused from the Promtail config so metrics and logs
authenticate identically and share one Grafana selector.
v0.49.1's docker client speaks API 1.41, which Docker Engine 29 rejects
(min 1.44), so the docker factory fails to register and per-container
series lose their name=/image= labels. Bump to v0.52.1 and add
cgroup: host so the cadvisor container can see the host's docker-*.scope
cgroups under cgroup v2 (without it, scopes enumerate empty).
@binarybaron binarybaron marked this pull request as ready for review June 5, 2026 12:09
@binarybaron binarybaron merged commit eaef114 into master Jun 5, 2026
1 of 71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant