INNER CODE UNIT · Go

labels

projectcontour/contour · hack/generate-metrics-doc.go:31

func labels(mf *dto.MetricFamily) string {
	var l []string

	for _, m := range mf.GetMetric() {
		for _, pair := range m.GetLabel() {
			l = append(l, pair.GetName())
		}
	}

	return strings.Join(l, ", ")
}

// Generate a string name for the metric type, linking to the
// Prometheus docs if we know there is a suitable target.
func typeof(mf *dto.MetricFamily) string {
	switch t := mf.GetType(); t {
	case dto.MetricType_COUNTER, dto.MetricType_GAUGE,
		dto.MetricType_SUMMARY, dto.MetricType_HISTOGRAM:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…