Skip to content

Conversation

@into-the-v0id
Copy link

@into-the-v0id into-the-v0id commented Oct 25, 2025

PR Description

Goal of this PR is to make cAdvisor housekeeping configurable in grafana alloy (see #4685).

cAdvisor handles the configuration of its housekeeping exclusively via flags. See cAdvisor housekeeping docs and cAdvisor source code. The variable in the source code is also global - so we cannot configure this on an alloy config block level. We would need to keep this setting also global in grafana alloy. Following options:

  • global options in alloy config file
  • environment variables
  • pass through flags

I've went with passing through the flags since most grafana alloy users already pass custom flags to alloy and it's less hassle than a new config option in the config files.

The run cli command has now the following flags:

--cadvisor.allow-dynamic-housekeeping            Whether to allow the cadvisor housekeeping interval to be dynamic (default true)
--cadvisor.housekeeping-interval duration        Interval between cadvisor container housekeepings (default 1s)
--cadvisor.max-housekeeping-interval duration    Largest interval to allow between cadvisor container housekeepings (default 1m0s)

I've also made dynamic housekeeping configurable while I'm at it (cAdvisor source code).

The defaults match the defaults of cAdvisor - so this shouldn't be a breaking change.

Which issue(s) this PR fixes

Fixes #4685

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@into-the-v0id into-the-v0id requested a review from a team as a code owner October 25, 2025 11:34
@CLAassistant
Copy link

CLAassistant commented Oct 25, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cAdvisor exporter high CPU usage

2 participants