I use statsd (django-statsd library, to be precise) to track time metrics in my application. Problems arise when I need to check something at several levels of the stack. A vivid example: an object is created, the post_save method is called from this object, then the celery task is launched, which then runs another celery task, which calls twilio to send a text message to the user, which finally arrives at the endpoint of my server, telling me that the text was sent successfully.
I would like to track the total time of this without resorting to manually pooling the time of each function (which, in any case, loses the wait time between calls). I would also like to avoid writing “start times” in the database, which will be mentioned at the end of the call trip, since the database search time for the start time would also distort my performance. However, calling some cache may be low latency, sufficient for negligence. But this requires a bit more infrastructure than I had hoped for at this stage of the prototype.
Any ideas on the best approach for this?
source
share