Files
..
2026-10-01 09:50:27 +02:00
2026-10-01 09:50:27 +02:00
2026-10-01 09:50:27 +02:00
2026-10-01 09:50:27 +02:00
2026-08-04 16:42:40 +02:00
2026-10-01 09:50:27 +02:00
2026-10-01 09:50:27 +02:00
2026-10-01 09:50:27 +02:00
2026-06-22 10:42:36 +02:00
2026-10-01 09:50:27 +02:00
2026-10-01 09:50:27 +02:00
2026-08-01 22:01:43 +02:00
2025-10-02 16:12:08 +02:00
2026-10-01 09:50:27 +02:00
2026-10-01 09:50:27 +02:00
2026-07-31 14:02:41 +02:00
2026-07-31 14:02:41 +02:00
2026-10-01 09:50:27 +02:00
2026-06-17 14:51:52 +02:00
2026-06-17 14:51:52 +02:00
2026-10-01 09:50:27 +02:00
2026-10-01 09:50:27 +02:00
2026-08-06 17:16:54 +02:00
2026-10-01 09:50:27 +02:00
2026-10-01 09:50:27 +02:00
2026-10-01 09:50:27 +02:00

package telemetry

import (
	"github.com/foomo/keel/markdown"
	"github.com/prometheus/client_golang/prometheus"
)

// Readme returns a markdown table of all metrics gathered from the default
// Prometheus gatherer, or an empty string if there are none.
//
// Deprecated: Readme has no replacement.
func Readme() string {
	md := markdown.Markdown{}

	var rows [][]string

	if gatherer, err := prometheus.DefaultGatherer.Gather(); err == nil {
		for _, value := range gatherer {
			rows = append(rows, []string{
				markdown.Code(value.GetName()),
				value.GetType().String(),
				value.GetHelp(),
			})
		}
	}

	if len(rows) > 0 {
		md.Println("### Metrics")
		md.Println("")
		md.Println("List of all registered metrics than are being exposed.")
		md.Println("")
		md.Table([]string{"Name", "Type", "Description"}, rows)
		md.Println("")
	}

	return md.String()
}