Skip to content

Commit

Permalink
feat: add tracing to fetcher (#1294)
Browse files Browse the repository at this point in the history
* feat: add tracing to fetcher

* rerun CI
  • Loading branch information
alnr committed Mar 30, 2023
1 parent 023758d commit 4ffb7bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/driver/config/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/ory/x/fetcher"
"github.com/ory/x/httpx"
"go.opentelemetry.io/otel/trace"

"github.com/ory/keto/embedx"

Expand Down Expand Up @@ -205,7 +206,10 @@ func (k *Config) DSN() string {
}

func (k *Config) Fetcher() *fetcher.Fetcher {
var opts []httpx.ResilientOptions
// Tracing still works correctly even though we pass a no-op tracer
// here, because the otelhttp package will preferentially use the
// tracer from the incoming request context over this one.
opts := []httpx.ResilientOptions{httpx.ResilientClientWithTracer(trace.NewNoopTracerProvider().Tracer("keto/internal/driver/config"))}
if k.p.Bool("clients.http.disallow_private_ip_ranges") {
opts = append(opts, httpx.ResilientClientDisallowInternalIPs())
}
Expand Down

0 comments on commit 4ffb7bc

Please sign in to comment.