File: api.go

package info (click to toggle)
golang-opentelemetry-contrib 0.56.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,884 kB
  • sloc: makefile: 278; sh: 211; sed: 1
file content (17 lines) | stat: -rw-r--r-- 453 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package otelhttptrace // import "go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace"

import (
	"context"
	"net/http"
	"net/http/httptrace"
)

// W3C client.
func W3C(ctx context.Context, req *http.Request) (context.Context, *http.Request) {
	ctx = httptrace.WithClientTrace(ctx, NewClientTrace(ctx))
	req = req.WithContext(ctx)
	return ctx, req
}