Skip to content

Commit 45ffa0a

Browse files
committed
Bump oxide.go to latest.
Pull in oxidecomputer/oxide.go#390 to fix an integer overflow error on large metric values.
1 parent 8b14e41 commit 45ffa0a

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tool (
99

1010
require (
1111
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.139.0
12-
github.com/oxidecomputer/oxide.go v0.8.1-0.20260219202204-dfdb24eebe46
12+
github.com/oxidecomputer/oxide.go v0.8.1-0.20260304174018-b0f8ba0c764c
1313
github.com/stretchr/testify v1.11.1
1414
go.opentelemetry.io/collector/component v1.45.0
1515
go.opentelemetry.io/collector/component/componenttest v0.139.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJ
491491
github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs=
492492
github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo=
493493
github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc=
494-
github.com/oxidecomputer/oxide.go v0.8.1-0.20260219202204-dfdb24eebe46 h1:Z1tRLvbJ3ad9cGWFaknQClMpSDvDGwvI0U07gkg52Pk=
495-
github.com/oxidecomputer/oxide.go v0.8.1-0.20260219202204-dfdb24eebe46/go.mod h1:pL9BcSmHMyhR8Utxr2AcV6wG59OIrcSV3dNduIzGGdo=
494+
github.com/oxidecomputer/oxide.go v0.8.1-0.20260304174018-b0f8ba0c764c h1:DfIxEF0z8prXMmYYDuRa4gTUXPHZ+4EYb3pc4iKqg+A=
495+
github.com/oxidecomputer/oxide.go v0.8.1-0.20260304174018-b0f8ba0c764c/go.mod h1:pL9BcSmHMyhR8Utxr2AcV6wG59OIrcSV3dNduIzGGdo=
496496
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
497497
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
498498
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=

receiver/oxidemetricsreceiver/scraper.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,12 +467,12 @@ func addHistogram(
467467
dp.ExplicitBounds().FromRaw(bins)
468468

469469
counts := dp.BucketCounts()
470-
total := 0
470+
var total uint64
471471
for _, count := range distValue.Counts {
472-
counts.Append(uint64(count))
472+
counts.Append(count)
473473
total += count
474474
}
475-
dp.SetCount(uint64(total))
475+
dp.SetCount(total)
476476
dp.SetTimestamp(pcommon.NewTimestampFromTime(timestamps[idx]))
477477
}
478478
case *oxide.ValueArrayDoubleDistribution:
@@ -487,12 +487,12 @@ func addHistogram(
487487
dp.ExplicitBounds().FromRaw(distValue.Bins)
488488

489489
counts := dp.BucketCounts()
490-
total := 0
490+
var total uint64
491491
for _, count := range distValue.Counts {
492-
counts.Append(uint64(count))
492+
counts.Append(count)
493493
total += count
494494
}
495-
dp.SetCount(uint64(total))
495+
dp.SetCount(total)
496496
dp.SetTimestamp(pcommon.NewTimestampFromTime(timestamps[idx]))
497497
}
498498
default:

receiver/oxidemetricsreceiver/scraper_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ func TestAddHistogram(t *testing.T) {
388388
Values: []oxide.Distributionint64{
389389
{
390390
Bins: []int{0, 1, 2},
391-
Counts: []int{1, 2, 3},
391+
Counts: []uint64{1, 2, 3},
392392
P50: 1.5,
393393
P90: 1.9,
394394
P99: 1.99,
@@ -425,7 +425,7 @@ func TestAddHistogram(t *testing.T) {
425425
Values: []oxide.Distributiondouble{
426426
{
427427
Bins: []float64{0.0, 1.0, 2.0},
428-
Counts: []int{1, 2, 3},
428+
Counts: []uint64{1, 2, 3},
429429
P50: 1.5,
430430
P90: 1.9,
431431
P99: 1.99,

0 commit comments

Comments
 (0)