Просмотр исходного кода

Add support for passing extra arguments to prometheus-node-exporter

pull/1895/head
Slavi Pantaleev 3 лет назад
Родитель
Сommit
37d7e75e9b
2 измененных файлов: 13 добавлений и 1 удалений
  1. +12
    -0
      roles/matrix-prometheus-node-exporter/defaults/main.yml
  2. +1
    -1
      roles/matrix-prometheus-node-exporter/templates/systemd/matrix-prometheus-node-exporter.service.j2

+ 12
- 0
roles/matrix-prometheus-node-exporter/defaults/main.yml Просмотреть файл

@@ -11,6 +11,18 @@ matrix_prometheus_node_exporter_docker_image_force_pull: "{{ matrix_prometheus_n
# A list of extra arguments to pass to the container # A list of extra arguments to pass to the container
matrix_prometheus_node_exporter_container_extra_arguments: [] matrix_prometheus_node_exporter_container_extra_arguments: []


# A list of extra arguments to pass to the node_exporter process
#
# Example:
# matrix_prometheus_node_exporter_process_extra_arguments:
# - "--collector.systemd"
# - "--collector.logind"
#
# Note: the above is just an example. We have not confirmed that these collectors work when running in a container.
# In fact, the systemd collector is exhibiting issues:
# > caller=collector.go:169 level=error msg="collector failed" name=systemd duration_seconds=0.000121001 err="couldn't get dbus connection: dial unix /var/run/dbus/system_bus_socket: connect: no such file or directory"
matrix_prometheus_node_exporter_process_extra_arguments: []

# List of systemd services that matrix-prometheus.service depends on # List of systemd services that matrix-prometheus.service depends on
matrix_prometheus_node_exporter_systemd_required_services_list: ['docker.service'] matrix_prometheus_node_exporter_systemd_required_services_list: ['docker.service']




+ 1
- 1
roles/matrix-prometheus-node-exporter/templates/systemd/matrix-prometheus-node-exporter.service.j2 Просмотреть файл

@@ -32,7 +32,7 @@ ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-prometheus-nod
--pid=host \ --pid=host \
--mount type=bind,src=/,dst=/host,ro,bind-propagation=rslave \ --mount type=bind,src=/,dst=/host,ro,bind-propagation=rslave \
{{ matrix_prometheus_node_exporter_docker_image }} \ {{ matrix_prometheus_node_exporter_docker_image }} \
--path.rootfs=/host
--path.rootfs=/host {{ matrix_prometheus_node_exporter_process_extra_arguments|join(' ') }}


ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-prometheus-node-exporter 2>/dev/null || true' ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-prometheus-node-exporter 2>/dev/null || true'
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-prometheus-node-exporter 2>/dev/null || true' ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-prometheus-node-exporter 2>/dev/null || true'


Загрузка…
Отмена
Сохранить