Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Forward otel tracing to sub requests
Browse files Browse the repository at this point in the history
  • Loading branch information
willscott committed Jul 12, 2023
1 parent 59d1f68 commit c40095d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import (
"time"

"github.com/filecoin-saturn/caboose/tieredhashing"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/trace"

"github.com/google/uuid"
Expand Down Expand Up @@ -261,6 +263,7 @@ func (p *pool) fetchResource(ctx context.Context, from string, resource string,

//trace
req = req.WithContext(httpstat.WithHTTPStat(req.Context(), &result))
otel.GetTextMapPropagator().Inject(req.Context(), propagation.HeaderCarrier(req.Header))

var resp *http.Response
saturnCallsTotalMetric.WithLabelValues(resourceType).Add(1)
Expand Down

0 comments on commit c40095d

Please sign in to comment.