Skip to content

Commit

Permalink
fix deprecation warning by switching to DoBatchWithOptions
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Strobusch <[email protected]>
  • Loading branch information
dastrobu committed Nov 19, 2024
1 parent bf4d0bd commit 0f59c54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## main / unreleased
* [FEATURE] tempo-cli: support dropping multiple traces in a single operation [#4266](https://github.com/grafana/tempo/pull/4266) (@ndk)
* [CHANGE] fix deprecation warning by switching to DoBatchWithOptions [#4343](https://github.com/grafana/tempo/pull/4343) (@dastrobu)
* [CHANGE] **BREAKING CHANGE** The Tempo serverless is now deprecated and will be removed in an upcoming release [#4017](https://github.com/grafana/tempo/pull/4017/) @electron0zero
* [CHANGE] **BREAKING CHANGE** Change the AWS Lambda serverless build tooling output from "main" to "bootstrap". Refer to https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-from-the-go1-x-runtime-to-the-custom-runtime-on-amazon-linux-2/ for migration steps [#3852](https://github.com/grafana/tempo/pull/3852) (@zatlodan)
* [CHANGE] Add throughput and SLO metrics in the tags and tag values endpoints [#4148](https://github.com/grafana/tempo/pull/4148) (@electron0zero)
Expand Down
8 changes: 4 additions & 4 deletions modules/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ func (d *Distributor) sendToIngestersViaBytes(ctx context.Context, userID string

writeRing := d.ingestersRing.ShuffleShard(userID, d.overrides.IngestionTenantShardSize(userID))

err := ring.DoBatch(ctx, op, writeRing, keys, func(ingester ring.InstanceDesc, indexes []int) error {
err := ring.DoBatchWithOptions(ctx, op, writeRing, keys, func(ingester ring.InstanceDesc, indexes []int) error {
localCtx, cancel := context.WithTimeout(ctx, d.clientCfg.RemoteTimeout)
defer cancel()
localCtx = user.InjectOrgID(localCtx, userID)
Expand Down Expand Up @@ -459,7 +459,7 @@ func (d *Distributor) sendToIngestersViaBytes(ctx context.Context, userID string
d.processPushResponse(pushResponse, numSuccessByTraceIndex, lastErrorReasonByTraceIndex, numOfTraces, indexes)

return nil
}, func() {})
}, ring.DoBatchOptions{})
// if err != nil, we discarded everything because of an internal error (like "context cancelled")
if err != nil {
overrides.RecordDiscardedSpans(totalSpanCount, reasonInternalError, userID)
Expand All @@ -482,7 +482,7 @@ func (d *Distributor) sendToGenerators(ctx context.Context, userID string, keys

readRing := d.generatorsRing.ShuffleShard(userID, d.overrides.MetricsGeneratorRingSize(userID))

err := ring.DoBatch(ctx, op, readRing, keys, func(generator ring.InstanceDesc, indexes []int) error {
err := ring.DoBatchWithOptions(ctx, op, readRing, keys, func(generator ring.InstanceDesc, indexes []int) error {
localCtx, cancel := context.WithTimeout(ctx, d.generatorClientCfg.RemoteTimeout)
defer cancel()
localCtx = user.InjectOrgID(localCtx, userID)
Expand All @@ -506,7 +506,7 @@ func (d *Distributor) sendToGenerators(ctx context.Context, userID string, keys
return fmt.Errorf("failed to push spans to generator: %w", err)
}
return nil
}, func() {})
}, ring.DoBatchOptions{})

return err
}
Expand Down

0 comments on commit 0f59c54

Please sign in to comment.