[APM AGENT][JAVA] Doubts about default transactions relation with custom spans

Hi guys,
I'm succesfully using APM Agent Public API and I can correctly create transactions and related spans.
What I'm wondering is about how to manage default transaction that is created automatically by APM agent (when the application ws is called), get its ID and create custom spans that are related to it. Is that possible or should I disable instrumentation on those kind of activities and creat custom transaction for them too?
Thanks,

Andrea

Hi,

just use the ElasticApm.currentTransaction() method to get the transaction which was created via the auto-instrumentation.