mc admin trace
Description
The mc admin trace command displays API operations occurring on the target MinIO AIStor deployment.
Example
Use mc admin trace to monitor API operations on a MinIO AIStor deployment:
mc admin trace -a ALIAS- Replace
ALIASwith thealiasof the MinIO AIStor deployment.
mc admin trace has the following syntax:
mc admin trace [FLAGS] TARGET
mc admin trace [FLAGS] --in FILEmc admin trace supports the following argument:
TARGET
Specify the alias of a configured MinIO AIStor deployment for which to monitor API operations.
--all
Alias: -a
Returns all traffic on the MinIO AIStor deployment, including internode traffic between MinIO AIStor servers.
--call
Traces only matching client operation or call types.
For example, the following command only traces operations of the type scanner.
mc admin trace --call scanner TARGETValid call types include:
batch-expirationbatch-keyrotationbatch-replicationbootstrapdecommissionftpformattinghealingilminternalosrebalancereplication-resyncs3scannerstoragetablestables-scan
If not specified, MinIO AIStor returns call types of s3.
--errors
Alias: -e
Returns failed API operations only.
--filter-request
Trace client operations or calls with request size greater than the specified --filter-size value.
Must be used with --filter-size flag.
--filter-response
Trace client operations or calls with response size greater than the specified --filter-size value.
Must be used with --filter-size flag.
--filter-size
Size limit of a filtered client operation or call.
Must be used with either --filter-request or --filter-response flag.
Valid units include:
--funcname
Returns calls for the entered function name.
--in
Reads a previously saved trace from a JSON file and replays it instead of connecting to a live deployment.
Use this flag to analyze a trace captured earlier, for example one redirected to a file with mc admin trace --json ALIAS > trace.json.
When --in is set, you do not need to specify a TARGET.
--method
Returns call of the specified HTTP method.
--node
Returns calls for the specified server.
--path
Returns calls for the specified path.
--request-header
Returns calls matching the supplied request header.
--request-query
Returns calls matching the supplied request query parameter. This debug option should only be used at the direction of MinIO Support.
--response-duration
Trace calls with response duration greater than the specified value.
--response-ttfb-duration
Trace calls whose Time To First Byte (TTFB) is greater than the specified value, for example 100ms.
This is the TTFB analog of --response-duration.
--status-code
Returns calls of the specified HTTP status code.
--stats
Accumulates aggregated statistics for each traced function call during the current trace session.
The output table includes the following columns.
Accumulate stats, such as name, count, duration, min time, max time, time to first byte, or errors.
By default, the output displays up to 20 stat entries.
Use --stats-n to change the number of entries shown.
--stats-n
Sets the maximum number of accumulated stat entries to display with --stats.
Defaults to 20.
--verbose
Returns verbose output.
Global Flags
This command supports any of the global flags.
Examples
See calls that return 503 errors
Use mc admin trace to monitor API operations that return a service unavailable 503 error:
mc admin trace -v --status-code 503 ALIASSee console trace for a path
Use mc admin trace to monitor activity for a specific path:
mc admin trace --path my-bucket/my-prefix/* ALIAS- Replace
ALIASwith thealiasof the MinIO AIStor deployment. - Replace
my-bucket/my-prefix/*with the bucket, prefix, and object name or wildcard you wish to trace.
See console trace for a response size greater than 1Mb
Use mc admin trace to monitor responses over a specific size:
mc admin trace --filter-response --filter-size 1Mb ALIAS- Replace
ALIASwith thealiasof the MinIO AIStor deployment. - Replace
1Mbwith the desired response size.
See console trace for a request operation durations greater than 5ms
Use mc admin trace to monitor long operations:
mc admin trace --response-duration 5ms ALIASSee console trace for a time-to-first-byte greater than 100ms
Use mc admin trace to monitor responses that are slow to begin returning data:
mc admin trace --response-ttfb-duration 100ms ALIAS