Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: adding env/container labels options #407

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

BryanQuigley
Copy link
Contributor

Add following

  • cadvisor_env_metadata_whitelist
  • cadvisor_whitelisted_container_labels
  • cadvisor_store_container_labels

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 github-actions bot added enhancement New feature or request roles/cadvisor labels Aug 2, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 2, 2024
Copy link
Contributor

github-actions bot commented Aug 2, 2024

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

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 2, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 13, 2024
@BryanQuigley
Copy link
Contributor Author

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

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 21, 2024
@BryanQuigley
Copy link
Contributor Author

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

cadvisor_store_container_labels:
description: "do not store all container labels"
type: "bool"
default: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be

Suggested change
default: false
default: true

as defined in defaults/main.yml? Or should defaults/main.yml perhaps be set to false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, you are correct. Updating description too

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Aug 21, 2024
@BryanQuigley BryanQuigley requested a review from gardar August 21, 2024 20:35
Copy link
Member

@gardar gardar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@BryanQuigley
Copy link
Contributor Author

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

Add following
- cadvisor_env_metadata_whitelist
- cadvisor_whitelisted_container_labels
- cadvisor_store_container_labels

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: prometheus-community#403
Signed-off-by: Bryan Quigley <code@bryanquigley.com>
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Sep 13, 2024
@gardar
Copy link
Member

gardar commented Sep 13, 2024

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.

@gardar gardar merged commit d38a289 into prometheus-community:main Sep 13, 2024
45 checks passed
@BryanQuigley BryanQuigley deleted the add_allowlists branch September 13, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request roles/cadvisor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cadvisor add --env_metadata_whitelist option
2 participants