Skip to content

Commit

Permalink
PMM-13057 Lint, fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriCtvrtka committed Oct 9, 2024
1 parent 3865d07 commit 4e566f8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion managed/services/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,12 @@ func (s *Service) processSendCh(ctx context.Context) {
Metrics: report.Metrics,
})
reportsToSend := reportsBuf
reportsToSend = []*reporter.GenericReport{}
reportsBufSync.Unlock()

go func(ctx context.Context) {
err := s.send(ctx, &reporter.ReportRequest{
Reports: []*reporter.GenericReport{},
Reports: reportsToSend,
})
if err != nil {
s.l.Debugf("Telemetry info not sent, due to error: %s.", err)
Expand Down
3 changes: 1 addition & 2 deletions managed/services/telemetry/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (

_ "github.com/ClickHouse/clickhouse-go/v2"
pmmv1 "github.com/percona/saas/gen/telemetry/events/pmm"
genericv1 "github.com/percona/saas/gen/telemetry/generic"
reporter "github.com/percona/saas/gen/telemetry/generic"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -299,7 +298,7 @@ func initMockTelemetrySender(t *testing.T, expectedReport *reporter.ReportReques
}
}

func valueIsInArray(items []*genericv1.GenericReport_Metric, value string) bool {
func valueIsInArray(items []*reporter.GenericReport_Metric, value string) bool {
for _, item := range items {
if item.Value == value {
return true
Expand Down
2 changes: 1 addition & 1 deletion managed/utils/platform/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (c *Client) GetTemplates(ctx context.Context) (*api.GetAllAlertRuleTemplate

// SendTelemetry sends telemetry data to Percona Platform.
func (c *Client) SendTelemetry(ctx context.Context, report *reporter.ReportRequest) error {
const path = "/v1/telemetry/Report"
const path = "/v1/telemetry/GenericReport"

var accessToken string
if ssoDetails, err := models.GetPerconaSSODetails(ctx, c.db.Querier); err == nil {
Expand Down

0 comments on commit 4e566f8

Please sign in to comment.