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

Ability to access empty MetricFamilies in Registry #526

Open
sergiimk opened this issue Sep 13, 2024 · 0 comments
Open

Ability to access empty MetricFamilies in Registry #526

sergiimk opened this issue Sep 13, 2024 · 0 comments

Comments

@sergiimk
Copy link

Is your feature request related to a problem? Please describe.

I want to generate a Markdown file that documents all metrics my application emits. Registry already contains everything I need: metrics names, types, descriptions, labels.

However, the only way to access this information is Registry::gather() method, and gather() currently will filter out empty MetricFamilies.

This filtering is fine when dumping metrics values, but when generating documentation before any values were written - the labelled metrics (e.g. GaugeVec) are skipped and I cannot access their information.

Describe the solution you'd like

  • Add Registry::all_registered() method that doesn't filter

Describe alternatives you've considered
I'm considering to add a wrapper trait on top of Registry that will allow me to gather all metrics from subsystems of mine. This approach however will not work with any external libraries that won't have this trait.

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