diff --git a/descriptor.bin b/descriptor.bin index 49bb49b8ea..99e65eae43 100644 Binary files a/descriptor.bin and b/descriptor.bin differ diff --git a/managed/services/telemetry/telemetry.go b/managed/services/telemetry/telemetry.go index 81f2450215..867f31f211 100644 --- a/managed/services/telemetry/telemetry.go +++ b/managed/services/telemetry/telemetry.go @@ -188,8 +188,8 @@ func (s *Service) processSendCh(ctx context.Context) { reportsBuf = []*pmmv1.ServerMetric{} reportsBufSync.Unlock() - go func() { - err := s.send(sendCtx, &reporter.ReportRequest{ + go func(ctx context.Context) { + err := s.send(ctx, &reporter.ReportRequest{ Metrics: reportsToSend, }) if err != nil { @@ -201,7 +201,7 @@ func (s *Service) processSendCh(ctx context.Context) { } s.l.Debug("Telemetry info sent.") - }() + }(sendCtx) } case <-ctx.Done(): if cancel != nil { diff --git a/managed/services/telemetry/telemetry_test.go b/managed/services/telemetry/telemetry_test.go index 842b6e9233..726e80cbaa 100644 --- a/managed/services/telemetry/telemetry_test.go +++ b/managed/services/telemetry/telemetry_test.go @@ -19,7 +19,6 @@ import ( "context" "io/fs" "os" - "reflect" "testing" "time" @@ -264,7 +263,7 @@ func initMockTelemetrySender(t *testing.T, expectedReport *reporter.ReportReques var mockTelemetrySender mockSender mockTelemetrySender.Test(t) mockTelemetrySender.On("SendTelemetry", - mock.AnythingOfType(reflect.TypeOf(context.TODO()).Name()), + mock.Anything, mock.MatchedBy(func(report *reporter.ReportRequest) bool { return matchExpectedReport(report, expectedReport) }),