Skip to content

Commit 12b4d15

Browse files
committed
Replace deprecated opentracing
Signed-off-by: juliette.orain <[email protected]>
1 parent e97bc50 commit 12b4d15

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

pkg/distributor/distributor.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ import (
3535
"github.com/grafana/dskit/services"
3636
"github.com/grafana/dskit/tenant"
3737
"github.com/grafana/dskit/user"
38-
"github.com/opentracing/opentracing-go"
39-
opentracing_log "github.com/opentracing/opentracing-go/log"
4038
"github.com/pkg/errors"
4139
"github.com/prometheus/client_golang/prometheus"
4240
"github.com/prometheus/client_golang/prometheus/promauto"
@@ -1165,13 +1163,12 @@ type replicaInfo struct {
11651163
// - replicaRejectedTooManyClusters: sample is rejected because the tenant has too many HA clusters
11661164
// - replicaRejectedUnknown: sample is rejected due to an unknown error
11671165
func (d *Distributor) replicaObserved(ctx context.Context, userID string, replica haReplica, ts int64) (replicaState, error) {
1168-
if span := opentracing.SpanFromContext(ctx); span != nil {
1166+
span := trace.SpanFromContext(ctx)
1167+
span.SetAttributes(
11691168
// Make a copy of these, since they may be retained as tags
1170-
span.LogFields(
1171-
opentracing_log.String("cluster", strings.Clone(replica.cluster)),
1172-
opentracing_log.String("replica", strings.Clone(replica.replica)),
1173-
)
1174-
}
1169+
attribute.String("cluster", strings.Clone(replica.cluster)),
1170+
attribute.String("replica", strings.Clone(replica.replica)),
1171+
)
11751172

11761173
isAccepted, err := d.checkSample(ctx, userID, replica.cluster, replica.replica, ts)
11771174
if err != nil {

0 commit comments

Comments
 (0)