@@ -26,8 +26,10 @@ import (
2626 "go.opentelemetry.io/otel/sdk/metric"
2727 "go.opentelemetry.io/otel/sdk/metric/metricdata"
2828 "go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest"
29+
2930 "google.golang.org/grpc"
3031 "google.golang.org/grpc/credentials/insecure"
32+ estats "google.golang.org/grpc/experimental/stats"
3133 rlspb "google.golang.org/grpc/internal/proto/grpc_lookup_v1"
3234 "google.golang.org/grpc/internal/stubserver"
3335 rlstest "google.golang.org/grpc/internal/testutils/rls"
@@ -135,7 +137,7 @@ func (s) TestRLSTargetPickMetric(t *testing.T) {
135137 client := testgrpc .NewTestServiceClient (cc )
136138 ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
137139 defer cancel ()
138- ctx = grpc .NewContextWithCustomLabel (ctx , "target-pick-custom" )
140+ ctx = estats .NewContextWithCustomLabel (ctx , "target-pick-custom" )
139141 _ , err = client .EmptyCall (ctx , & testpb.Empty {})
140142 if err != nil {
141143 t .Fatalf ("client.EmptyCall failed with error: %v" , err )
@@ -248,7 +250,7 @@ func (s) TestRLSDefaultTargetPickMetric(t *testing.T) {
248250 client := testgrpc .NewTestServiceClient (cc )
249251 ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
250252 defer cancel ()
251- ctx = grpc .NewContextWithCustomLabel (ctx , "default-target-pick-custom" )
253+ ctx = estats .NewContextWithCustomLabel (ctx , "default-target-pick-custom" )
252254 if _ , err = client .EmptyCall (ctx , & testpb.Empty {}); err != nil {
253255 t .Fatalf ("client.EmptyCall failed with error: %v" , err )
254256 }
@@ -347,7 +349,7 @@ func (s) TestRLSFailedRPCMetric(t *testing.T) {
347349
348350 ctx , cancel := context .WithTimeout (context .Background (), defaultTestTimeout )
349351 defer cancel ()
350- ctx = grpc .NewContextWithCustomLabel (ctx , "failed-pick-custom" )
352+ ctx = estats .NewContextWithCustomLabel (ctx , "failed-pick-custom" )
351353 client := testgrpc .NewTestServiceClient (cc )
352354 if _ , err = client .EmptyCall (ctx , & testpb.Empty {}); err == nil {
353355 t .Fatalf ("client.EmptyCall error = %v, expected a non nil error" , err )
0 commit comments