prometheus-community / ansible

Ansible Collection for Prometheus
https://prometheus-community.github.io/ansible/
Apache License 2.0
397 stars 134 forks source link

enhancement: adding env/container labels options #407

Closed BryanQuigley closed 2 months ago

BryanQuigley commented 3 months ago

Add following

Tested with this simple playbook:

---
- name: Install cAdvisor
  hosts: localhost
  become: yes
  tasks:
    - name: Import cAdvisor role
      import_role:
        name: cadvisor
      vars:
        cadvisor_docker_only: true
        cadvisor_enable_metrics: [ "cpu", "memory", "network", "oom_event" ]
        cadvisor_whitelisted_container_labels: [ "com.docker.compose.oneoff" ]
        cadvisor_env_metadata_whitelist: [ "JEKYLL_ENV", "PATH" ]
        cadvisor_store_container_labels: false

Also tested dropping the options, which is why I decided to explicitly set store_container_labels: true (which is the cadvisor default).

Closes: #403

github-actions[bot] commented 3 months ago

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and the docs are now incorporated into main: https://prometheus-community.github.io/ansible/branch/main

BryanQuigley commented 3 months ago

The failures seem unrelated to the PR - failing to pull image.

BryanQuigley commented 3 months ago

@gardar are you the right person to review? Thanks!

BryanQuigley commented 2 months ago

Thanks! Just wanted to double check if any other action is needed before merging.

gardar commented 2 months ago

Thanks! Just wanted to double check if any other action is needed before merging.

No sorry, I just needed to fix up the CI config a bit for the tests to pass successfully.