-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
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
- Document metrics exported by Thanos' components thanos-io/thanos#5758
- 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