Configurations
You can set following configurations in the Python agent.
In Django
Set app version
If you use an appVersion to identify releases of your app, you can send it to Atatus. It is highly recommended to set appVersion. In DjangoSet environment
If you are tracking multiple environments with a single APM project, then you can set a environment as follows. In DjangoSet analytics
App Analytics collects all requests individually with contextual data. In DjangoEnable log body
The log body option is available only for analytics This log body option is disabled by default. If you want to capture request and/or response body in analytics, you can set this option. There are three possible values when enabling log body in analytics. all: Capture both request body and response body.request: Capture only request body.
response: Capture only response body.
In Django
Enable capture outgoing API calls
If you want to capture outgoing request and/or response body in analytics, you can set this option. This capture outgoing option is disabled by default. In DjangoSet analytics skip function
TheANALYTICS_SKIP function helps you exclude specific API requests (such as health-related requests) from being sent to Atatus.
In Django
Set analytics mask function
TheANALYTICS_MASK function allows you to modify the request/response headers, body, or query parameters before they are sent to Atatus. You can utilize this function to make alterations such as removing specific header or body fields. It will give you the flexibility to customize the request data that is ultimately sent to Atatus.
In Django
Set skip event function
TheSKIP function helps you exclude specific transactions, errors, HTTP failures, as well as analytics requests from being sent to Atatus.
In Django
Configure a custom host name
By default, we will fetch the host name using Python, but you can override this as follows: In DjangoConfiguration for transaction sample rate
To ensure Atatus receives a representative sample of your transactions, configure the sample rate option in your agent settings. Set this value between 0 (sending 0% of transactions) and 1 (sending 100% of transactions). This rate remains consistent across all transactions. For instance, to sample 50% of your transactions: In DjangoConfiguration for sanitizing data
By default, we automatically sanitize certain data that is being sent to us in request and response headers and body. You can configure by adding or removing certain fields using the configurationSANITIZE_FIELD_NAMES:
In Django
Set log file
By default, the agent does not write its logs to a file. To turn on file logging, setLOG_FILE to the full path of the log file. Set LOG_LEVEL along with it so the agent has something to write. The available log levels are trace, debug, info, warning, error, critical, and off.
When the log file reaches LOG_FILE_SIZE (default 50mb), the agent rolls it over and keeps one older file. Add these options to your agent configuration:
In Django
Make sure the user running your application can write to the log file’s folder.