mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-10 06:14:13 +00:00
Merge pull request #407 from BryanQuigley/add_allowlists
enhancement: adding env/container labels options
This commit is contained in:
commit
d38a289ebc
4 changed files with 25 additions and 0 deletions
|
@ -11,6 +11,9 @@ cadvisor_prometheus_endpoint: "/metrics"
|
|||
|
||||
cadvisor_enable_metrics: []
|
||||
cadvisor_disable_metrics: []
|
||||
cadvisor_env_metadata_whitelist: []
|
||||
cadvisor_whitelisted_container_labels: []
|
||||
cadvisor_store_container_labels: true
|
||||
cadvisor_docker_only: false
|
||||
|
||||
cadvisor_binary_install_dir: "/usr/local/bin"
|
||||
|
|
|
@ -64,6 +64,18 @@ argument_specs:
|
|||
default: []
|
||||
type: "list"
|
||||
choices: *metrics_choices
|
||||
cadvisor_store_container_labels:
|
||||
description: "store all container labels"
|
||||
type: "bool"
|
||||
default: true
|
||||
cadvisor_whitelisted_container_labels:
|
||||
description: "comma-separated list of container labels to be used as labels on prometheus metrics"
|
||||
default: []
|
||||
type: "list"
|
||||
cadvisor_env_metadata_whitelist:
|
||||
description: "comma-separated list of env variables to be used as labels on prometheus metrics"
|
||||
default: []
|
||||
type: "list"
|
||||
cadvisor_docker_only:
|
||||
description: "do not report raw cgroup metrics, except the root cgroup"
|
||||
type: "bool"
|
||||
|
|
|
@ -13,3 +13,6 @@ provisioner:
|
|||
- network
|
||||
- cpu
|
||||
cadvisor_docker_only: true
|
||||
whitelisted_container_labels: [ "com.docker.compose.image" ]
|
||||
env_metadata_whitelist: [ "PATH" ]
|
||||
store_container_labels: false
|
||||
|
|
|
@ -18,6 +18,13 @@ ExecStart={{ cadvisor_binary_install_dir }}/cadvisor \
|
|||
{% if cadvisor_docker_only %}
|
||||
'--docker_only={{ cadvisor_docker_only | lower }}' \
|
||||
{% endif -%}
|
||||
{% if cadvisor_whitelisted_container_labels | length > 0 %}
|
||||
'--whitelisted_container_labels={{ cadvisor_whitelisted_container_labels | join(',') }}' \
|
||||
{% endif -%}
|
||||
{% if cadvisor_env_metadata_whitelist | length > 0 %}
|
||||
'--env_metadata_whitelist={{ cadvisor_env_metadata_whitelist | join(',') }}' \
|
||||
{% endif %}
|
||||
'--store_container_labels={{ cadvisor_store_container_labels | lower }}' \
|
||||
'--listen_ip={{ cadvisor_listen_ip }}' \
|
||||
'--port={{ cadvisor_port }}' \
|
||||
'--prometheus_endpoint={{ cadvisor_prometheus_endpoint }}'
|
||||
|
|
Loading…
Reference in a new issue