From b7c0c8e3b879bb31cea8d6dc221c8bdad9450029 Mon Sep 17 00:00:00 2001 From: Norbert Kwizera Date: Fri, 13 Dec 2024 21:12:42 +0200 Subject: [PATCH] Update gocommon --- archives/archives.go | 3 ++- archives/archives_test.go | 8 ++++---- go.mod | 2 +- go.sum | 2 ++ 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/archives/archives.go b/archives/archives.go index d32c8dd..3129a4a 100644 --- a/archives/archives.go +++ b/archives/archives.go @@ -983,7 +983,8 @@ func ArchiveActiveOrgs(rt *runtime.Runtime) error { {MetricName: aws.String("RunsRollupsFailed"), Value: aws.Float64(float64(totalRunsRollupsFailed)), Unit: types.StandardUnitCount}, } - if _, err := rt.CW.Client.PutMetricData(ctx, rt.CW.Prepare(metrics)); err != nil { + err = rt.CW.Send(ctx, metrics...) + if err != nil { slog.Error("error putting metrics", "error", err) } diff --git a/archives/archives_test.go b/archives/archives_test.go index d75f8cf..e5dedab 100644 --- a/archives/archives_test.go +++ b/archives/archives_test.go @@ -501,10 +501,10 @@ func TestArchiveActiveOrgs(t *testing.T) { assert.Equal(t, 0, rt.CW.Client.(*cwatch.DevClient).CallCount()) - _, err := rt.CW.Client.PutMetricData(ctx, rt.CW.Prepare([]types.MetricDatum{ - {MetricName: aws.String("NumGoats"), Value: aws.Float64(10), Unit: types.StandardUnitCount}, - {MetricName: aws.String("NumSheep"), Dimensions: []types.Dimension{{Name: aws.String("Host"), Value: aws.String("foo1")}}, Value: aws.Float64(20), Unit: types.StandardUnitCount}, - })) + err := rt.CW.Send(ctx, + types.MetricDatum{MetricName: aws.String("NumGoats"), Value: aws.Float64(10), Unit: types.StandardUnitCount}, + types.MetricDatum{MetricName: aws.String("NumSheep"), Dimensions: []types.Dimension{{Name: aws.String("Host"), Value: aws.String("foo1")}}, Value: aws.Float64(20), Unit: types.StandardUnitCount}, + ) assert.NoError(t, err) assert.Equal(t, 1, rt.CW.Client.(*cwatch.DevClient).CallCount()) diff --git a/go.mod b/go.mod index 4055286..30b21e8 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/jmoiron/sqlx v1.4.0 github.com/lib/pq v1.10.9 github.com/nyaruka/ezconf v0.3.0 - github.com/nyaruka/gocommon v1.60.2 + github.com/nyaruka/gocommon v1.60.3 github.com/samber/slog-multi v1.2.0 github.com/samber/slog-sentry v1.2.2 github.com/stretchr/testify v1.10.0 diff --git a/go.sum b/go.sum index 2d29935..7c33cb9 100644 --- a/go.sum +++ b/go.sum @@ -112,6 +112,8 @@ github.com/nyaruka/gocommon v1.60.2-0.20241213113333-112a0bc4c3ee h1:MH7kxmPa53X github.com/nyaruka/gocommon v1.60.2-0.20241213113333-112a0bc4c3ee/go.mod h1:kFJuOq8COneV7ssfK6xgCMJ8gP8fQifLQnNXBnE4YL0= github.com/nyaruka/gocommon v1.60.2 h1:AvvSSAV70SV49ocNtvjpdb9NlcdiA2OQAL4NYVUcuV0= github.com/nyaruka/gocommon v1.60.2/go.mod h1:kFJuOq8COneV7ssfK6xgCMJ8gP8fQifLQnNXBnE4YL0= +github.com/nyaruka/gocommon v1.60.3 h1:fPQ9t6NX+mu7JQ7nXefgpBs8paqGvGXq3eA7VscsAVo= +github.com/nyaruka/gocommon v1.60.3/go.mod h1:kFJuOq8COneV7ssfK6xgCMJ8gP8fQifLQnNXBnE4YL0= github.com/nyaruka/librato v1.1.1 h1:0nTYtJLl3Sn7lX3CuHsLf+nXy1k/tGV0OjVxLy3Et4s= github.com/nyaruka/librato v1.1.1/go.mod h1:fme1Fu1PT2qvkaBZyw8WW+SrnFe2qeeCWpvqmAaKAKE= github.com/nyaruka/null/v2 v2.0.3 h1:rdmMRQyVzrOF3Jff/gpU/7BDR9mQX0lcLl4yImsA3kw=