diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-08-18 13:53:49 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-08-18 13:53:49 +0200 |
| commit | 30c7511808333b56fb2ebed64a931d89a002e1c1 (patch) | |
| tree | 52230d3b6bb59b3a16574cac5270d5c8ad84e481 | |
| parent | 3d759dc6793050edd7ca8ee25b7042c4361fa37c (diff) | |
| download | go-gg-30c7511808333b56fb2ebed64a931d89a002e1c1.tar.gz | |
microprom: fix outdated doc links
| -rw-r--r-- | microprom/labels.go | 6 | ||||
| -rw-r--r-- | microprom/microprom.go | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/microprom/labels.go b/microprom/labels.go index 5b56c9c..db1d609 100644 --- a/microprom/labels.go +++ b/microprom/labels.go @@ -9,7 +9,7 @@ import ( ) // Labels holds a label set, formatted according to the text protocol of [OpenMetrics 1.0]. -// Instances are constructed through [LabelNames.Format]. +// Instances are constructed through [MetricSet.FormatLabels]. // // [OpenMetrics 1.0]: https://prometheus.io/docs/specs/om/open_metrics_spec/ type Labels string @@ -51,7 +51,9 @@ func NewLabelNames(names ...string) LabelNames { // labels := ms.FormatLabels(names, "bar", "world") // assert.Equal(t, labels, `foo="bar",hello="world"`) func (ms *MetricSet) FormatLabels(n LabelNames, values ...string) Labels { - // NOTE on API structure: This is not part of ms.Add() to allow reusing label sets for multiple metrics. + // NOTE on API structure: + // - This is not part of ms.Add() to allow reusing label sets for multiple metrics. + // - This is a method of MetricSet because we want to be able to depend on the negotiated syntax in the future (e.g. for escaping rules). if len(n.names) != len(values) { panic(fmt.Sprintf("expected %d label values, but got %d", len(n.names), len(values))) diff --git a/microprom/microprom.go b/microprom/microprom.go index 4055c8b..6b2ca46 100644 --- a/microprom/microprom.go +++ b/microprom/microprom.go @@ -22,8 +22,8 @@ // // # How to use // -// To get started with microprom, declare your metric families in a [Metadata] instance, -// and then call [Metadata.Handler] to obtain a handler for your "GET /metrics" endpoint. +// To get started with microprom, look at how to build a [Handler] instance, +// and follow the documentation from there. // // [promhttp]: https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/promhttp // [prometheus/client_golang]: https://pkg.go.dev/github.com/prometheus/client_golang @@ -35,7 +35,7 @@ import ( "regexp" ) -// MetricFamilyInfo appears in type [HandlerInfo]. +// MetricFamilyInfo appears in type [Handler]. type MetricFamilyInfo struct { Type MetricType Help string |
