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

feat: add retain() to Family to allow metrics filtering #196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

howardjohn
Copy link
Contributor

@howardjohn howardjohn commented Apr 29, 2024

Implementation for #197.

This enables a way to filter metrics by arbitrary logic. The existing remove() function is not suitable for this, as it requires us to know the entire label set we want to remove. The clear() function is not as it clears everything.

A simple doc test is added, as well as a more complex example that uses a custom counter to track the last-access-time and calls retain based on that.

@howardjohn
Copy link
Contributor Author

@mxinden what do you think of this approach?

@howardjohn howardjohn changed the title Prototype of metrics expiry Implement metrics expiry Nov 5, 2024
@howardjohn howardjohn marked this pull request as ready for review November 5, 2024 19:29
@howardjohn howardjohn changed the title Implement metrics expiry feat: add retain() to Family to allow metrics filtering Jan 16, 2025
@howardjohn howardjohn changed the title feat: add retain() to Family to allow metrics filtering feat: add retain() to Family to allow metrics filtering Jan 16, 2025
@howardjohn
Copy link
Contributor Author

Ok I have fixed this up and added documentation. Should be good to go from my perspective.

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.

1 participant