Elastic APM Custom Transactions using Python

I have not been able to find any documentation for custom transactions in Python. For those of you who were able to find success could you document how this is done in Python?

Hey @jquintero! You can find documentation on creating your own transactions here.

Hope that helps!

Thank you for the info, it was very informative. However, I am unsure if that use case applies. In that case it combines two spans into one transaction, I am trying to create a custom transaction to measure AWS requests and uploads that are not being captured by Elastic APM currently. Furthermore, if I create a new custom transaction will I need an instance of APM or can I set it statically like "set_user_context"?

Also, I am curious what the use case is for "set_transaction_name" or "set_transaction_result"?

To clarify, you have AWS requests/uploads that are happening outside of your web app that you would like to capture as transactions? If you control the code on those requests, you should be able to create transactions using the pattern in the documentation I linked.

Otherwise, you might need to give me more details because I'm not sure I follow your use case.

set_transaction_name and set_transaction_result are used to set the transaction name and result. :slight_smile: You can also set the name and result using client.end_transaction, but usually you don't actually call that method, it's called for you (if you're using a supported framework). set_transaction_name and set_transaction_result are convenience methods that find the current transaction and set those fields for you so you don't have to keep track of the current transaction.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.