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

Access the list of registered uninitialised metrics. #1636

Open
arjunbakshi245 opened this issue Oct 3, 2024 · 1 comment
Open

Access the list of registered uninitialised metrics. #1636

arjunbakshi245 opened this issue Oct 3, 2024 · 1 comment

Comments

@arjunbakshi245
Copy link

arjunbakshi245 commented Oct 3, 2024

I am using the gather function to get all the metrics registered.
I see that uninitialised metrics that do NOT have any labels are seen on the gather() output with default values. However, uninitialised metrics with label values are not seen on the gather() output. Possibly due to prometheus not knowing what to put in place of these label values. This breaks the uniformity of gather output based on existence of labels. If labels exist I can't list out all the metrics I have(irrespective of initialisation).
Not sure if I am missing a way to get all the metric names registered in a registry through some other way, but I think there must be support to populate the default values for the labeled metrics as well. These can be deleted automatically once the metric is set at least once WithLabelValues(). That way the gather can be used to see what all metrics exist. Is the same exists for unlabelled metrics, it could be helpful for labeled metrics as well.

@arjunbakshi245
Copy link
Author

@bwplotka ^^

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

No branches or pull requests

1 participant