@@ -105,7 +105,7 @@ func (s *Set) GetOrCreateHistogram(name string) *Histogram {
105
105
s .mu .Unlock ()
106
106
if nm == nil {
107
107
// Slow path - create and register missing histogram.
108
- if err := validateMetric (name ); err != nil {
108
+ if err := ValidateMetric (name ); err != nil {
109
109
panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
110
110
}
111
111
nmNew := & namedMetric {
@@ -163,7 +163,7 @@ func (s *Set) GetOrCreateCounter(name string) *Counter {
163
163
s .mu .Unlock ()
164
164
if nm == nil {
165
165
// Slow path - create and register missing counter.
166
- if err := validateMetric (name ); err != nil {
166
+ if err := ValidateMetric (name ); err != nil {
167
167
panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
168
168
}
169
169
nmNew := & namedMetric {
@@ -221,7 +221,7 @@ func (s *Set) GetOrCreateFloatCounter(name string) *FloatCounter {
221
221
s .mu .Unlock ()
222
222
if nm == nil {
223
223
// Slow path - create and register missing counter.
224
- if err := validateMetric (name ); err != nil {
224
+ if err := ValidateMetric (name ); err != nil {
225
225
panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
226
226
}
227
227
nmNew := & namedMetric {
@@ -284,7 +284,7 @@ func (s *Set) GetOrCreateGauge(name string, f func() float64) *Gauge {
284
284
s .mu .Unlock ()
285
285
if nm == nil {
286
286
// Slow path - create and register missing gauge.
287
- if err := validateMetric (name ); err != nil {
287
+ if err := ValidateMetric (name ); err != nil {
288
288
panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
289
289
}
290
290
nmNew := & namedMetric {
@@ -335,7 +335,7 @@ func (s *Set) NewSummary(name string) *Summary {
335
335
//
336
336
// The returned summary is safe to use from concurrent goroutines.
337
337
func (s * Set ) NewSummaryExt (name string , window time.Duration , quantiles []float64 ) * Summary {
338
- if err := validateMetric (name ); err != nil {
338
+ if err := ValidateMetric (name ); err != nil {
339
339
panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
340
340
}
341
341
sm := newSummary (window , quantiles )
@@ -389,7 +389,7 @@ func (s *Set) GetOrCreateSummaryExt(name string, window time.Duration, quantiles
389
389
s .mu .Unlock ()
390
390
if nm == nil {
391
391
// Slow path - create and register missing summary.
392
- if err := validateMetric (name ); err != nil {
392
+ if err := ValidateMetric (name ); err != nil {
393
393
panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
394
394
}
395
395
sm := newSummary (window , quantiles )
@@ -434,7 +434,7 @@ func (s *Set) registerSummaryQuantilesLocked(name string, sm *Summary) {
434
434
}
435
435
436
436
func (s * Set ) registerMetric (name string , m metric ) {
437
- if err := validateMetric (name ); err != nil {
437
+ if err := ValidateMetric (name ); err != nil {
438
438
panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
439
439
}
440
440
s .mu .Lock ()
0 commit comments