mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-07 15:10:01 +08:00
Add traceId to the response headers (#919)
* Add traceId to the request headers * Add test cases * Update refactor code
This commit is contained in:
@@ -21,6 +21,8 @@ func TracingHandler(next http.Handler) http.Handler {
|
||||
defer span.Finish()
|
||||
r = r.WithContext(ctx)
|
||||
|
||||
// Conveniently track error messages
|
||||
w.Header().Set(trace.TraceIdKey, span.TraceId())
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user