Python package configuration options

The following list includes all configuration options with the name of the environment variable and the name of the key in the configuration file.

For more information on how to configure AppSignal with a configuration file or system environment variables, see our Configuration documentation.

Available options

active

Config file keyactive
System environment keyAPPSIGNAL_ACTIVE
Requiredyes
TypeBoolean (true / false)
Default valuefalse
Available since version0.1.0

Description

Configure AppSignal to be active or not for a given environment. If AppSignal is not active, no data is reported for the app in the specified environment.

environment

Config file keyenvironment
System environment keyAPPSIGNAL_APP_ENV
Requiredyes
TypeString
Default valuedevelopment
Available since version0.1.0

Description

The environment of the app to be reported to AppSignal.

Note: Changing the name or environment of an existing app will create a new app on AppSignal.com.

name

Config file keyname
System environment keyAPPSIGNAL_APP_NAME
Requiredyes
TypeString
Default valuenil (This is unset by default)
Available since version0.1.0

Description

Name of your application as it should be displayed on AppSignal.com.

Note: Changing the name or environment of an existing app will create a new app on AppSignal.com.

push_api_key

Config file keypush_api_key
System environment keyAPPSIGNAL_PUSH_API_KEY
Requiredyes
TypeString
Default valuenil (This is unset by default)
Available since version0.1.0

Description

The organization-level authentication key to authenticate with our Push API.

Read more about the AppSignal Push API key.

bind_address

Config file keybind_address
System environment keyAPPSIGNAL_BIND_ADDRESS
Requiredno
TypeString
Default value127.0.0.1
Available since version0.1.5

Description

A valid IPv4 address the AppSignal agent uses as a binding for its TCP and UDP servers. Use a specific address if you only want the agent to listen to requests made to that address. Set this option to 0.0.0.0 to allow to receive requests from hosts using any IP address. By default it only listens to requests made on the same host. This option is applied to all the agent servers (StatsD, OpenTelemetry and NGINX).

Agent only: when using an external collector, this configuration option does not have any effect.

ca_file_path

Config file keyca_file_path
System environment keyAPPSIGNAL_CA_FILE_PATH
Requiredno
TypeString
Default valuePackaged cacert.pem file path.
Available since version0.1.0

Description

Use this option to point to another certificate file if there's a problem connecting to our API.

Note: The specified path cannot contain Operating Specific file system abstractions, such as the homedir symbol ~ for *NIX systems. This will be seen as a malformed path.

When using an external collector, this configuration option does not have any effect on how the integration communicates with the external collector. It will still be used when communicating with AppSignal's servers.

collector_endpoint

Config file keycollector_endpoint
System environment keyAPPSIGNAL_COLLECTOR_ENDPOINT
Requiredno
TypeString
Default valuenil (This is unset by default)
Available since version1.6.0

Description

The address of an externally deployed AppSignal Collector. When set, the AppSignal agent bundled with the integration will not be used, and OpenTelemetry data will be sent to the collector at this address instead.

This is an experimental configuration option. The following functionality will not be available when using an external collector:

The following functionality is only available when using an external collector:

cpu_count

Config file keycpu_count
System environment keyAPPSIGNAL_CPU_COUNT
Requiredno
TypeFloat
Default valueundefined
Available since version1.2.0

Description

The available CPU capacity of the host, in number of CPUs. This is used to calculate the CPU usage percentage in the host metrics. If not set, the agent will attempt to automatically detect this from cgroups.

The number of CPUs can be a fraction, e.g. 0.5.

Agent only: when using an external collector, this configuration option does not have any effect.

disable_default_instrumentations

Config file keydisable_default_instrumentations
System environment keyAPPSIGNAL_DISABLE_DEFAULT_INSTRUMENTATIONS
Requiredno
Typelist(String) or Boolean (true / false)
Default valuefalse
Available since version0.1.0

Description

Allows you to disable the automatic instrumentation of default integrations:

  • aiopg
  • asyncpg
  • celery
  • django
  • flask
  • mysql
  • mysqlclient
  • psycopg
  • psycopg2
  • pymysql
  • redis
  • jinja2
  • requests
  • sqlalchemy
  • sqlite3
  • logging

When using AppSignal for Python 1.5.4 or earlier, prefix each of these names with opentelemetry.instrumentation.. For example, jinja2 would be specified as opentelemetry.instrumentation.jinja2.

Note that instrumentations are only enabled if the corresponding OpenTelemetry instrumentation library is installed.

To disable all automatic instrumentations, set the value to True.

dns_servers

Config file keydns_servers
System environment keyAPPSIGNAL_DNS_SERVERS
Requiredno
Typelist(String)
Default value[]
Available since version0.1.0

Description

Configure DNS servers for the AppSignal agent to use.

Shell
# In the host environment export APPSIGNAL_DNS_SERVERS="8.8.8.8,8.8.4.4"

If you're affected by our DNS timeouts, try setting a DNS server manually using this option that doesn't use more than 4 dots in the server name.

  • Acceptable values: 8.8.8.8, my.custom.local.server.
  • Not acceptable values: foo, my.awesome.custom.local.dns.server.

If the DNS server cannot be reached the agent will fall back on the host's DNS configuration and output a message in the appsignal.log file: A problem occurred while setting DNS servers.

Agent only: when using an external collector, this configuration option does not have any effect.

enable_host_metrics

Config file keyenable_host_metrics
System environment keyAPPSIGNAL_ENABLE_HOST_METRICS
Requiredno
TypeBoolean (true / false)
Default value`true / detected by system`
Available since version0.1.0

Description

Set this option to false to disable host metrics collection.

On Heroku and Dokku host metrics are disabled by default. This is done because these systems will report inaccurate metrics from within the containers. Host metrics collection on these systems cannot be enabled. For Heroku, use the Heroku log drain instead.

Agent only: when using an external collector, this configuration option does not have any effect.

enable_minutely_probes

Config file keyenable_minutely_probes
System environment keyAPPSIGNAL_ENABLE_MINUTELY_PROBES
Requiredno
TypeBoolean (true / false)
Default valuetrue
Available since version1.2.0

Description

Enables the minutely probes system.

enable_nginx_metrics

Config file keyenable_nginx_metrics
System environment keyAPPSIGNAL_ENABLE_NGINX_METRICS
Requiredno
TypeBoolean (true / false)
Default valuefalse
Available since version0.1.0

Description

Set to true to enable the NGINX metrics server. See the NGINX metrics documentation for details.

When enabled, the AppSignal agent will listen to a localhost-bound server on port 27649. If you're running several AppSignal-instrumented applications in the same server, this configuration option can only be enabled in one of them.

Agent only: when using an external collector, this configuration option does not have any effect.

enable_statsd

Config file keyenable_statsd
System environment keyAPPSIGNAL_ENABLE_STATSD
Requiredno
TypeBoolean (true / false)
Default valuefalse
Available since version0.1.0

Description

Enables the StatsD server in the AppSignal agent.

When enabled, the AppSignal agent will listen to a localhost-bound server on port 8125. If you're running several AppSignal-instrumented applications in the same server, this configuration option can only be enabled in one of them.

Agent only: when using an external collector, this configuration option does not have any effect.

endpoint

Config file keyendpoint
System environment keyAPPSIGNAL_PUSH_API_ENDPOINT
Requiredno
TypeString
Default valuehttps://push.appsignal.com
Available since version0.1.0

Description

Configure the endpoint to send data to AppSignal. This setting will not have to be changed.

Agent only: when using an external collector, this configuration option does not have any effect.

files_world_accessible

Config file keyfiles_world_accessible
System environment keyAPPSIGNAL_FILES_WORLD_ACCESSIBLE
Requiredno
TypeBoolean (true / false)
Default valuetrue
Available since version0.1.0

Description

If this is set to true the AppSignal working directory that is created is accessible for all users (Unix permissions 0666). This is often necessary because processes for the same app run under a different user. Set to false to disable this behaviour (Unix permissions 0644).

Agent only: when using an external collector, this configuration option does not have any effect.

filter_attributes

Config file keyfilter_attributes
System environment keyAPPSIGNAL_FILTER_ATTRIBUTES
Requiredno
Typelist(String)
Default value[]
Available since version1.6.0

Description

List of OpenTelemetry span attributes that should be ignored using AppSignal filtering. Their values will be replaced with [FILTERED] when transmitted to AppSignal.

Read more about parameter filtering.

Collector only: this configuration option will only have an effect when using an external collector.

See the filter_parameters configuration option for filtering data when using the agent.

filter_function_parameters

Config file keyfilter_function_parameters
System environment keyAPPSIGNAL_FILTER_FUNCTION_PARAMETERS
Requiredno
Typelist(String)
Default value[]
Available since version1.6.0

Description

List of function parameter attributes that should be ignored using AppSignal filtering. Their values will be replaced with [FILTERED] when transmitted to AppSignal.

Read more about parameter filtering.

Collector only: this configuration option will only have an effect when using an external collector.

See the filter_parameters configuration option for filtering data when using the agent.

filter_parameters

Config file keyfilter_parameters
System environment keyAPPSIGNAL_FILTER_PARAMETERS
Requiredno
Typelist(String)
Default value[]
Available since version0.1.0

Description

List of parameter keys that should be ignored using AppSignal filtering. Their values will be replaced with [FILTERED] when transmitted to AppSignal.

Read more about parameter filtering.

Agent only: when using an external collector, this configuration option does not have any effect.

See the following configuration options for filtering parameters when using an external collector:

filter_request_payload

Config file keyfilter_request_payload
System environment keyAPPSIGNAL_FILTER_REQUEST_PAYLOAD
Requiredno
Typelist(String)
Default value[]
Available since version1.6.0

Description

List of request payload attributes that should be ignored using AppSignal filtering. Their values will be replaced with [FILTERED] when transmitted to AppSignal.

Read more about parameter filtering.

Collector only: this configuration option will only have an effect when using an external collector.

See the filter_parameters configuration option for filtering data when using the agent.

filter_request_query_parameters

Config file keyfilter_request_query_parameters
System environment keyAPPSIGNAL_FILTER_REQUEST_QUERY_PARAMETERS
Requiredno
Typelist(String)
Default value[]
Available since version1.6.0

Description

List of request query parameter attributes that should be ignored using AppSignal filtering. Their values will be replaced with [FILTERED] when transmitted to AppSignal.

Read more about parameter filtering.

Collector only: this configuration option will only have an effect when using an external collector.

See the filter_parameters configuration option for filtering data when using the agent.

filter_session_data

Config file keyfilter_session_data
System environment keyAPPSIGNAL_FILTER_SESSION_DATA
Requiredno
Typelist(String)
Default value[]
Available since version0.1.0

Description

List of session data keys that should be ignored using AppSignal filtering. Their values will be replaced with [FILTERED] when transmitted to AppSignal.

Read more about session data filtering.

host_role

Config file keyhost_role
System environment keyAPPSIGNAL_HOST_ROLE
Requiredno
TypeString
Default valuenil (This is unset by default)
Available since version0.2.2

Description

Group hosts by role and generate metrics based on this role. One such metric is the reporting_hosts counter metric. A good role indicates what the main role of the server is, like "webserver", "processor", "api", "database", "loadbalancer", etc.

Agent only: when using an external collector, this configuration option does not have any effect.

hostname

Config file keyhostname
System environment keyAPPSIGNAL_HOSTNAME
Requiredno
TypeString
Default valuedetected from system
Available since version0.1.0

Description

This overrides the server's hostname. Useful for when you're unable to set a custom hostname or when a nondescript id is generated for you on hosting services.

http_proxy

Config file keyhttp_proxy
System environment keyAPPSIGNAL_HTTP_PROXY
Requiredno
TypeString
Default valuenil (This is unset by default)
Available since version0.1.0

Description

If you require the agent to connect to the Internet via a proxy set the complete proxy URL in this configuration key.

When using an external collector, this configuration option does not have any effect on how the integration communicates with the external collector. It will still be used when communicating with AppSignal's servers.

ignore_actions

Config file keyignore_actions
System environment keyAPPSIGNAL_IGNORE_ACTIONS
Requiredno
Typelist(String)
Default value[]
Available since version0.1.0

Description

With this config option you can specify a list of actions that will be ignored by AppSignal. Everything that happens including exceptions will not be transmitted to AppSignal. This can be useful to ignore health check endpoints or other actions that you don't want to monitor.

Read more about ignoring actions.

ignore_errors

Config file keyignore_errors
System environment keyAPPSIGNAL_IGNORE_ERRORS
Requiredno
Typelist(String)
Default value[]
Available since version0.1.0

Description

List of error classes that will be ignored. Any exception raised with this error class will not be transmitted to AppSignal.

Read more about ignoring errors.

ignore_namespaces

Config file keyignore_namespaces
System environment keyAPPSIGNAL_IGNORE_NAMESPACES
Requiredno
Typelist(String)
Default value[]
Available since version0.1.0

Description

List of namespaces that will be ignored. Any error raised or slow request that occurs in this namespace will not be send to AppSignal.

Read more about namespaces.

log

Config file keylog
System environment keyAPPSIGNAL_LOG
Requiredno
TypeString
Default valuefile
Available since version0.1.0

Description

This option configures what logger that AppSignal's internal logging functionality will use and does not affect the logging feature.

Note: The AppSignal agent, which is used by the integration, will always write to the "appsignal.log" file.

Select which logger the AppSignal integration will use. Accepted values are file and stdout. See also the log_path configuration.

  • file (default)
    • Write all AppSignal logs to the file system.
  • stdout (default on Heroku)
    • Print AppSignal logs in the parent process' STDOUT instead of to a file. Useful with hosting solutions such as container systems and Heroku.

When using an external collector, this configuration option does not have any effect on how the collector will emit logs. The integration will still follow this configuration option when emitting logs.

log_level

Config file keylog_level
System environment keyAPPSIGNAL_LOG_LEVEL
Requiredno
TypeString
Default valueinfo
Available since version0.1.0

Description

This option sets the severity level of AppSignal's internal logger and does not affect the logging feature.

Set the severity level of AppSignal's internal logger. If it is configured to "info" it will log all error, warning and info messages, but not log the debug messages.

Setting it to the levels "debug" or "trace" is usually only needed on request from support. Setting the level to "debug"/"trace" could have a slight impact on the disk usage and IO, especially on high-traffic sites. CPU overhead is minimal with the debug option enabled.

Accepted values:

  • error
  • warning
  • info
  • debug
  • trace

When using an external collector, this configuration option does not have any effect on how the collector will emit logs. The integration will still follow this configuration option when emitting logs.

log_path

Config file keylog_path
System environment keyAPPSIGNAL_LOG_PATH
Requiredno
TypeString
Default value/tmp
Available since version0.1.0

Description

This option configures the location of AppSignal's internal logging file and does not affect the logging feature.


Note: The specified path cannot contain Operating Specific file system abstractions, such as the homedir symbol ~ for *NIX systems. This will be seen as a malformed path.

Override the location of the path (directory) where the appsignal.log file can be written to.

When using an external collector, this configuration option does not have any effect on how the collector will emit logs. The integration will still follow this configuration option when emitting logs.

nginx_port

Config file keynginx_port
System environment keyAPPSIGNAL_NGINX_PORT
Requiredno
TypeInteger
Default value27649
Available since version1.5.4

Description

Configure the port on which the NGINX metrics server is exposed.

When AppSignal receives NGINX metrics, it listens on a localhost-bound server, by default on port 27649. If you're running several AppSignal-instrumented applications in the same server with NGINX metrics enabled, use this option to configure each application to listen on a different port.

Agent only: when using an external collector, this configuration option does not have any effect.

opentelemetry_port

Config file keyopentelemetry_port
System environment keyAPPSIGNAL_OPENTELEMETRY_PORT
Requiredno
TypeInteger
Default value8099
Available since version0.2.2

Description

Set this option to configure the OpenTelemetry HTTP server port of the AppSignal agent process. Configure this port if another process is already running on the machine that is also using this port to avoid conflicts.

Agent only: when using an external collector, this configuration option does not have any effect. The port to use to send OpenTelemetry data to the external collector can be specified as part of the collector_endpoint configuration option.

request_headers

Config file keyrequest_headers
System environment keyAPPSIGNAL_REQUEST_HEADERS
Requiredno
Typelist(String)
Default value["accept", "accept-charset", "accept-encoding", "accept-language", "cache-control", "connection", "content-length", "range"]
Available since version0.1.0

Description

The request_headers config option contains a list of HTTP request headers which are read and stored by the AppSignal Python package.

This request_headers config option is an allowlist, which means that it will only take headers as specified by this config option. If this config option is unset it will use the AppSignal default.

Following list is the AppSignal package default.

Python
# __appsignal__.py appsignal = Appsignal( # ...Other config opts request_headers=[ "accept", "accept-charset", "accept-encoding", "accept-language", "cache-control", "connection", "content-length", "range" ] )

To customize this list, add the config option with all headers you want reported. All header names should be written in lowercase characters. If the header name is X-Custom-Header, add it to this list as x-custom-header.

To configure AppSignal to not store any HTTP request headers on AppSignal traces, configure the option with an empty list.

Python
# __appsignal__.py appsignal = Appsignal( # ...Other config opts request_headers=[] )

response_headers

Config file keyresponse_headers
System environment keyAPPSIGNAL_RESPONSE_HEADERS
Requiredno
Typelist(String)
Default value[]
Available since version1.6.0

Description

The response_headers config option contains a list of HTTP response headers which are read and stored by the AppSignal for Python package.

This response_headers config option is an allowlist, which means that it will only take headers as specified by this config option. If this config option is unset, it will not report any response headers.

To customize this list, add the config option with all headers you want reported. All header names should be written in lowercase characters. If the header name is X-Custom-Header, add it to this list as x-custom-header.

Collector only: this configuration option will only have an effect when using an external collector.

revision

Config file keyrevision
System environment keyAPP_REVISION
Requiredno
TypeString
Default valuenil (This is unset by default)
Available since version0.1.0
  • 0.2.0: Auto detection for Render deploys.
  • 1.3.3: Auto detection for Kamal deploys.

Description

Set the app revision to report the currently running version of your app. AppSignal will create a deploy marker when this value changes, and tag all incoming data with the current revision.

When your application is deployed using Kamal, or when it is deployed to Render, or when it is deployed to Heroku and the Heroku Labs: Dyno Metadata feature is enabled, the AppSignal integration will automatically detect the Git commit of the current deployment and use it as the revision.

You can overwrite the automatically detected revisions in Heroku, Render or Kamal by manually setting the revision config option to a custom value.

Read more about deploy markers in the deploy markers topic.

running_in_container

Config file keyrunning_in_container
System environment keyAPPSIGNAL_RUNNING_IN_CONTAINER
Requiredno
TypeBoolean (true / false)
Default valuedetected by agent
Available since version0.1.0

Description

AppSignal expects to be running on the same machine between different deploys. Set this key to true if the application is running in a container, such as with Docker.

Newer versions of the AppSignal integration automatically detect its container environment, so no manual configuration is necessary. If you're having trouble with the automatic detection, please contact support.

This option is set to true automatically on Heroku.

Agent only: when using an external collector, this configuration option does not have any effect.

send_environment_metadata

Config file keysend_environment_metadata
System environment keyAPPSIGNAL_SEND_ENVIRONMENT_METADATA
Requiredno
TypeBoolean (true / false)
Default valuetrue
Available since version0.1.0

Description

Send environment metadata about the app.

For more information please read about environment metadata.

Agent only: when using an external collector, this configuration option does not have any effect.

send_function_parameters

Config file keysend_function_parameters
System environment keyAPPSIGNAL_SEND_FUNCTION_PARAMETERS
Requiredno
TypeBoolean (true / false)
Default valuetrue
Available since version1.6.0

Description

Whether to send function parameters to AppSignal.

Collector only: this configuration option will only have an effect when using an external collector.

See the send_params configuration option for sending data when not using the agent.

send_params

Config file keysend_params
System environment keyAPPSIGNAL_SEND_PARAMS
Requiredno
TypeBoolean (true / false)
Default valuetrue
Available since version0.1.0

Description

Whether to skip sending request parameters to AppSignal.

For more information please read about send_params in filtering request parameters.

Agent only: when using an external collector, this configuration option does not have any effect.

See the following configuration options for sending parameters when using an external collector:

send_request_payload

Config file keysend_request_payload
System environment keyAPPSIGNAL_SEND_REQUEST_PAYLOAD
Requiredno
TypeBoolean (true / false)
Default valuetrue
Available since version1.6.0

Description

Whether to send request payload to AppSignal.

Collector only: this configuration option will only have an effect when using an external collector.

See the send_params configuration option for sending data when not using the agent.

send_request_query_parameters

Config file keysend_request_query_parameters
System environment keyAPPSIGNAL_SEND_REQUEST_QUERY_PARAMETERS
Requiredno
TypeBoolean (true / false)
Default valuetrue
Available since version1.6.0

Description

Whether to send request query parameters to AppSignal.

Collector only: this configuration option will only have an effect when using an external collector.

See the send_params configuration option for sending data when not using the agent.

send_session_data

Config file keysend_session_data
System environment keyAPPSIGNAL_SEND_SESSION_DATA
Requiredno
TypeBoolean (true / false)
Default valuetrue
Available since version0.1.0

Description

Set this option to false to not send any session data with exception traces and performance issue samples.

For more information please read about request session data filtering.

service_name

Config file keyservice_name
System environment keyAPPSIGNAL_SERVICE_NAME
Requiredno
TypeString
Default value``
Available since version1.6.0

Description

The service name helps AppSignal recognize different services for traces and groups the traces automatically in a namespace based on the service name.

Choose a name that fits your application, like "Web server", "Background worker", "Email service", "Authentication service", etc.

Collector only: this configuration option will only have an effect when using an external collector.

statsd_port

Config file keystatsd_port
System environment keyAPPSIGNAL_STATSD_PORT
Requiredno
TypeInteger
Default value8125
Available since version0.2.2

Description

Set this option to configure the StatsD HTTP server port of the AppSignal agent process. Configure this port if another process is already running on the machine that is also using this port to avoid conflicts.

Agent only: when using an external collector, this configuration option does not have any effect.

working_directory_path

Config file keyworking_directory_path
System environment keyAPPSIGNAL_WORKING_DIRECTORY_PATH
Requiredno
TypeString
Default valuedetected by agent
Available since version0.1.0

Description

Override the location where AppSignal for Python can store temporary files. Use this option if the default location is not suitable. See our how AppSignal operates page for more information about the purpose of this working directory.

If you are running multiple applications using AppSignal on the same server, use this configuration option to select different working directories for every AppSignal instance, otherwise the two instances could conflict with one another. For more information on this scenario see our running multiple applications on one host documentation.

Python
# __appsignal__.py appsignal = Appsignal( # Other config working_directory_path="/tmp/project_1" )

Note: The specified path cannot contain Operating Specific file system abstractions, such as the homedir symbol ~ for *NIX systems. This will be seen as a malformed path.

Agent only: when using an external collector, this configuration option does not have any effect.