From 30c34a761ec10772d9018b17fe781895f8534d14 Mon Sep 17 00:00:00 2001 From: Joe Elliott Date: Thu, 31 Oct 2024 13:00:22 -0400 Subject: [PATCH] add tracing context to pipeline request Signed-off-by: Joe Elliott --- modules/frontend/tag_sharder.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/frontend/tag_sharder.go b/modules/frontend/tag_sharder.go index 0131c0366e9..55f1f1e7942 100644 --- a/modules/frontend/tag_sharder.go +++ b/modules/frontend/tag_sharder.go @@ -190,9 +190,9 @@ func newAsyncTagSharder(reader tempodb.Reader, o overrides.Interface, cfg Search // until limit results are found func (s searchTagSharder) RoundTrip(pipelineRequest pipeline.Request) (pipeline.Responses[combiner.PipelineResponse], error) { r := pipelineRequest.HTTPRequest() - requestCtx := pipelineRequest.Context() + ctx := pipelineRequest.Context() - tenantID, err := user.ExtractOrgID(requestCtx) + tenantID, err := user.ExtractOrgID(ctx) if err != nil { return pipeline.NewBadRequest(err), nil } @@ -201,8 +201,9 @@ func (s searchTagSharder) RoundTrip(pipelineRequest pipeline.Request) (pipeline. if err != nil { return pipeline.NewBadRequest(err), nil } - ctx, span := tracer.Start(requestCtx, "frontend.ShardSearchTags") + ctx, span := tracer.Start(ctx, "frontend.ShardSearchTags") defer span.End() + pipelineRequest.WithContext(ctx) // calculate and enforce max search duration maxDuration := s.maxDuration(tenantID)