Configuring X-Trace Logging with Retro
In addition to aggregating resource consumption statistics, Retro can explicitly generate an X-Trace report every time a resource is intercepted. As normal, an X-Trace report will only be generated if the request is part of an X-Trace task (eg, that earlier in the request's execution, XTrace.startTask
was called). However, because there are many resources consumed during the execution of even just one request, this can generate many X-Trace reports (for example, reading a 4MB file from HDFS produces approximately 600 additional X-Trace reports).
X-Trace logging can be used even if Retro resource aggregation is disabled (eg, if resource-reporting.aggregation.active = false
).
Retro uses the following X-Trace logging classes for its resource reports:
"Disk"
-- disk consumption reports. TheOperation
field of the report will be one offileopen
,fileread
,filewrite
,fileflush
,filesync
,fileop
."Execution"
-- events related to threads, such as starting and stopping processing in a thread, forking, joining, and sleeping. TheOperation
field of the report will be one ofset
,unset
,branch
,join
,waited
."Network"
-- events related to network. TheOperation
field of the report will be one ofnetconnect
,netread
,netwrite
,netflush
,netclose
,loopback-read
,loopback-write
."Queue"
-- events related to instrumented queues. TheOperation
field of the report will be one ofthreadpool-enqueue
,threadpool-start
,threadpool-end
."MonitorLock"
-- events related to monitor locks. TheOperation
field of the report will be one oflockacquire
andlockrelease
. Monitor locks are not instrumented by default with Retro, and must be configured as described in the build options documentation."ReadWriteLock"
-- events related to read/write locks. TheOperation
field of the report will be one ofreadlockrequest
,readlockacquire
,readlockrelease
,writelockrequest
,writelockacquire
,writelockrelease
.