mirror of
https://github.com/minio/minio
synced 2024-10-14 11:52:56 +00:00
Truncate long traces for internode communication (#18593)
Prevent excessively long request traces.
This commit is contained in:
parent
708296ae1b
commit
8fc200c0cc
|
@ -129,7 +129,11 @@ func (c *muxClient) traceRoundtrip(ctx context.Context, t *tracer, h HandlerID,
|
|||
trace.HTTP.ReqInfo.Path = trace.Path
|
||||
} else if v != nil {
|
||||
// Print exported fields as single request to path.
|
||||
trace.Path = fmt.Sprintf("%s?req=%s", trace.Path, url.QueryEscape(fmt.Sprintf("%+v", v)))
|
||||
obj := fmt.Sprintf("%+v", v)
|
||||
if len(obj) > 1024 {
|
||||
obj = obj[:1024] + "..."
|
||||
}
|
||||
trace.Path = fmt.Sprintf("%s?req=%s", trace.Path, url.QueryEscape(obj))
|
||||
trace.HTTP.ReqInfo.Path = trace.Path
|
||||
}
|
||||
t.Publisher.Publish(trace)
|
||||
|
|
Loading…
Reference in a new issue