Skip to content

Commit

Permalink
fix the var reference in the iif function
Browse files Browse the repository at this point in the history
  • Loading branch information
hstan committed Aug 9, 2024
1 parent f1778b3 commit c07e311
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/backends/otlp/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,17 +292,17 @@ func (bd *Backend) SendMetricsAsync(ctx context.Context, mm *gostatsd.MetricMap,
eg, ectx := errgroup.WithContext(ctx)
for _, b := range currentGroup.batches {
atomic.AddUint64(&bd.batchesCreated, 1)
func(g group) {
func(currentBatch group) {
eg.Go(func() error {
err := bd.postMetrics(ectx, b)
err := bd.postMetrics(ectx, currentBatch)
if err != nil {
bd.logger.WithError(err).WithFields(logrus.Fields{
"endpoint": bd.metricsEndpoint,
}).Error("Issues trying to submit data")
atomic.AddUint64(&bd.batchesDropped, 1)
} else {
atomic.AddUint64(&bd.batchesSent, 1)
atomic.AddUint64(&bd.seriesSent, uint64(b.lenMetrics()))
atomic.AddUint64(&bd.seriesSent, uint64(currentBatch.lenMetrics()))
}
return err
})
Expand Down

0 comments on commit c07e311

Please sign in to comment.