kubernetes/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/transport.go

type Transport

var _

// NewTransport wraps the provided http.RoundTripper with one that
// starts a span, injects the span context into the outbound request headers,
// and enriches it with metrics.
//
// If the provided http.RoundTripper is nil, http.DefaultTransport will be used
// as the base http.RoundTripper.
func NewTransport(base http.RoundTripper, opts ...Option) *Transport {}

func (t *Transport) applyConfig(c *config) {}

func (t *Transport) createMeasures() {}

func defaultTransportFormatter(_ string, r *http.Request) string {}

// RoundTrip creates a Span and propagates its context via the provided request's headers
// before handing the request to the configured base RoundTripper. The created span will
// end when the response body is closed or when a read from the body returns io.EOF.
func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) {}

// newWrappedBody returns a new and appropriately scoped *wrappedBody as an
// io.ReadCloser. If the passed body implements io.Writer, the returned value
// will implement io.ReadWriteCloser.
func newWrappedBody(span trace.Span, record func(n int64), body io.ReadCloser) io.ReadCloser {}

type wrappedBody

var _

func (wb *wrappedBody) Write(p []byte) (int, error) {}

func (wb *wrappedBody) Read(b []byte) (int, error) {}

// recordBytesRead is a function that ensures the number of bytes read is recorded once and only once.
func (wb *wrappedBody) recordBytesRead() {}

func (wb *wrappedBody) Close() error {}