Hey Guys, we're newbies to APM but we like what we see so far.
We have a few django services where we'd like to add some custom instrumenting, but we're hesitant to pollute our codebase with decorators, so is there a way to automatically instrument all function/method calls without having to add @elasticapm.capture_span() decorators or otherwise modifying the source code?
A tracing profiler like the Elastic APM Python Agent isn't a great fit for instrumenting all function/method calls. Every call we instrument comes with a little bit of overhead. This is acceptable when instrumenting calls that are known to take some time (e.g. when they involve some kind of I/O, like database calls or HTTP requests), but when instrumenting calls that only take microseconds to execute, the overhead starts to dominate.
We suggest to use a statistical profiler like py-spy to find slow calls e.g. by running your test suite, and then use elasticapm.capture_span() to instrument the calls that seem slowest according to the statistical profiler. This will then give you contextual information about those calls that a statistical profiler can't give.
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.