Skip to content

For Registerer interface expose all registered Metrics #1801

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

Open
ivankatliarchuk opened this issue Apr 17, 2025 · 0 comments
Open

For Registerer interface expose all registered Metrics #1801

ivankatliarchuk opened this issue Apr 17, 2025 · 0 comments

Comments

@ivankatliarchuk
Copy link

ivankatliarchuk commented Apr 17, 2025

Providing users with a clear understanding of available metrics is currently a significant challenge. The only way to discover them is by running a service and scraping, which is not ideal for usability. As open-source maintainers, we often get asked about our exposed metrics.

Although we have an automated documentation system that updates upon metric addition (e.g., https://kubernetes-sigs.github.io/external-dns/latest/docs/monitoring/metrics/#supported-metrics, leveraging our wrapper at https://github.com/kubernetes-sigs/external-dns/blob/09ec020d6f3fe0a5fae0a1b693fb31e2f3e377a2/pkg/metrics/metrics.go#L55), and our providers (like AWS, GCP, Cloudflare - see AWS example: aws/aws-sdk-go-v2#2810) do expose metrics, we're struggling to automatically include this in our documentation.

Attempts using reflection have proven overly complex.

Example for the same challange

  1. Document metrics exported by Thanos' components thanos-io/thanos#5758
  2. docs: Add auto-generated page for current metrics Prometheus exposes about itself. prometheus#12397

There was an effort to implement #890

I do not think, it should generate any markdown, instead return a collection of all registered metrics.

Benefits

  • automated documentation
  • some help to unit tests as well aka metrics registered or not
@ivankatliarchuk ivankatliarchuk changed the title For Registerer interface expose all registered Metrics and Traces For Registerer interface expose all registered Metrics Apr 17, 2025
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