APM Java agent not capturing background running details and methods when enable sampling profiler

If you are using a supported scheduling framework, then maybe setting the application_packages is all you need to do.

Otherwise, you would need to manually trace those. One option is using the trace_methods config option, but make sure to be very specific in what you set through it, don't cast a too-wide net. Another option is to manually trace the relevant methods through code, by using our public API.