From 9f9bd6830fb30dce594eed3672c6e8dd186474d0 Mon Sep 17 00:00:00 2001 From: jmills Date: Wed, 26 Jul 2023 06:26:04 -0700 Subject: [PATCH] Fix: systemd_exporter - rename collector flags (#167) * Fix systemd_exporter vars to match the exporter flags --------- Signed-off-by: Jeremy Miller Signed-off-by: prombot Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: prombot Co-authored-by: SuperQ --- roles/systemd_exporter/defaults/main.yml | 4 ++-- roles/systemd_exporter/meta/argument_specs.yml | 8 ++++---- .../templates/systemd_exporter.service.j2 | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/roles/systemd_exporter/defaults/main.yml b/roles/systemd_exporter/defaults/main.yml index 3c44820a..955737f7 100644 --- a/roles/systemd_exporter/defaults/main.yml +++ b/roles/systemd_exporter/defaults/main.yml @@ -11,8 +11,8 @@ systemd_exporter_enable_restart_count: false systemd_exporter_enable_ip_accounting: false systemd_exporter_enable_file_descriptor_size: false -systemd_exporter_unit_whitelist: "" -systemd_exporter_unit_blacklist: "" +systemd_exporter_unit_include: "" +systemd_exporter_unit_exclude: "" systemd_exporter_binary_install_dir: "/usr/local/bin" systemd_exporter_system_group: "systemd-exporter" diff --git a/roles/systemd_exporter/meta/argument_specs.yml b/roles/systemd_exporter/meta/argument_specs.yml index 1bf6c4c8..2f89f3aa 100644 --- a/roles/systemd_exporter/meta/argument_specs.yml +++ b/roles/systemd_exporter/meta/argument_specs.yml @@ -41,10 +41,10 @@ argument_specs: description: Enables file descriptor size metrics. This feature will cause exporter to run as root as it needs access to /proc/X/fd" type: "bool" default: false - systemd_exporter_unit_allowlist: - description: "Include some systemd units. Expects a regex. More in L(https://github.com/prometheus-community/systemd_exporter#configuration)" - systemd_exporter_unit_denylist: - description: "Exclude some systemd units. Expects a regex. More in L(https://github.com/prometheus-community/systemd_exporter#configuration)" + systemd_exporter_unit_include: + description: "Include some systemd units. Expects a regex. More in L(systemd_exporter docs,https://github.com/prometheus-community/systemd_exporter#configuration)." + systemd_exporter_unit_exclude: + description: "Exclude some systemd units. Expects a regex. More in L(systemd_exporter docs,https://github.com/prometheus-community/systemd_exporter#configuration)." systemd_exporter_binary_install_dir: description: - "I(Advanced)" diff --git a/roles/systemd_exporter/templates/systemd_exporter.service.j2 b/roles/systemd_exporter/templates/systemd_exporter.service.j2 index 31c0900c..2cb7e588 100644 --- a/roles/systemd_exporter/templates/systemd_exporter.service.j2 +++ b/roles/systemd_exporter/templates/systemd_exporter.service.j2 @@ -10,19 +10,19 @@ User={{ systemd_exporter_system_user }} Group={{ systemd_exporter_system_group }} ExecStart={{ systemd_exporter_binary_install_dir }}/systemd_exporter \ {% if systemd_exporter_enable_restart_count %} - --collector.enable-restart-count \ + --systemd.collector.enable-restart-count \ {% endif %} {% if systemd_exporter_enable_file_descriptor_size %} - --collector.enable-file-descriptor-size \ + --systemd.collector.enable-file-descriptor-size \ {% endif %} {% if systemd_exporter_enable_ip_accounting %} - --collector.enable-ip-accounting \ + --systemd.collector.enable-ip-accounting \ {% endif %} -{% if systemd_exporter_unit_whitelist != ""%} - --collector.unit-whitelist={{ systemd_exporter_unit_whitelist }} \ +{% if systemd_exporter_unit_include != ""%} + --systemd.collector.unit-include={{ systemd_exporter_unit_include }} \ {% endif %} -{% if systemd_exporter_unit_blacklist != "" %} - --collector.unit-blacklist={{ systemd_exporter_unit_blacklist }} \ +{% if systemd_exporter_unit_exclude != "" %} + --systemd.collector.unit-exclude={{ systemd_exporter_unit_exclude }} \ {% endif %} --web.listen-address={{ systemd_exporter_web_listen_address }}