Différentes méthodes d'installation sont disponibles sur la documentation officielle Grafana.
Ici on s'appuie sur l' ajout du dépôt APT de Grafana.
Une fois le dépôt ajouté, on peut installer l'application :
apt install -y alloy
A l'installation le service systemd a été créé mais ne s'exécute pas. Il faut l'activer :
systemctl enable alloy.service
systemctl start alloy.service
temporiser le lancement du service.
Exemple de traces produites :
Sep 11 09:55:58 debian13 alloy[822]: ts=2026-09-11T07:55:58.603243397Z level=error msg="failed to listen on 192.168.123.138:12345" service=http err="listen tcp 192.168.123.138:12345: bind: cannot assign requested address" Sep 11 09:55:59 debian13 alloy[1124]: ts=2026-09-11T07:55:59.068231024Z level=error msg="failed to listen on 192.168.123.138:12345" service=http err="listen tcp 192.168.123.138:12345: bind: cannot assign requested address" Sep 11 09:55:59 debian13 alloy[1184]: ts=2026-09-11T07:55:59.564851052Z level=error msg="failed to listen on 192.168.123.138:12345" service=http err="listen tcp 192.168.123.138:12345: bind: cannot assign requested address" Sep 11 09:56:00 debian13 alloy[1225]: ts=2026-09-11T07:56:00.057902683Z level=error msg="failed to listen on 192.168.123.138:12345" service=http err="listen tcp 192.168.123.138:12345: bind: cannot assign requested address" Sep 11 09:56:00 debian13 alloy[1241]: ts=2026-09-11T07:56:00.517241749Z level=error msg="failed to listen on 192.168.123.138:12345" service=http err="listen tcp 192.168.123.138:12345: bind: cannot assign requested address"
NB : différence entre le niveau de log de journald (6 = info) et le niveau de log du message (level=error) :
Fri 2026-09-11 09:55:58.603311 CEST [s=27e0a4a61bf14819841aef5380286916;i=51d;b=45dd826a0a754889acc7ad9a6f424189;m=4bd15b;t=65b306a33d42f;x=c888bf97e6fbcd7c]
_BOOT_ID=45dd826a0a754889acc7ad9a6f424189
_MACHINE_ID=5df4553610a245108e232a3849f6cf67
_HOSTNAME=debian13
_RUNTIME_SCOPE=system
PRIORITY=6
SYSLOG_FACILITY=3
_SELINUX_CONTEXT=unconfined
_SYSTEMD_SLICE=system.slice
_TRANSPORT=stdout
_CAP_EFFECTIVE=0
_STREAM_ID=c80027a1291647409ce772b009b03eb6
SYSLOG_IDENTIFIER=alloy
_PID=822
_UID=999
_GID=989
_COMM=alloy
_EXE=/usr/bin/alloy
_CMDLINE=/usr/bin/alloy run --server.http.listen-addr=192.168.123.138:12345 --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy
_SYSTEMD_CGROUP=/system.slice/alloy.service
_SYSTEMD_UNIT=alloy.service
_SYSTEMD_INVOCATION_ID=e9a2d18b866945c4b5dfee4624d2fd52
MESSAGE=ts=2026-09-11T07:55:58.603243397Z level=error msg="failed to listen on 192.168.123.138:12345" service=http err="listen tcp 192.168.123.138:12345: bind: cannot assign requested address"
Par défaut, Alloy dispose d'une console web écoutant sur la boucle locale. Il est possible de la rendre ponctuellement disponible sur le réseau en modifiant la variable CUSTOM_ARGS du fichier /etc/default/alloy :
## Path: ## Description: Grafana Alloy settings ## Type: string ## Default: "" ## ServiceRestart: alloy # # Command line options for Alloy. # # The configuration file holding the Alloy config. CONFIG_FILE="/etc/alloy/config.alloy" # User-defined arguments to pass to the run command. CUSTOM_ARGS="--server.http.listen-addr=192.168.123.138:12345" # Restart on system upgrade. Defaults to true. RESTART_ON_UPGRADE=true
Fichier de configuration :
wget -q -O config.alloy https://github.com/grafana/alloy-scenarios/raw/refs/heads/main/linux/config.alloy
Les principaux éléments du fichier de configuration :
// ;clé = valeur ;Après modification du fichier de configuration, vérifier la syntaxe via la commande :
alloy validate /etc/alloy/config.alloy
Définir un filtre pour limiter les métriques
systemctl stop alloy.service /usr/bin/alloy run --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy /usr/bin/alloy run --storage.path=/var/lib/alloy/data /etc/alloy/config.alloy