Skip to content

Commit

Permalink
rest middleware: add trace_id into the log buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
isogram authored and agungdwiprasetyo committed Nov 13, 2024
1 parent 868cd96 commit 44080aa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions codebase/app/rest_server/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ func HTTPMiddlewareTracer() func(http.Handler) http.Handler {
logBuff.WriteString(`,"latency":"`)
logBuff.WriteString(stop.Sub(start).String())

logBuff.WriteString(`","trace_id":"`)
logBuff.WriteString(tracer.GetTraceID(ctx))

logBuff.WriteString(`","bytes_in":`)
cl := req.Header.Get("Content-Length")
if cl == "" {
Expand Down

0 comments on commit 44080aa

Please sign in to comment.