We were trying the autoinstrument feature and we experienced the following behavior with the RUM JS library:
When autoinstrumentation detects an AJAX call, it creates a task (an internal object that represents the task of creating a span for that event), and adds it to a task list.
If another AJAX call is detected before the previous task is completed, it creates a new task and adds it to the list.
When a task is completed, is removed from the tasks list, and the execution continues with the next task in the list.
If the tasks list is empty, the current transaction is closed, and subsequent calls are not sent to the APM server.
We are using version 4.4.4.
We are wondering if there is a way to have autoinstrument to automatically create spans but not closing the transaction when all then but leave the control to the user to finish the transaction manually.
We are working on docs at the moment. Let us know if this works for you.
But as a interim solution if you want to hold the transaction for any specific needs, you can add a task manually and end the transaction when needed.
const tr = agent.getCurrentTransaction();
const id = tr.addTask('hold-tr');
// forcefully end it later somewhere.
tr.end()
// or you can remove task which would trigger our internal closing logic
tr.removeTask(id)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.