this.methodStackRef = new AtomicReference<>(new ThreadContextMethodMetricsStack());
this.apmAgentContext = apmAgentContext;
this.threadMXBean = ManagementFactory.getThreadMXBean();
this.threadInfo = threadMXBean.getThreadInfo(thread.getId());
this.thread = thread;
ApmConfiguration configuration = apmAgentContext.getConfiguration();
this.monitoredThreadMethodMetrics = new MonitoredThreadMethodMetrics(thread, apmAgentContext);
this.monitoredThreadMethodMetrics.setMonitorSize(configuration.getThreadMetricDepth());
}