thanks for giving it a spin, great to hear that you like it!
Do you have any hunch what your code might be doing between that SQL query and the HTTP request? It's possible that it does something expensive that we do not instrument.
The way we profile your code is that we instrument certain functions and methods that are generally considered to be potentially slow (mostly things doing IO: database queries, HTTP requests, that sort of thing). While this method of profiling generates much less overhead than something like CProfiler (which basically instruments every line of code), we can only measure what we actively instrument.
If your code happens to do something expensive that we don't instrument, you can end up with these gaps. This can be custom code, or a library/database that we don't support yet.
If you do have a hunch what your code could be doing in that gap, you can try and use our
elasticapm.trace decorator/context-manager: https://www.elastic.co/guide/en/apm/agent/python/1.x/instrumenting-custom-code.html (note that
elasticapm.trace will be renamed to
elasticapm.capture_span in version 2 of the agent, which will be released together with the Elastic Stack 6.2 Real Soon Now™)