@@ -105,7 +105,7 @@ func (s *Set) GetOrCreateHistogram(name string) *Histogram {
105105 s .mu .Unlock ()
106106 if nm == nil {
107107 // Slow path - create and register missing histogram.
108- if err := validateMetric (name ); err != nil {
108+ if err := ValidateMetric (name ); err != nil {
109109 panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
110110 }
111111 nmNew := & namedMetric {
@@ -163,7 +163,7 @@ func (s *Set) GetOrCreateCounter(name string) *Counter {
163163 s .mu .Unlock ()
164164 if nm == nil {
165165 // Slow path - create and register missing counter.
166- if err := validateMetric (name ); err != nil {
166+ if err := ValidateMetric (name ); err != nil {
167167 panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
168168 }
169169 nmNew := & namedMetric {
@@ -221,7 +221,7 @@ func (s *Set) GetOrCreateFloatCounter(name string) *FloatCounter {
221221 s .mu .Unlock ()
222222 if nm == nil {
223223 // Slow path - create and register missing counter.
224- if err := validateMetric (name ); err != nil {
224+ if err := ValidateMetric (name ); err != nil {
225225 panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
226226 }
227227 nmNew := & namedMetric {
@@ -284,7 +284,7 @@ func (s *Set) GetOrCreateGauge(name string, f func() float64) *Gauge {
284284 s .mu .Unlock ()
285285 if nm == nil {
286286 // Slow path - create and register missing gauge.
287- if err := validateMetric (name ); err != nil {
287+ if err := ValidateMetric (name ); err != nil {
288288 panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
289289 }
290290 nmNew := & namedMetric {
@@ -335,7 +335,7 @@ func (s *Set) NewSummary(name string) *Summary {
335335//
336336// The returned summary is safe to use from concurrent goroutines.
337337func (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 {
339339 panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
340340 }
341341 sm := newSummary (window , quantiles )
@@ -389,7 +389,7 @@ func (s *Set) GetOrCreateSummaryExt(name string, window time.Duration, quantiles
389389 s .mu .Unlock ()
390390 if nm == nil {
391391 // Slow path - create and register missing summary.
392- if err := validateMetric (name ); err != nil {
392+ if err := ValidateMetric (name ); err != nil {
393393 panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
394394 }
395395 sm := newSummary (window , quantiles )
@@ -434,7 +434,7 @@ func (s *Set) registerSummaryQuantilesLocked(name string, sm *Summary) {
434434}
435435
436436func (s * Set ) registerMetric (name string , m metric ) {
437- if err := validateMetric (name ); err != nil {
437+ if err := ValidateMetric (name ); err != nil {
438438 panic (fmt .Errorf ("BUG: invalid metric name %q: %s" , name , err ))
439439 }
440440 s .mu .Lock ()
0 commit comments