You can set additional configurations along with license key in the Python agent.

Configurations

You can set following configurations in the Python agent.

Option Description Type
LICENSE_KEY APM License Key of your account. string
APP_NAME Name of your Java project/app. string
APP_VERSION Application version to identify release of your app. string
ENVIRONMENT Environments allow you to easily filter data on your APM app. string
CAPTURE_BODY Capture request body in traces. string
HOSTNAME Default hostname is machine name. You can override it by this option.. string

In Django

copy
icon/buttons/copy

# settings.py

ATATUS = {
   'APP_NAME': 'Django App',
   'LICENSE_KEY': 'lic_apm_xxxxxxx',

   'APP_VERSION': '1.0.0'
   'ENVIRONMENT': 'production'
   'CAPTURE_BODY': 'all'
   'HOSTNAME': 'web1.example.com'
}

In Flask

copy
icon/buttons/copy

# Add atatus agent to your app.
app.config['ATATUS'] = {
   'APP_NAME': 'Flask App',
   'LICENSE_KEY': 'lic_apm_xxxxxxx',

   'APP_VERSION': '1.0.0'
   'ENVIRONMENT': 'production'
   'CAPTURE_BODY': 'all'
   'HOSTNAME': 'web1.example.com'
}
atatus = Atatus(app)

Setting 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 Django

copy
icon/buttons/copy

# settings.py

ATATUS = {
   'APP_NAME': 'Django App',
   'LICENSE_KEY': 'lic_apm_xxxxxxx',

   'APP_VERSION': '1.0.0'
}

In Flask

copy
icon/buttons/copy

# Add atatus agent to your app.
app.config['ATATUS'] = {
   'APP_NAME': 'Flask App',
   'LICENSE_KEY': 'lic_apm_xxxxxxx',

   'APP_VERSION': '1.0.0'
}
atatus = Atatus(app)

Setting environment

If you are tracking multiple environments with a single APM project, then you can set a environment as follows.

In Django

copy
icon/buttons/copy

# settings.py

ATATUS = {
   'APP_NAME': 'Django App',
   'LICENSE_KEY': 'lic_apm_xxxxxxx',

   'ENVIRONMENT': 'production'
}

In Flask

copy
icon/buttons/copy

# Add atatus agent to your app.
app.config['ATATUS'] = {
   'APP_NAME': 'Flask App',
   'LICENSE_KEY': 'lic_apm_xxxxxxx',

   'ENVIRONMENT': 'production'
}
atatus = Atatus(app)

Enable Capture Body

This capture body option is disabled by default. If you want to see the request body in traces, you can enable this option in startup options. The body will be captured only in follwing content-types: application/x-www-form-urlencoded, text/*, application/json, application/xml.

In Django

copy
icon/buttons/copy

# settings.py

ATATUS = {
   'APP_NAME': 'Django App',
   'LICENSE_KEY': 'lic_apm_xxxxxxx',

   'CAPTURE_BODY': 'all'
}

In Flask

copy
icon/buttons/copy

# Add atatus agent to your app.
app.config['ATATUS'] = {
   'APP_NAME': 'Flask App',
   'LICENSE_KEY': 'lic_apm_xxxxxxx',

   'CAPTURE_BODY': 'all'
}
atatus = Atatus(app)

Configure a custom host name

By default, we will fetch the host name using Python, but you can override this as follows:

In Django

copy
icon/buttons/copy

# settings.py

ATATUS = {
   'APP_NAME': 'Django App',
   'LICENSE_KEY': 'lic_apm_xxxxxxx',

   'HOSTNAME': 'web1.example.com'
}

In Flask

copy
icon/buttons/copy

# Add atatus agent to your app.
app.config['ATATUS'] = {
   'APP_NAME': 'Flask App',
   'LICENSE_KEY': 'lic_apm_xxxxxxx',

   'HOSTNAME': 'web1.example.com'
}
atatus = Atatus(app)

For other configurations, you can use the APIs