AppSignal for PHP configuration options
AppSignal for PHP can be configured through the config/appsignal.php file or by using environment variables. This page lists all available configuration options.
Learn more about the configuration load order.
Once you have configured AppSignal, you can validate the current config:
vendor/bin/appsignal validate
Available options
- Required options
- Options
- active
- app_path
- filter_attributes
- filter_function_parameters
- filter_request_payload
- filter_request_query_parameters
- filter_request_session_data
- hostname
- ignore_actions
- ignore_errors
- ignore_logs
- ignore_namespaces
- request_headers
- response_headers
- revision
- send_function_parameters
- send_request_payload
- send_request_query_parameters
- send_request_session_data
- service_name
collector_endpoint
| Config file key | collector_endpoint |
|---|---|
| System environment key | APPSIGNAL_COLLECTOR_ENDPOINT |
| Required | yes |
| Type | String |
| Default value | null (unset by default) |
Description
The URL of the AppSignal collector to send trace, metric, and log data to.
AppSignal shows this URL when you create a new application, and it's also available for existing applications.
return [ 'collector_endpoint' => $_ENV['APPSIGNAL_COLLECTOR_ENDPOINT'] ?? null, // ... other options ];
environment
| Config file key | environment |
|---|---|
| System environment key | APPSIGNAL_APP_ENV |
| Required | yes |
| Type | String |
| Default value | null (unset by default) |
Description
The environment of the app to be reported to AppSignal.
return [ 'environment' => $_ENV['APPSIGNAL_APP_ENV'] ?? 'production', // ... other options ];
name
| Config file key | name |
|---|---|
| System environment key | APPSIGNAL_APP_NAME |
| Required | yes |
| Type | String |
| Default value | null (unset by default) |
Description
The display name of your application on AppSignal.com.
return [ 'name' => 'My App', // ... other options ];
push_api_key
| Config file key | push_api_key |
|---|---|
| System environment key | APPSIGNAL_PUSH_API_KEY |
| Required | yes |
| Type | String |
| Default value | null (unset by default) |
Description
The organization-level key used to authenticate with the Push API.
Read more about the AppSignal Push API key.
return [ 'push_api_key' => $_ENV['APPSIGNAL_PUSH_API_KEY'] ?? '00000000-0000-0000-0000-000000000000', // ... other options ];
active
| Config file key | active |
|---|---|
| System environment key | APPSIGNAL_ACTIVE |
| Required | no |
| Type | Boolean (true / false) |
| Default value | false |
Description
Configure whether AppSignal is active for a given environment. Most commonly used in the file configuration per environment.
app_path
| Config file key | app_path |
|---|---|
| Required | no |
| Type | String |
| Default value | detected from project root |
Description
The location of the app on the host's file system.
Helps AppSignal clean up backtraces by stripping the absolute app path from backtrace lines, showing only paths within the project directory. This makes our Backtrace links feature possible.
The AppSignal package sets this value automatically based on the detected project root. If the automatic app path detection doesn't work, you can override it:
return [ 'app_path' => '/var/www/html/your-app' // ... other options ];
filter_attributes
| Config file key | filter_attributes |
|---|---|
| System environment key | APPSIGNAL_FILTER_ATTRIBUTES |
| Required | no |
| Type | Array<String> |
| Default value | [] |
Description
The filter_attributes config option allows you to filter out specific attributes from being reported to AppSignal. This can be useful to filter out sensitive or non-relevant information from being reported.
If an attribute is filtered out this way, it will not show up in the interface at all.
return [ 'filter_attributes' => ['my.secret.attribute', 'some.opentelemetry.attribute'], // ... other options ];
filter_function_parameters
| Config file key | filter_function_parameters |
|---|---|
| System environment key | APPSIGNAL_FILTER_FUNCTION_PARAMETERS |
| Required | no |
| Type | Array<String> |
| Default value | [] |
Description
This config option allows you to filter out any function parameters set in the appsignal.function.parameters span attribute.
AppSignal replaces values for the keys listed in the filter_function_parameters config option with [FILTERED].
return [ 'filter_function_parameters' => ['api_token', 'secret'], // ... other options ];
filter_request_payload
| Config file key | filter_request_payload |
|---|---|
| System environment key | APPSIGNAL_FILTER_REQUEST_PAYLOAD |
| Required | no |
| Type | Array<String> |
| Default value | [] |
Description
This config option allows you to filter out any request payload data set in the appsignal.request.payload span attribute.
AppSignal replaces values for the keys listed in the filter_request_payload config option with [FILTERED].
Read more about request query parameter filtering.
return [ 'filter_request_payload' => ['password', 'cvv'], // ... other options ];
filter_request_query_parameters
| Config file key | filter_request_query_parameters |
|---|---|
| System environment key | APPSIGNAL_FILTER_REQUEST_QUERY_PARAMETERS |
| Required | no |
| Type | Array<String> |
| Default value | [] |
Description
This config option allows you to filter out any request query parameters set in the appsignal.request.query_parameters span attribute.
AppSignal replaces values for the keys listed in the filter_request_query_parameters config option with [FILTERED].
Read more about request query parameter filtering.
return [ 'filter_request_query_parameters' => ['password', 'cvv'], // ... other options ];
filter_request_session_data
| Config file key | filter_request_session_data |
|---|---|
| System environment key | APPSIGNAL_FILTER_REQUEST_SESSION_DATA |
| Required | no |
| Type | Array<String> |
| Default value | [] |
Description
The filter_request_session_data config option allows you to filter out any request session data set in the appsignal.request.session_data span attribute.
AppSignal replaces values for the keys listed in the filter_request_session_data config option with [FILTERED].
Read more about request session data filtering.
return [ 'filter_request_session_data' => ['password', 'cvv'], // ... other options ];
hostname
| Config file key | hostname |
|---|---|
| System environment key | APPSIGNAL_HOSTNAME |
| Required | no |
| Type | String |
| Default value | detected from system |
Description
Helps AppSignal recognize different hosts for traces and tag them automatically with the hostname.
The AppSignal package sets this value automatically using gethostname().
ignore_actions
| Config file key | ignore_actions |
|---|---|
| System environment key | APPSIGNAL_IGNORE_ACTIONS |
| Required | no |
| Type | Array<String> |
| Default value | [] |
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.
return [ 'ignore_actions' => ['GET /health_check', 'POST /ping'], // ... other options ];
ignore_errors
| Config file key | ignore_errors |
|---|---|
| System environment key | APPSIGNAL_IGNORE_ERRORS |
| Required | no |
| Type | Array<String> |
| Default value | [] |
Description
This config option allows you to ignore specific errors from being reported to AppSignal. This can be useful to ignore expected errors or errors that can't be solved.
Read more about ignoring errors.
return [ 'ignore_errors' => ['MyCustomError', 'ExpectedError'], // ... other options ];
ignore_logs
| Config file key | ignore_logs |
|---|---|
| System environment key | APPSIGNAL_IGNORE_LOGS |
| Required | no |
| Type | Array<String> |
| Default value | [] |
Description
List of log messages that will be ignored. Any log message containing any of the elements of the list will not be transmitted to AppSignal. A small subset of regex syntax is supported, read more about it in our Ignore Logs guide.
The expected format is a comma-separated list of values.
return [ 'ignore_logs' => ["^success", "OK"], // ... other options ];
ignore_namespaces
| Config file key | ignore_namespaces |
|---|---|
| System environment key | APPSIGNAL_IGNORE_NAMESPACES |
| Required | no |
| Type | Array<String> |
| Default value | [] |
Description
This config option allows you to ignore specific namespaces from being reported to AppSignal. This can be useful to ignore specific parts of your application from being monitored.
Read more about namespaces.
return [ 'ignore_namespaces' => ['admin', 'secret'], // ... other options ];
request_headers
| Config file key | request_headers |
|---|---|
| System environment key | APPSIGNAL_REQUEST_HEADERS |
| Required | no |
| Type | Array<String> |
| Default value | ["accept", "accept-charset", "accept-encoding", "accept-language", "cache-control", "connection", "content-length", "host", "range"] |
Description
Configure which request headers to include when a request is made to an HTTP server. This option is an allowlist. It only includes the headers that are configured. If the list is empty, no headers are included.
AppSignal reads request headers from the HTTP request. Each key is a normalized (lowercase) header name.
return [ 'request_headers' => ['accept-encoding', 'content-length', 'user-agent'], // ... other options ];
To configure AppSignal to not store any HTTP request headers, explicitly set the config value to an empty array.
return [ 'request_headers' => [], // ... other options ];
response_headers
| Config file key | response_headers |
|---|---|
| System environment key | APPSIGNAL_RESPONSE_HEADERS |
| Required | no |
| Type | Array<String> |
| Default value | ["accept", "accept-charset", "accept-encoding", "accept-language", "cache-control", "connection", "content-length", "date", "range"] |
Description
Configure which response headers to include when a request is made by an HTTP client. This option is an allowlist. It only includes the headers that are configured. If the array is empty, no headers are included.
Each item in this array should be a normalized HTTP response header name (lowercase).
return [ 'response_headers' => ['accept', 'accept-charset', 'accept-encoding'], // ... other options ];
To configure AppSignal to not store any HTTP response headers, explicitly set the config value to an empty array.
return [ 'response_headers' => [], // ... other options ];
revision
| Config file key | revision |
|---|---|
| System environment key | APPSIGNAL_REVISION |
| Required | no |
| Type | String |
| Default value | detected from git |
Description
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.
The AppSignal package sets this value automatically using git rev-parse HEAD.
Read more about deploy markers in the deploy markers topic.
send_function_parameters
| Config file key | send_function_parameters |
|---|---|
| System environment key | APPSIGNAL_SEND_FUNCTION_PARAMETERS |
| Required | no |
| Type | Boolean (true / false) |
| Default value | true |
Description
Configure whether to include function parameters in traces. If set to false no such data is sent to our servers.
These values are set with the appsignal.function.parameters span attribute.
return [ 'send_function_parameters' => false, // ... other options ];
send_request_payload
| Config file key | send_request_payload |
|---|---|
| System environment key | APPSIGNAL_SEND_REQUEST_PAYLOAD |
| Required | no |
| Type | Boolean (true / false) |
| Default value | true |
Description
Configure whether to send request payload data in traces. If set to false no such data is sent to our servers.
These values are set with the appsignal.request.payload span attribute.
For more information please read about request payload filtering.
return [ 'send_request_payload' => false, // ... other options ];
send_request_query_parameters
| Config file key | send_request_query_parameters |
|---|---|
| System environment key | APPSIGNAL_SEND_REQUEST_QUERY_PARAMETERS |
| Required | no |
| Type | Boolean (true / false) |
| Default value | true |
Description
Configure whether to include request query parameters in traces. If set to false no such data is sent to our servers.
These values are set with the appsignal.request.query_parameters span attribute.
For more information please read about request parameter filtering.
return [ 'send_request_query_parameters' => false, // ... other options ];
send_request_session_data
| Config file key | send_request_session_data |
|---|---|
| System environment key | APPSIGNAL_SEND_REQUEST_SESSION_DATA |
| Required | no |
| Type | Boolean (true / false) |
| Default value | true |
Description
Configure whether to send request session data in traces. If set to false no such data is sent to our servers.
These values are set with the appsignal.request.session_data span attribute.
For more information please read about request session data filtering.
return [ 'send_request_session_data' => false, // ... other options ];
service_name
| Config file key | service_name |
|---|---|
| System environment key | APPSIGNAL_SERVICE_NAME |
| Required | no |
| Type | String |
| Default value | null (unset by default) |
Description
The service name helps AppSignal recognize different services and automatically groups their traces into a matching namespace.
Choose a name that fits your application, like "Web server", "Background worker", "Email service", "Authentication service", etc.
return [ 'service_name' => 'My service name', // ... other options ];