See into function inside background_task

Please paste the permalink to the page in question below:

Please share your agent version and other relevant versions below:

Please share your question/describe your issue below. Include any screenshots that may help us understand your question:

Hi, We are running a large django project and are trying to monitor performance of the code. I have decorated all of the functions I am curious about with the newrelic.agent.background_task() decorator. Each time one of these functions is called, it shows up in APM as I would expect, but if any of those functions calls another background_task decorated function, the inner function is not reported.
Is there something that will allow that separate function to be reported on?

Thanks,
Cole

The time spent in the nested background task function is being lumped into the “parent” background task function. If you want to break the nested functions out to their segment of the parent function, you should use the function_trace decorator on the nested functions. These segments will show under the breakdown table on the particular transaction.

Check out the function_trace docs here and let us know if you have any follow up questions.

Thank you so much. That did the trick.

Thanks for letting us know that worked @coleh - now others will be able to find the solution!