BREAKING CHANGES: replace promtail and cadvisor for alloy #21

Open
fauno wants to merge 59 commits from alloy into main
Owner

closes #20

closes #20
fauno added 1 commit 2026-05-28 23:34:12 +00:00
fauno added 1 commit 2026-05-28 23:39:01 +00:00
fauno added 1 commit 2026-05-28 23:44:16 +00:00
fauno added 1 commit 2026-05-29 00:00:25 +00:00
Author
Owner

doing good progress but abyaya.la doesn't support two levels of subdomains yet so i can't keep testing! will continue soon

doing good progress but abyaya.la doesn't support two levels of subdomains yet so i can't keep testing! will continue soon
Author
Owner

TODO: reset the CONFIG_ALLOY_VERSION back to v1 before merging

TODO: reset the `CONFIG_ALLOY_VERSION` back to `v1` before merging
Owner

Thanks for this work! I also hope to do some testing with this soon.

Thanks for this work! I also hope to do some testing with this soon.
fauno added 1 commit 2026-05-29 18:41:21 +00:00
fauno added 2 commits 2026-05-29 19:04:28 +00:00
fauno added 1 commit 2026-05-29 19:16:14 +00:00
fauno added 2 commits 2026-06-02 16:24:50 +00:00
fauno added 2 commits 2026-06-02 21:01:07 +00:00
the variable is not expanded and the domain name label ends up as a
literal "$DOMAIN".
fauno added 8 commits 2026-06-02 21:50:56 +00:00
fauno added 1 commit 2026-06-02 21:51:19 +00:00
fauno added 2 commits 2026-06-02 23:19:51 +00:00
fauno added 1 commit 2026-06-03 00:00:54 +00:00
fauno added 2 commits 2026-06-03 00:06:21 +00:00
fauno added 1 commit 2026-06-03 03:19:53 +00:00
fauno added 9 commits 2026-06-17 12:53:11 +00:00
- Restrict Alloy UI to loopback
- Narrow volume mounts: drop /dev, reduce /var/run to docker.sock:ro
- Replace HTTP scrape of :12345 with prometheus.exporter.self
Match with main branch (node-exporter / promtail / cadvisor):
- Add docker_only and explicit enabled_metrics to cadvisor exporter
- Match node-exporter collector config
- Match promtail relabeling (container_name, container_id, stack_namespace,
  service_name) and external hostname label
- Add SYSLOG_FILES option to tail /var/log/*log (matches promtail)
- Fix journal path and syslog listener address
Containers opt in with prometheus.io/scrape=true and optionally set
prometheus.io/port, prometheus.io/path, and prometheus.io/auth=basic.
Reviewed-on: #24
Reviewed-by: fauno <fauno@sutty.coop.ar>
Author
Owner

i've been deploying this mainly for prometheus metrics and it's working great. i still have to test log ingestion. i'll need help with fixing the included grafana dashboards!

i've been deploying this mainly for prometheus metrics and it's working great. i still have to test log ingestion. i'll need help with fixing the included grafana dashboards!
fauno added 1 commit 2026-06-21 02:59:29 +00:00
fauno added 5 commits 2026-06-28 23:44:45 +00:00
Author
Owner

TODOs:

  • update documentation
  • implement metrics on recipes
  • set instance label as hostname, now it's docker's internal ip address
  • fix included grafana dashboards
    • node_name was set statically on node-exporter and missing from alloy
TODOs: - [ ] update documentation - [ ] implement metrics on recipes - [ ] set `instance` label as hostname, now it's docker's internal ip address - [ ] fix included grafana dashboards - [ ] `node_name` was set statically on `node-exporter` and missing from `alloy`
Author
Owner
  • grafana-stacks-dashboard.json hardcodes the cadvisor.monitoring subdomain a lot to filter by instance, removing it from the dashboard makes the graphs i tried work again, but it breaks filtering by instance
- [ ] `grafana-stacks-dashboard.json` hardcodes the `cadvisor.monitoring` subdomain a lot to filter by instance, removing it from the dashboard makes the graphs i tried work again, but it breaks filtering by instance
Member

i checked with @p4u1 today. this is what we found out:

set instance label as hostname, now it's docker's internal ip address

in our test today this was the app domain instead

also we figured the containerd socket path needs to be included in the volumes section of the alloy service:

    volumes:
      # ...
      - /run/containerd/containerd.sock:/run/containerd/containerd.sock:ro

otherwise no containers/services are found.

i checked with @p4u1 today. this is what we found out: > set instance label as hostname, now it's docker's internal ip address in our test today this was the app domain instead also we figured the containerd socket path needs to be included in the volumes section of the alloy service: ``` volumes: # ... - /run/containerd/containerd.sock:/run/containerd/containerd.sock:ro ``` otherwise no containers/services are found.
Author
Owner

thanks @dede ! on an alpine 3.21 server this socket seems to be located at /var/run/docker/containerd/containerd.sock while in ubuntu server 24.04 it's at /var/run/containerd/containerd.sock, maybe the location changes by distribution? or they're not the same socket?

i could do something like this i think:

volumes:
- "${CONTAINERD_SOCKET:-/var/run/containerd/containerd.sock}:/var/run/containerd/containerd.sock:ro"
thanks @dede ! on an alpine 3.21 server this socket seems to be located at `/var/run/docker/containerd/containerd.sock` while in ubuntu server 24.04 it's at `/var/run/containerd/containerd.sock`, maybe the location changes by distribution? or they're not the same socket? i could do something like this i think: ```yaml volumes: - "${CONTAINERD_SOCKET:-/var/run/containerd/containerd.sock}:/var/run/containerd/containerd.sock:ro" ```
fauno added 1 commit 2026-07-31 16:58:10 +00:00
fauno added 1 commit 2026-08-04 13:49:04 +00:00
fauno added 1 commit 2026-08-06 15:37:41 +00:00
fauno added 1 commit 2026-08-07 12:25:07 +00:00
dannygroenewegen added 1 commit 2026-08-07 12:48:41 +00:00
- Start documenting the migration in release/next
- Various cleanups
dannygroenewegen added 2 commits 2026-08-07 13:52:57 +00:00
Added an optional scrape_auth secret for authenticating scrapes of
containers that opt in via prometheus.io/auth labels, no longer
reusing the basic_auth secret meant for Prometheus/Loki writes.

Made usernames for both write endpoints and authenticated scraping
configurable in .env.
prometheus.exporter.cadvisor.docker.targets already reports resource
metrics for every container on the host. The unfiltered discovery just
added targets with internal overlay IPs, most of which failed to
scrape anything useful.
dannygroenewegen force-pushed alloy from ccff913b5d to 0f989c4567 2026-08-07 13:52:57 +00:00 Compare
dannygroenewegen added 1 commit 2026-08-07 15:02:37 +00:00
Replace node_meta-based joins with label_replace() of the instance
label, so old (pull-model) and new (Alloy push) series for the same
host render as one continuous series. Each rewritten query has a TODO
noting the simpler form to use once old data ages out of retention.
dannygroenewegen added 1 commit 2026-08-10 19:25:43 +00:00
Swarm service discovery misses dnsrr-mode services like traefik; switch
to swarm task discovery, scoped to this host, with a stable instance
label across redeploys and a default port when none is labeled.
Owner

Created a PR for Traefik to add metric discovery labels. Will work on updating the README and short migration guide for the release notes this week. Almost ready!

Created a [PR for Traefik](https://git.coopcloud.tech/coop-cloud/traefik/pulls/132) to add metric discovery labels. Will work on updating the README and short migration guide for the release notes this week. Almost ready!
dannygroenewegen added 1 commit 2026-08-17 11:38:28 +00:00
dannygroenewegen added 4 commits 2026-08-17 13:58:32 +00:00
dannygroenewegen added 1 commit 2026-08-17 14:10:26 +00:00
Owner

I think all open todos are resolved. Also updated the readme and added a migration guide to the release notes.
Anyone up for testing?

TODO: reset the CONFIG_ALLOY_VERSION back to v1 before merging

This still needs to be done before merging. And probably a squash commit for merging; don't think we need this whole kinda messy history?

I think all open todos are resolved. Also updated the readme and added a migration guide to the release notes. Anyone up for testing? > TODO: reset the `CONFIG_ALLOY_VERSION` back to `v1` before merging This still needs to be done before merging. And probably a squash commit for merging; don't think we need this whole kinda messy history?
dannygroenewegen requested review from monitoring-ng-maintainers 2026-08-17 14:21:08 +00:00
dannygroenewegen marked the pull request as ready for review 2026-08-17 14:22:11 +00:00
Owner

did a test deploy and looks like alloy works!image.png

did a test deploy and looks like alloy works!![image.png](/attachments/d52523e4-21e7-4509-bd29-62ecdb9fc586)
Owner

did a test deploy and looks like alloy works!image.png

did a test deploy and looks like alloy works!![image.png](/attachments/d52523e4-21e7-4509-bd29-62ecdb9fc586)
108 KiB
Owner

new readme is a lot more clean!

new readme is a lot more clean!
dannygroenewegen added 1 commit 2026-08-20 13:26:33 +00:00
dannygroenewegen added 1 commit 2026-08-20 14:50:49 +00:00
Member

Hey folks, thanks for the amazing work!

This:

- "traefik.http.routers.${STACK_NAME}-grafana.rule=Host(`${GRAFANA_DOMAIN:-$DOMAIN}`)"

didn't work for me, needed to explicitly set the env as the nested replacement didn't work.

From docker service inspect:
traefik.http.routers.monitoring_kolli_cloud-grafana.rule=Host($DOMAIN)

Hey folks, thanks for the amazing work! This: https://git.coopcloud.tech/coop-cloud/monitoring-ng/src/commit/382f6353fc802abbddee19e571a6d2556c65371c/compose.grafana.yml#L42 didn't work for me, needed to explicitly set the env as the nested replacement didn't work. From docker service inspect: `traefik.http.routers.monitoring_kolli_cloud-grafana.rule=Host(`$DOMAIN`)`
Member

I guess we could also remove this. I've seen your discussion in matrix about it:

- name: 'default-alert-provider'
orgId: 1
folder: 'default-alerts'
type: file
disableDeletion: false
updateIntervalSeconds: 10
allowUiUpdates: true
options:
path: /var/lib/grafana/alerts
foldersFromFilesStructure: true

By default, that folder doesn't exist, resulting in continues errors:
2026-08-21T14:59:53.360890994Z logger=provisioning.dashboard type=file name=default-alert-provider t=2026-08-21T14:59:53.360693215Z level=error msg="failed to walk provisioned dashboards" error="stat /var/lib/grafana/alerts: no such file or directory"

And from my knowledge its never used anywhere anyway. Looks like @p4u1 added it 2 years ago, maybe he knows more? 0352a393de (diff-338a7a8dc1f47ef86aa7fe511610bc988be2e70c)

I guess we could also remove this. I've seen your discussion in matrix about it: https://git.coopcloud.tech/coop-cloud/monitoring-ng/src/commit/02b01e5c236e963ccdcfc422c3c099c6bbf41e8e/grafana-dashboards.yml#L14-L23 By default, that folder doesn't exist, resulting in continues errors: `2026-08-21T14:59:53.360890994Z logger=provisioning.dashboard type=file name=default-alert-provider t=2026-08-21T14:59:53.360693215Z level=error msg="failed to walk provisioned dashboards" error="stat /var/lib/grafana/alerts: no such file or directory"` And from my knowledge its never used anywhere anyway. Looks like @p4u1 added it 2 years ago, maybe he knows more? https://git.coopcloud.tech/coop-cloud/monitoring-ng/commit/0352a393de77d58c8462a69cf805f5cc7e3c8156#diff-338a7a8dc1f47ef86aa7fe511610bc988be2e70c
Owner

I guess we could also remove this. I've seen your discussion in matrix about it:

- name: 'default-alert-provider'
orgId: 1
folder: 'default-alerts'
type: file
disableDeletion: false
updateIntervalSeconds: 10
allowUiUpdates: true
options:
path: /var/lib/grafana/alerts
foldersFromFilesStructure: true

By default, that folder doesn't exist, resulting in continues errors:
2026-08-21T14:59:53.360890994Z logger=provisioning.dashboard type=file name=default-alert-provider t=2026-08-21T14:59:53.360693215Z level=error msg="failed to walk provisioned dashboards" error="stat /var/lib/grafana/alerts: no such file or directory"

And from my knowledge its never used anywhere anyway. Looks like @p4u1 added it 2 years ago, maybe he knows more? 0352a393de (diff-338a7a8dc1f47ef86aa7fe511610bc988be2e70c)

Yeah, this can be removed. Alerts are now configured like this: 02b01e5c23/alerts/node.yml.tmpl

> I guess we could also remove this. I've seen your discussion in matrix about it: > > https://git.coopcloud.tech/coop-cloud/monitoring-ng/src/commit/02b01e5c236e963ccdcfc422c3c099c6bbf41e8e/grafana-dashboards.yml#L14-L23 > > By default, that folder doesn't exist, resulting in continues errors: > `2026-08-21T14:59:53.360890994Z logger=provisioning.dashboard type=file name=default-alert-provider t=2026-08-21T14:59:53.360693215Z level=error msg="failed to walk provisioned dashboards" error="stat /var/lib/grafana/alerts: no such file or directory"` > > And from my knowledge its never used anywhere anyway. Looks like @p4u1 added it 2 years ago, maybe he knows more? https://git.coopcloud.tech/coop-cloud/monitoring-ng/commit/0352a393de77d58c8462a69cf805f5cc7e3c8156#diff-338a7a8dc1f47ef86aa7fe511610bc988be2e70c Yeah, this can be removed. Alerts are now configured like this: https://git.coopcloud.tech/coop-cloud/monitoring-ng/src/commit/02b01e5c236e963ccdcfc422c3c099c6bbf41e8e/alerts/node.yml.tmpl
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin alloy:alloy
git checkout alloy
Sign in to join this conversation.
No Reviewers
coop-cloud/monitoring-ng-maintainers
No labels
6 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: coop-cloud/monitoring-ng#21