Files
moby/daemon/internal/distribution/transport.go
Derek McGowan 1ff6011e04 Move distribution to daemon/internal/distribution
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-24 12:10:46 -07:00

19 lines
569 B
Go

package distribution
import (
"net/http"
"github.com/docker/distribution/registry/client/transport"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
)
// newTransport creates a new transport which will apply modifiers to
// the request on a RoundTrip call.
func newTransport(base http.RoundTripper, modifiers ...transport.RequestModifier) http.RoundTripper {
tr := transport.NewTransport(base, modifiers...)
// Wrap the transport with OpenTelemetry instrumentation
// This propagates the Traceparent header.
return otelhttp.NewTransport(tr)
}