File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ func (h handler[T]) extractLabelsWithValues(labelProvider T) prometheus.Labels {
117
117
118
118
// extractLabelValues extracts label string values from a given labelProviderMarker (SingleLabelProvider or StructLabelProvider)
119
119
func (h handler [T ]) extractLabelValues (labelProvider T ) []string {
120
- m := h .extractLabels (labelProvider )
120
+ m := h .extractLabelsWithValues (labelProvider )
121
121
122
122
labelValues := make ([]string , 0 , len (m ))
123
123
for _ , v := range m {
Original file line number Diff line number Diff line change @@ -55,18 +55,17 @@ func ExampleNewCounterVecT_multiple_labels_manual() {
55
55
}
56
56
57
57
func ExampleNewCounterVecT_promauto_migrated () {
58
-
59
58
// Examples on how to migrate from promauto to promsafe
60
59
// When promauto was using a custom factory with custom registry
61
60
62
- var myReg = prometheus .NewRegistry ()
61
+ myReg : = prometheus .NewRegistry ()
63
62
64
63
counterOpts := prometheus.CounterOpts {
65
64
Name : "items_counted_detailed_auto" ,
66
65
}
67
66
68
67
// Old unsafe code
69
- //promauto.With(myReg).NewCounterVec(counterOpts, []string{"event_type", "source"})
68
+ // promauto.With(myReg).NewCounterVec(counterOpts, []string{"event_type", "source"})
70
69
// becomes:
71
70
72
71
type TicketReservationAttemptsLabels struct {
You can’t perform that action at this time.
0 commit comments