This works but it generates too many sql query events in process (for each single query) which I don't want to collect, I just want to track transaction duration and any exceptions (couple events per run). Is there a way to achieve this?
I think your best bet is to set ELASTIC_APM_TRANSACTION_MAX_SPANS, which will limit the number of spans collected for a single transaction. Unfortunately, this setting is global, so it might be difficult to set it just for that heavy task. If that heavy task is a separate command/process (like a django management command) then you could probably set it via environment variable for that single command.
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.