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(metrics/family): 🍬 contains() checks if metrics exist #245

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

Conversation

cratelyn
Copy link
Contributor

this commit introduces a small accessor to the Family<S, M, C> metric family type. this new contains() method allows callers to check whether or not a metric with the provided set of labels exists.

if no metric has been created via e.g. get_or_create(), this method will return false.

this commit introduces a small accessor to the `Family<S, M, C>` metric
family type. this new `contains()` method allows callers to check
whether or not a metric with the provided set of labels exists.

if no metric has been created via e.g. `get_or_create()`, this method
will return `false`.

Signed-off-by: katelyn martin <[email protected]>
cratelyn added a commit to cratelyn/prometheus-client that referenced this pull request Nov 18, 2024
this commit introduces a `len()` method to `Family<S, M, C>`, which
returns the number of series within a metric family.

see also prometheus#245, which allows callers to check if a family `contains()` a
given label set.

Signed-off-by: katelyn martin <[email protected]>
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