add test spans

This commit is contained in:
A.Unger
2021-08-06 15:47:46 +02:00
parent 33b1524f15
commit 2bdd07e41b
9 changed files with 83 additions and 22 deletions

View File

@@ -11,8 +11,8 @@ var propagator = propagation.NewCompositeTextMapPropagator(
propagation.TraceContext{},
)
// Trace unpacks the request context looking for an existing trace id.
func Trace(next http.Handler) http.Handler {
// TraceContext unpacks the request context looking for an existing trace id.
func TraceContext(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := propagator.Extract(r.Context(), propagation.HeaderCarrier(r.Header))
propagator.Inject(ctx, propagation.HeaderCarrier(r.Header))