Skip to content

Commit 647ece2

Browse files
committed
feat: create a variable for node exporter command
Users can override this list to customize collectors. The TLS flag still prepends the --web.config.file entry when tls_cert_exists is true, so that behavior is unchanged. Signed-off-by: dudy <[email protected]>
1 parent 98e1a95 commit 647ece2

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

roles/edpm_telemetry/defaults/main.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,27 @@ edpm_telemetry_image_download_retries: "{{ edpm_download_retries | default(5) }}
4343
# list of tripleo telemetry services to stop during EDPM adoption
4444
edpm_telemetry_old_tripleo_compute_sevices:
4545
- tripleo_ceilometer_agent_compute.service
46+
47+
# Command options for node_exporter. This can be overridden to enable/disable collectors
48+
# Keep this as a list of strings which will be rendered into the container JSON command.
49+
edpm_telemetry_node_exporter_cmd:
50+
- "--web.disable-exporter-metrics"
51+
- "--collector.systemd"
52+
- "--collector.systemd.unit-include=(edpm_.*|ovs.*|openvswitch|virt.*|rsyslog)\\.service"
53+
- "--no-collector.dmi"
54+
- "--no-collector.entropy"
55+
- "--no-collector.thermal_zone"
56+
- "--no-collector.time"
57+
- "--no-collector.timex"
58+
- "--no-collector.uname"
59+
- "--no-collector.stat"
60+
- "--no-collector.hwmon"
61+
- "--no-collector.os"
62+
- "--no-collector.selinux"
63+
- "--no-collector.textfile"
64+
- "--no-collector.powersupplyclass"
65+
- "--no-collector.pressure"
66+
- "--no-collector.rapl"
4667
# Instruction for distribution of container health check scripts
4768
edpm_telemetry_healthcheck_sources:
4869
ceilometer_agent_compute: ceilometer_agent

roles/edpm_telemetry/templates/node_exporter.json.j2

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,11 @@
77
"ports": ["9100:9100"],
88
"command": [
99
{% if tls_cert_exists|bool %}
10-
"--web.config.file=/etc/node_exporter/node_exporter.yaml",
10+
"--web.config.file=/etc/node_exporter/node_exporter.yaml",
1111
{% endif %}
12-
"--web.disable-exporter-metrics",
13-
"--collector.systemd",
14-
"--collector.systemd.unit-include=(edpm_.*|ovs.*|openvswitch|virt.*|rsyslog)\\.service",
15-
"--no-collector.dmi",
16-
"--no-collector.entropy",
17-
"--no-collector.thermal_zone",
18-
"--no-collector.time",
19-
"--no-collector.timex",
20-
"--no-collector.uname",
21-
"--no-collector.stat",
22-
"--no-collector.hwmon",
23-
"--no-collector.os",
24-
"--no-collector.selinux",
25-
"--no-collector.textfile",
26-
"--no-collector.powersupplyclass",
27-
"--no-collector.pressure",
28-
"--no-collector.rapl"
12+
{% for arg in edpm_telemetry_node_exporter_cmd %}
13+
{{ arg | to_json }}{% if not loop.last %},{% endif %}
14+
{% endfor %}
2915
],
3016
"net": "host",
3117
"environment": {

0 commit comments

Comments
 (0)