Skip to content

Commit

Permalink
add tracing context to pipeline request
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Elliott <[email protected]>
  • Loading branch information
joe-elliott committed Nov 1, 2024
1 parent 4730c54 commit 30c34a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/frontend/tag_sharder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
Expand Down

0 comments on commit 30c34a7

Please sign in to comment.