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:
parent
6a87ba0562
commit
8c6e55d2bd
3 changed files with 16 additions and 2 deletions
|
|
@ -50,7 +50,10 @@ alloy_config_default: |
|
||||||
}
|
}
|
||||||
|
|
||||||
prometheus.exporter.unix "local_system" {
|
prometheus.exporter.unix "local_system" {
|
||||||
enable_collectors = ["systemd"]
|
enable_collectors = ["systemd", "textfile"]
|
||||||
|
textfile {
|
||||||
|
directory = "/var/lib/node_exporter_textfile/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prometheus.scrape "scrape_metrics" {
|
prometheus.scrape "scrape_metrics" {
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,10 @@ alloy_config_default: |
|
||||||
}
|
}
|
||||||
|
|
||||||
prometheus.exporter.unix "local_system" {
|
prometheus.exporter.unix "local_system" {
|
||||||
enable_collectors = ["systemd"]
|
enable_collectors = ["systemd", "textfile"]
|
||||||
|
textfile {
|
||||||
|
directory = "/var/lib/node_exporter_textfile/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prometheus.scrape "scrape_metrics" {
|
prometheus.scrape "scrape_metrics" {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,14 @@
|
||||||
---
|
---
|
||||||
- name: Deploy Grafana Alloy with config
|
- name: Deploy Grafana Alloy with config
|
||||||
block:
|
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
|
- name: Install Alloy
|
||||||
ansible.builtin.include_tasks: install.yaml
|
ansible.builtin.include_tasks: install.yaml
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue