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

promtail: auto-prune stale metrics #1683

Merged
merged 1 commit into from
Feb 12, 2020
Merged

Conversation

slim-bean
Copy link
Collaborator

Fixes #1667

Given the dynamic nature of labels as outlined in that issue, it's possible to create metrics stage configuraitons which could create an unbounded growth of exported metrics.

This change should auto-prune metrics if they have not been used within a configurable time period.

The pruning takes place on the same thread and after Collect is called, this guarantees their last output is reported before pruning.

I debated if this should be done in a separate go routine but we would end up holding the same lock so it didn't seem like it would add much value doing it on a separate thread.

Signed-off-by: Edward Welch [email protected]

…metrics pipeline stage after an idle period.

Signed-off-by: Edward Welch <[email protected]>
Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM

@slim-bean slim-bean merged commit 0202884 into master Feb 12, 2020
@slim-bean slim-bean deleted the auto-prune-promtail-metrics branch February 12, 2020 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Promtail metric vector improvement.
2 participants