cloud monitor is returning floats and we are trying to parse as strings (#65407)

pull/65606/head
Andrew Hackmann 2 years ago committed by GitHub
parent c8252f9987
commit f0ddf900c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/tsdb/cloudmonitoring/cloudmonitoring.go
  2. 6
      pkg/tsdb/cloudmonitoring/types.go

@ -548,7 +548,7 @@ func calcBucketBound(bucketOptions cloudMonitoringBucketOptions, n int) string {
switch {
case bucketOptions.LinearBuckets != nil:
bucketBound = strconv.FormatInt(bucketOptions.LinearBuckets.Offset+(bucketOptions.LinearBuckets.Width*int64(n-1)), 10)
bucketBound = strconv.FormatFloat(bucketOptions.LinearBuckets.Offset+(bucketOptions.LinearBuckets.Width*float64(n-1)), 'f', 2, 64)
case bucketOptions.ExponentialBuckets != nil:
bucketBound = strconv.FormatInt(int64(bucketOptions.ExponentialBuckets.Scale*math.Pow(bucketOptions.ExponentialBuckets.GrowthFactor, float64(n-1))), 10)
case bucketOptions.ExplicitBuckets != nil:

@ -107,9 +107,9 @@ type (
cloudMonitoringBucketOptions struct {
LinearBuckets *struct {
NumFiniteBuckets int64 `json:"numFiniteBuckets"`
Width int64 `json:"width"`
Offset int64 `json:"offset"`
NumFiniteBuckets int64 `json:"numFiniteBuckets"`
Width float64 `json:"width"`
Offset float64 `json:"offset"`
} `json:"linearBuckets"`
ExponentialBuckets *struct {
NumFiniteBuckets int64 `json:"numFiniteBuckets"`

Loading…
Cancel
Save