alloy(role): enable node exporter textfile collector

Enable the node exporter textfile collector, which allows for collecting
custom statistics in a simple way.
https://github.com/prometheus/node_exporter#textfile-collector
This commit is contained in:
June 2026-11-03 02:12:18 +01:00
commit 8c6e55d2bd
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
3 changed files with 16 additions and 2 deletions

View file

@ -50,7 +50,10 @@ alloy_config_default: |
}
prometheus.exporter.unix "local_system" {
enable_collectors = ["systemd"]
enable_collectors = ["systemd", "textfile"]
textfile {
directory = "/var/lib/node_exporter_textfile/"
}
}
prometheus.scrape "scrape_metrics" {

View file

@ -50,7 +50,10 @@ alloy_config_default: |
}
prometheus.exporter.unix "local_system" {
enable_collectors = ["systemd"]
enable_collectors = ["systemd", "textfile"]
textfile {
directory = "/var/lib/node_exporter_textfile/"
}
}
prometheus.scrape "scrape_metrics" {

View file

@ -1,6 +1,14 @@
---
- name: Deploy Grafana Alloy with config
block:
- name: Create directory for node_exporter textfile collector
ansible.builtin.file:
path: /var/lib/node_exporter_textfile
state: directory
mode: "0755"
owner: root
group: root
- name: Install Alloy
ansible.builtin.include_tasks: install.yaml