Skip to content

Commit

Permalink
fix: Add trace for file fetching
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Jan 21, 2023
1 parent 0c653f2 commit 5158d65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/crud/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ func (a App) handleFile(w http.ResponseWriter, r *http.Request, request provider
}

func (a App) serveFile(w http.ResponseWriter, r *http.Request, item absto.Item) error {
_, end := tracer.StartSpan(r.Context(), a.tracer, "file", trace.WithSpanKind(trace.SpanKindInternal))
ctx, end := tracer.StartSpan(r.Context(), a.tracer, "file", trace.WithSpanKind(trace.SpanKindInternal))
defer end()

etag, ok := provider.EtagMatch(w, r, sha.New(item))
if ok {
return nil
}

file, err := a.storageApp.ReadFrom(r.Context(), item.Pathname)
file, err := a.storageApp.ReadFrom(ctx, item.Pathname)
if err != nil {
return fmt.Errorf("get reader for `%s`: %w", item.Pathname, err)
}
Expand Down

0 comments on commit 5158d65

Please sign in to comment.