Skip to content

For Registerer interface expose all registered Metrics #1801

@ivankatliarchuk

Description

@ivankatliarchuk

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions