From 4475e2ad19d72b713c678f2ed48a06442952fd19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0tibran=C3=BD?= Date: Mon, 1 Sep 2025 12:57:25 +0200 Subject: [PATCH] getClientToDistributeRequest: remove logging of selected client, fix logging of error (#110403) --- .../unified/resource/search_server_distributor.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pkg/storage/unified/resource/search_server_distributor.go b/pkg/storage/unified/resource/search_server_distributor.go index 1e1c00e7a7e..988153e0c12 100644 --- a/pkg/storage/unified/resource/search_server_distributor.go +++ b/pkg/storage/unified/resource/search_server_distributor.go @@ -10,16 +10,17 @@ import ( ringclient "github.com/grafana/dskit/ring/client" "github.com/grafana/dskit/services" userutils "github.com/grafana/dskit/user" - "github.com/grafana/grafana/pkg/infra/log" - "github.com/grafana/grafana/pkg/services/featuremgmt" - "github.com/grafana/grafana/pkg/services/grpcserver" - "github.com/grafana/grafana/pkg/setting" - "github.com/grafana/grafana/pkg/storage/unified/resourcepb" "github.com/prometheus/client_golang/prometheus" "go.opentelemetry.io/otel/trace" "google.golang.org/grpc" "google.golang.org/grpc/health/grpc_health_v1" "google.golang.org/grpc/metadata" + + "github.com/grafana/grafana/pkg/infra/log" + "github.com/grafana/grafana/pkg/services/featuremgmt" + "github.com/grafana/grafana/pkg/services/grpcserver" + "github.com/grafana/grafana/pkg/setting" + "github.com/grafana/grafana/pkg/storage/unified/resourcepb" ) func ProvideSearchDistributorServer(cfg *setting.Cfg, features featuremgmt.FeatureToggles, registerer prometheus.Registerer, tracer trace.Tracer, ring *ring.Ring, ringClientPool *ringclient.Pool) (grpcserver.Provider, error) { @@ -164,11 +165,9 @@ func (ds *distributorServer) getClientToDistributeRequest(ctx context.Context, n md = make(metadata.MD) } - ds.log.Info("distributing request to ", "methodName", methodName, "instanceId", inst.Id, "namespace", namespace) - err = grpc.SetHeader(ctx, metadata.Pairs("proxied-instance-id", inst.Id)) if err != nil { - ds.log.Debug("error setting grpc header", err, "err") + ds.log.Debug("error setting grpc header", "err", err) } return userutils.InjectOrgID(metadata.NewOutgoingContext(ctx, md), namespace), client.(*RingClient).Client, nil