mirror of
https://github.com/minio/mc.git
synced 2025-11-10 13:42:32 +03:00
Add mc admin trace --call=healing (#4229)
Provide healing operation traces. See https://github.com/minio/minio/pull/15616 for basic implementation.
This commit is contained in:
@@ -47,7 +47,7 @@ var adminTraceFlags = []cli.Flag{
|
|||||||
},
|
},
|
||||||
cli.StringSliceFlag{
|
cli.StringSliceFlag{
|
||||||
Name: "call",
|
Name: "call",
|
||||||
Usage: "trace only matching Call types (values: `s3`, `internal`, `storage`, `os`, `scanner`, `decommission`)",
|
Usage: "trace only matching Call types (values: `s3`, `internal`, `storage`, `os`, `scanner`, `decommission`, `healing`)",
|
||||||
},
|
},
|
||||||
cli.DurationFlag{
|
cli.DurationFlag{
|
||||||
Name: "response-threshold",
|
Name: "response-threshold",
|
||||||
@@ -228,6 +228,7 @@ func tracingOpts(ctx *cli.Context, apis []string) (opts madmin.ServiceTraceOpts,
|
|||||||
opts.OS = true
|
opts.OS = true
|
||||||
opts.Scanner = true
|
opts.Scanner = true
|
||||||
opts.Decommission = true
|
opts.Decommission = true
|
||||||
|
opts.Healing = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,6 +251,8 @@ func tracingOpts(ctx *cli.Context, apis []string) (opts madmin.ServiceTraceOpts,
|
|||||||
opts.OS = true
|
opts.OS = true
|
||||||
case "scanner":
|
case "scanner":
|
||||||
opts.Scanner = true
|
opts.Scanner = true
|
||||||
|
case "heal", "healing":
|
||||||
|
opts.Healing = true
|
||||||
case "decom", "decommission":
|
case "decom", "decommission":
|
||||||
opts.Decommission = true
|
opts.Decommission = true
|
||||||
}
|
}
|
||||||
@@ -373,10 +376,12 @@ type verboseTrace struct {
|
|||||||
Time time.Time `json:"time"`
|
Time time.Time `json:"time"`
|
||||||
Duration time.Duration `json:"duration"`
|
Duration time.Duration `json:"duration"`
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Error string `json:"error"`
|
Error string `json:"error,omitempty"`
|
||||||
|
Message string `json:"message,omitempty"`
|
||||||
RequestInfo *requestInfo `json:"request,omitempty"`
|
RequestInfo *requestInfo `json:"request,omitempty"`
|
||||||
ResponseInfo *responseInfo `json:"response,omitempty"`
|
ResponseInfo *responseInfo `json:"response,omitempty"`
|
||||||
CallStats *callStats `json:"callStats,omitempty"`
|
CallStats *callStats `json:"callStats,omitempty"`
|
||||||
|
HealResult *madmin.HealResultItem `json:"healResult,omitempty"`
|
||||||
|
|
||||||
trcType madmin.TraceType
|
trcType madmin.TraceType
|
||||||
}
|
}
|
||||||
@@ -394,6 +399,7 @@ func shortTrace(ti madmin.ServiceTraceInfo) shortTraceMsg {
|
|||||||
s.Error = t.Error
|
s.Error = t.Error
|
||||||
s.Host = t.NodeName
|
s.Host = t.NodeName
|
||||||
s.Duration = t.Duration
|
s.Duration = t.Duration
|
||||||
|
s.StatusMsg = t.Message
|
||||||
|
|
||||||
switch t.TraceType {
|
switch t.TraceType {
|
||||||
case madmin.TraceS3, madmin.TraceInternal:
|
case madmin.TraceS3, madmin.TraceInternal:
|
||||||
@@ -497,6 +503,8 @@ func (t traceMessage) JSON() string {
|
|||||||
Duration: t.Trace.Duration,
|
Duration: t.Trace.Duration,
|
||||||
Path: t.Trace.Path,
|
Path: t.Trace.Path,
|
||||||
Error: t.Trace.Error,
|
Error: t.Trace.Error,
|
||||||
|
HealResult: t.Trace.HealResult,
|
||||||
|
Message: t.Trace.Message,
|
||||||
}
|
}
|
||||||
|
|
||||||
if t.Trace.HTTP != nil {
|
if t.Trace.HTTP != nil {
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -19,7 +19,7 @@ require (
|
|||||||
github.com/minio/cli v1.23.0
|
github.com/minio/cli v1.23.0
|
||||||
github.com/minio/colorjson v1.0.2
|
github.com/minio/colorjson v1.0.2
|
||||||
github.com/minio/filepath v1.0.0
|
github.com/minio/filepath v1.0.0
|
||||||
github.com/minio/madmin-go v1.4.25
|
github.com/minio/madmin-go v1.4.26
|
||||||
github.com/minio/md5-simd v1.1.2 // indirect
|
github.com/minio/md5-simd v1.1.2 // indirect
|
||||||
github.com/minio/minio-go/v7 v7.0.34
|
github.com/minio/minio-go/v7 v7.0.34
|
||||||
github.com/minio/pkg v1.3.2
|
github.com/minio/pkg v1.3.2
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -337,8 +337,8 @@ github.com/minio/colorjson v1.0.2/go.mod h1:JWxcL2n8T8JVf+NY6awl6kn5nK49aAzHOeQE
|
|||||||
github.com/minio/filepath v1.0.0 h1:fvkJu1+6X+ECRA6G3+JJETj4QeAYO9sV43I79H8ubDY=
|
github.com/minio/filepath v1.0.0 h1:fvkJu1+6X+ECRA6G3+JJETj4QeAYO9sV43I79H8ubDY=
|
||||||
github.com/minio/filepath v1.0.0/go.mod h1:/nRZA2ldl5z6jT9/KQuvZcQlxZIMQoFFQPvEXx9T/Bw=
|
github.com/minio/filepath v1.0.0/go.mod h1:/nRZA2ldl5z6jT9/KQuvZcQlxZIMQoFFQPvEXx9T/Bw=
|
||||||
github.com/minio/madmin-go v1.3.5/go.mod h1:vGKGboQgGIWx4DuDUaXixjlIEZOCIp6ivJkQoiVaACc=
|
github.com/minio/madmin-go v1.3.5/go.mod h1:vGKGboQgGIWx4DuDUaXixjlIEZOCIp6ivJkQoiVaACc=
|
||||||
github.com/minio/madmin-go v1.4.25 h1:IEJpsTXlHz18/yRI5HxY84KaJdDjUUYdMiC5f8fId4g=
|
github.com/minio/madmin-go v1.4.26 h1:hss2NjaMpZEHlaGJh2rGRYH6GiNY6g8+ogrUoxbjafg=
|
||||||
github.com/minio/madmin-go v1.4.25/go.mod h1:ez87VmMtsxP7DRxjKJKD4RDNW+nhO2QF9KSzwxBDQ98=
|
github.com/minio/madmin-go v1.4.26/go.mod h1:ez87VmMtsxP7DRxjKJKD4RDNW+nhO2QF9KSzwxBDQ98=
|
||||||
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
|
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
|
||||||
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
|
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
|
||||||
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
|
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
|
||||||
|
|||||||
Reference in New Issue
Block a user