Skip to content
This repository was archived by the owner on Apr 18, 2023. It is now read-only.

Commit c03e2ac

Browse files
committed
Add missing godoc strings (golint)
This fixes: metric_options.go:7:6: exported type CounterOption should have comment or be unexported metric_options.go:18:1: exported function WithConstLabels should have comment or be unexported metric_options.go:24:6: exported type HistogramOption should have comment or be unexported metric_options.go:31:1: exported function WithHistogramConstLabels should have comment or be unexported
1 parent b1a7263 commit c03e2ac

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

metric_options.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import (
44
prom "github.com/prometheus/client_golang/prometheus"
55
)
66

7-
type CounterOption func(opts *prom.CounterOpts)
7+
// A CounterOption lets you add options to Counter metrics using With* funcs.
8+
type CounterOption func(*prom.CounterOpts)
89

910
type counterOptions []CounterOption
1011

@@ -15,19 +16,24 @@ func (co counterOptions) apply(o prom.CounterOpts) prom.CounterOpts {
1516
return o
1617
}
1718

19+
// WithConstLabels allows you to add ConstLabels to Counter metrics.
1820
func WithConstLabels(labels prom.Labels) CounterOption {
1921
return func(o *prom.CounterOpts) {
2022
o.ConstLabels = labels
2123
}
2224
}
2325

26+
// A HistogramOption lets you add options to Histogram metrics using With*
27+
// funcs.
2428
type HistogramOption func(*prom.HistogramOpts)
2529

2630
// WithHistogramBuckets allows you to specify custom bucket ranges for histograms if EnableHandlingTimeHistogram is on.
2731
func WithHistogramBuckets(buckets []float64) HistogramOption {
2832
return func(o *prom.HistogramOpts) { o.Buckets = buckets }
2933
}
3034

35+
// WithHistogramConstLabels allows you to add custom ConstLabels to
36+
// histograms metrics.
3137
func WithHistogramConstLabels(labels prom.Labels) HistogramOption {
3238
return func(o *prom.HistogramOpts) {
3339
o.ConstLabels = labels

0 commit comments

Comments
 (0)