mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
tracing: Support older admin tracing API (#11999)
mc admin trace does not work with older MinIO versions because if an incompability with older trace admin API. This commit changes madmin for better backward compatibility with server admin API.
This commit is contained in:
parent
a772379dc5
commit
0a1db6d41b
@ -80,6 +80,8 @@ type ServiceTraceInfo struct {
|
||||
|
||||
// ServiceTraceOpts holds tracing options
|
||||
type ServiceTraceOpts struct {
|
||||
All bool // Deprecated
|
||||
|
||||
S3 bool
|
||||
Internal bool
|
||||
Storage bool
|
||||
@ -97,11 +99,17 @@ func (adm AdminClient) ServiceTrace(ctx context.Context, opts ServiceTraceOpts)
|
||||
for {
|
||||
urlValues := make(url.Values)
|
||||
urlValues.Set("err", strconv.FormatBool(opts.OnlyErrors))
|
||||
urlValues.Set("s3", strconv.FormatBool(opts.S3))
|
||||
urlValues.Set("internal", strconv.FormatBool(opts.Internal))
|
||||
urlValues.Set("storage", strconv.FormatBool(opts.Storage))
|
||||
urlValues.Set("os", strconv.FormatBool(opts.OS))
|
||||
urlValues.Set("threshold", opts.Threshold.String())
|
||||
|
||||
if opts.All {
|
||||
// Deprecated flag
|
||||
urlValues.Set("all", "true")
|
||||
} else {
|
||||
urlValues.Set("s3", strconv.FormatBool(opts.S3))
|
||||
urlValues.Set("internal", strconv.FormatBool(opts.Internal))
|
||||
urlValues.Set("storage", strconv.FormatBool(opts.Storage))
|
||||
urlValues.Set("os", strconv.FormatBool(opts.OS))
|
||||
}
|
||||
reqData := requestData{
|
||||
relPath: adminAPIPrefix + "/trace",
|
||||
queryValues: urlValues,
|
||||
|
@ -25,12 +25,12 @@ import (
|
||||
type Type int
|
||||
|
||||
const (
|
||||
// HTTP tracing (MinIO S3 & Internode)
|
||||
HTTP Type = iota
|
||||
// OS tracing (Golang os package calls)
|
||||
OS Type = iota
|
||||
OS
|
||||
// Storage tracing (MinIO Storage Layer)
|
||||
Storage
|
||||
// HTTP tracing (MinIO S3 & Internode)
|
||||
HTTP
|
||||
)
|
||||
|
||||
// Info - represents a trace record, additionally
|
||||
|
Loading…
Reference in New Issue
Block a user