Skip to content

Commit

Permalink
Increase details of thanos-rr trace
Browse files Browse the repository at this point in the history
This commit names child spans inside the app to give us more insight to the time
spent in each section
  • Loading branch information
kradalby committed Feb 4, 2021
1 parent e3da42d commit e14286d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ type HTTPError struct {

func (api *API) remoteRead(w http.ResponseWriter, r *http.Request) error {
ctx := r.Context()
span := trace.SpanFromContext(ctx)
tracer := otel.Tracer("")
var span trace.Span
ctx, span = tracer.Start(ctx, "remoteRead")
defer span.End()

compressed, err := ioutil.ReadAll(r.Body)
Expand Down Expand Up @@ -197,7 +199,9 @@ func (c AggrChunkByTimestamp) Swap(i, j int) { c[i], c[j] = c[j], c[i] }
func (c AggrChunkByTimestamp) Less(i, j int) bool { return c[i].MinTime < c[j].MinTime }

func (api *API) doStoreRequest(ctx context.Context, req *prompb.ReadRequest, ignoredSelector map[string]struct{}) (*prompb.ReadResponse, error) {
span := trace.SpanFromContext(ctx)
tracer := otel.Tracer("")
var span trace.Span
ctx, span = tracer.Start(ctx, "doStoreRequest")
defer span.End()

response := &prompb.ReadResponse{}
Expand Down

0 comments on commit e14286d

Please sign in to comment.