improve tracing

This commit is contained in:
jianchenma
2021-01-28 14:09:13 +08:00
parent 2734903886
commit 80248e9a6e
3 changed files with 2 additions and 3 deletions

View File

@ -7,5 +7,4 @@
// Package gtree provides concurrent-safe/unsafe tree containers.
//
// Some implements are from: https://github.com/emirpasic/gods
// Thanks!
package gtree

View File

@ -72,7 +72,7 @@ func MiddlewareServerTracing(r *Request) {
}
span.AddEvent(tracingEventHttpRequest, trace.WithAttributes(
label.Any(tracingEventHttpRequestHeaders, httputil.HeaderToMap(r.Header)),
label.Any(tracingEventHttpRequestBaggage, gtrace.GetBaggageMap(ctx).Map()),
label.Any(tracingEventHttpRequestBaggage, gtrace.GetBaggageMap(ctx)),
label.String(tracingEventHttpRequestBody, reqBodyContent),
))

View File

@ -155,7 +155,7 @@ func (ct *clientTracer) wroteRequest(info httptrace.WroteRequestInfo) {
}
ct.span.AddEvent(tracingEventHttpRequest, trace.WithAttributes(
label.Any(tracingEventHttpRequestHeaders, ct.headers),
label.Any(tracingEventHttpRequestBaggage, gtrace.GetBaggageMap(ct.Context).Map()),
label.Any(tracingEventHttpRequestBaggage, gtrace.GetBaggageMap(ct.Context)),
label.String(tracingEventHttpRequestBody, bodyContent),
))
}