@@ -956,13 +956,13 @@ func (h *histogram) limitBuckets(counts *histogramCounts, value float64, bucket
956956// h.nativeHistogramMinResetDuration has been passed. It returns true if the
957957// histogram has been reset. The caller must have locked h.mtx.
958958func (h * histogram ) maybeReset (
959- hot , cold * histogramCounts , coldIdx uint64 , value float64 , bucket int ,
959+ hot , cold * histogramCounts , coldIdx uint64 , value float64 , bucket int ,
960960) bool {
961961 // We are using the possibly mocked h.now() rather than
962962 // time.Since(h.lastResetTime) to enable testing.
963963 if h .nativeHistogramMinResetDuration == 0 || // No reset configured.
964- h .resetScheduled || // Do not interefere if a reset is already scheduled.
965- h .now ().Sub (h .lastResetTime ) < h .nativeHistogramMinResetDuration {
964+ h .resetScheduled || // Do not interefere if a reset is already scheduled.
965+ h .now ().Sub (h .lastResetTime ) < h .nativeHistogramMinResetDuration {
966966 return false
967967 }
968968 // Completely reset coldCounts.
@@ -1355,11 +1355,11 @@ func (h *constHistogram) Write(out *dto.Metric) error {
13551355// NewConstHistogram returns an error if the length of labelValues is not
13561356// consistent with the variable labels in Desc or if Desc is invalid.
13571357func NewConstHistogram (
1358- desc * Desc ,
1359- count uint64 ,
1360- sum float64 ,
1361- buckets map [float64 ]uint64 ,
1362- labelValues ... string ,
1358+ desc * Desc ,
1359+ count uint64 ,
1360+ sum float64 ,
1361+ buckets map [float64 ]uint64 ,
1362+ labelValues ... string ,
13631363) (Metric , error ) {
13641364 if desc .err != nil {
13651365 return nil , desc .err
@@ -1379,11 +1379,11 @@ func NewConstHistogram(
13791379// MustNewConstHistogram is a version of NewConstHistogram that panics where
13801380// NewConstHistogram would have returned an error.
13811381func MustNewConstHistogram (
1382- desc * Desc ,
1383- count uint64 ,
1384- sum float64 ,
1385- buckets map [float64 ]uint64 ,
1386- labelValues ... string ,
1382+ desc * Desc ,
1383+ count uint64 ,
1384+ sum float64 ,
1385+ buckets map [float64 ]uint64 ,
1386+ labelValues ... string ,
13871387) Metric {
13881388 m , err := NewConstHistogram (desc , count , sum , buckets , labelValues ... )
13891389 if err != nil {
@@ -1394,12 +1394,12 @@ func MustNewConstHistogram(
13941394
13951395// NewConstHistogramWithCreatedTimestamp does the same thing as NewConstHistogram but sets the created timestamp.
13961396func NewConstHistogramWithCreatedTimestamp (
1397- desc * Desc ,
1398- count uint64 ,
1399- sum float64 ,
1400- buckets map [float64 ]uint64 ,
1401- ct time.Time ,
1402- labelValues ... string ,
1397+ desc * Desc ,
1398+ count uint64 ,
1399+ sum float64 ,
1400+ buckets map [float64 ]uint64 ,
1401+ ct time.Time ,
1402+ labelValues ... string ,
14031403) (Metric , error ) {
14041404 if desc .err != nil {
14051405 return nil , desc .err
@@ -1420,12 +1420,12 @@ func NewConstHistogramWithCreatedTimestamp(
14201420// MustNewConstHistogramWithCreatedTimestamp is a version of NewConstHistogramWithCreatedTimestamp that panics where
14211421// NewConstHistogramWithCreatedTimestamp would have returned an error.
14221422func MustNewConstHistogramWithCreatedTimestamp (
1423- desc * Desc ,
1424- count uint64 ,
1425- sum float64 ,
1426- buckets map [float64 ]uint64 ,
1427- ct time.Time ,
1428- labelValues ... string ,
1423+ desc * Desc ,
1424+ count uint64 ,
1425+ sum float64 ,
1426+ buckets map [float64 ]uint64 ,
1427+ ct time.Time ,
1428+ labelValues ... string ,
14291429) Metric {
14301430 m , err := NewConstHistogramWithCreatedTimestamp (desc , count , sum , buckets , ct , labelValues ... )
14311431 if err != nil {
@@ -1873,7 +1873,7 @@ func validateCount(sum float64, count uint64, negativeBuckets, positiveBuckets m
18731873 // Otherwise, the number of observations must be equal to the sum of all bucket counts .
18741874
18751875 if math .IsNaN (sum ) && bucketPopulationSum > int64 (count ) ||
1876- ! math .IsNaN (sum ) && bucketPopulationSum != int64 (count ) {
1876+ ! math .IsNaN (sum ) && bucketPopulationSum != int64 (count ) {
18771877 return errors .New ("the sum of all bucket populations exceeds the count of observations" )
18781878 }
18791879 return nil
@@ -1902,15 +1902,15 @@ func validateCount(sum float64, count uint64, negativeBuckets, positiveBuckets m
19021902//
19031903// See https://opentelemetry.io/docs/specs/otel/compatibility/prometheus_and_openmetrics/#exponential-histograms for more details about the conversion from OTel to Prometheus.
19041904func NewConstNativeHistogram (
1905- desc * Desc ,
1906- count uint64 ,
1907- sum float64 ,
1908- positiveBuckets , negativeBuckets map [int ]int64 ,
1909- zeroBucket uint64 ,
1910- schema int32 ,
1911- zeroThreshold float64 ,
1912- createdTimestamp time.Time ,
1913- labelValues ... string ,
1905+ desc * Desc ,
1906+ count uint64 ,
1907+ sum float64 ,
1908+ positiveBuckets , negativeBuckets map [int ]int64 ,
1909+ zeroBucket uint64 ,
1910+ schema int32 ,
1911+ zeroThreshold float64 ,
1912+ createdTimestamp time.Time ,
1913+ labelValues ... string ,
19141914) (Metric , error ) {
19151915 if desc .err != nil {
19161916 return nil , desc .err
@@ -1958,15 +1958,15 @@ func NewConstNativeHistogram(
19581958// MustNewConstNativeHistogram is a version of NewConstNativeHistogram that panics where
19591959// NewConstNativeHistogram would have returned an error.
19601960func MustNewConstNativeHistogram (
1961- desc * Desc ,
1962- count uint64 ,
1963- sum float64 ,
1964- positiveBuckets , negativeBuckets map [int ]int64 ,
1965- zeroBucket uint64 ,
1966- nativeHistogramSchema int32 ,
1967- nativeHistogramZeroThreshold float64 ,
1968- createdTimestamp time.Time ,
1969- labelValues ... string ,
1961+ desc * Desc ,
1962+ count uint64 ,
1963+ sum float64 ,
1964+ positiveBuckets , negativeBuckets map [int ]int64 ,
1965+ zeroBucket uint64 ,
1966+ nativeHistogramSchema int32 ,
1967+ nativeHistogramZeroThreshold float64 ,
1968+ createdTimestamp time.Time ,
1969+ labelValues ... string ,
19701970) Metric {
19711971 nativehistogram , err := NewConstNativeHistogram (desc ,
19721972 count ,
0 commit comments