Hi,
Try this:
1. Create small container: 1 CPU, 256 MB RAM
2. Install alloy in it.
3. In the PVE host console run:
Code:
#!/bin/bash
container=<put-your-container-name-here>
pct set $container -mp0 /,mp=/host/rootfs,ro=1
pct set $container -mp1 /proc,mp=/host/proc,ro=1
pct set $container -mp2 /sys,mp=/host/sys,ro=1
pct set $container -mp3 /run/udev/data,mp=/host/run/udev/data,ro=1
4. Restart container
5. Configure alloy in container:
Code:
//config.alloy example
// journald
loki.source.journal "journal" {
forward_to = [loki.write.default.receiver]
relabel_rules = loki.relabel.journal.rules
max_age = "12h"
path = "/host/rootfs/var/log/journal"
labels = {
job = "systemd-journal",
host = "pve",
}
}
prometheus.exporter.unix "pve" {
// Disable unnecessary collectors to reduce overhead
disable_collectors = ["ipvs", "infiniband", "xfs", "btrfs"]
rootfs_path = "/host/rootfs"
procfs_path = "/host/proc"
sysfs_path = "/host/sys"
udev_data_path = "/host/run/udev/data"
...
}
6. In container, execute: systemctl start alloy
7. Having rootfs mounted inside the container isn't safe even it's read only.
Good luck.

























