Node.js 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 topic.
Available options
- Required options
- Options
- caFilePath
- debug
- dnsServers
- enableHostMetrics
- enableMinutelyProbes
- enableStatsd
- filesWorldAccessible
- filterParameters
- filterSessionData
- hostname
- httpProxy
- ignoreActions
- ignoreErrors
- ignoreNamespaces
- instrumentHttp
- instrumentPg
- instrumentRedis
- log
- logLevel
- logPath
- requestHeaders
- revision
- sendEnvironmentMetadata
- sendParams
- sendSessionData
- workingDirectoryPath
active
Config file key | active |
---|---|
System environment key | APPSIGNAL_ACTIVE |
Required | yes |
Type | Boolean (true / false ) |
Default value | false |
Description
Configure AppSignal to be active or not for a given environment. Most commonly used in the file configuration per environment.
apiKey
Config file key | apiKey |
---|---|
System environment key | APPSIGNAL_PUSH_API_KEY |
Required | yes |
Type | String |
Default value | nil (This is unset by default) |
Available since version | 1.0.0 |
Deprecated since version 2.2.5 in favor of the pushApiKey config option. |
Description
Deprecated config option. Use the pushApiKey
config option instead.
environment
Config file key | environment |
---|---|
System environment key | APPSIGNAL_APP_ENV |
Required | yes |
Type | String |
Default value | Read from environment variable |
Description
The environment of the app to be reported to AppSignal.
name
Config file key | name |
---|---|
System environment key | APPSIGNAL_APP_NAME |
Required | yes |
Type | String |
Default value | nil |
Description
Name of your application as it should be displayed on AppSignal.com.
pushApiKey
Config file key | pushApiKey |
---|---|
System environment key | APPSIGNAL_PUSH_API_KEY |
Required | yes |
Type | String |
Default value | nil (This is unset by default) |
Available since version | 2.2.5 |
This config option was renamed from apiKey in version 2.2.5. |
Description
The organization-level authentication key to authenticate with our Push API.
Read more about the AppSignal Push API key.
caFilePath
Config file key | caFilePath |
---|---|
System environment key | APPSIGNAL_CA_FILE_PATH |
Required | no |
Type | String |
Default value | Packaged cacert.pem file path. |
Description
- Use this option to point to another certificate file if there's a problem connecting to our API.
debug
Config file key | debug |
---|---|
System environment key | APPSIGNAL_DEBUG |
Required | no |
Type | Boolean (true / false ) |
Default value | false |
Available since version | 1.0.0 |
Deprecated since version 2.2.6 in favor of the log_level config option. |
Description
Enable debug logging, this is usually only needed on request from support. With this option enabled AppSignal will log a lot more information about decisions that are made during metrics collection and when data is sent to AppSignal.com servers.
Enabling debug logging 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.
dnsServers
Config file key | dnsServers |
---|---|
System environment key | APPSIGNAL_DNS_SERVERS |
Required | no |
Type | list(String) |
Default value | [] |
Description
Configure DNS servers for the AppSignal agent to use.
# 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
.
enableHostMetrics
Config file key | enableHostMetrics |
---|---|
System environment key | APPSIGNAL_ENABLE_HOST_METRICS |
Required | no |
Type | Boolean (true / false ) |
Default value |
|
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.
enableMinutelyProbes
Config file key | enableMinutelyProbes |
---|---|
System environment key | APPSIGNAL_ENABLE_MINUTELY_PROBES |
Required | no |
Type | Boolean (true / false ) |
Default value | true |
Available since version | 0.4.0 |
2.3.0 : Support added for the environment variable option. | |
2.3.0 : Disables the minutely probes system from reporting metrics. Before version 2.3.0 it only unregistered the default probes. |
Description
Enables the minutely probes system.
enableStatsd
Config file key | enableStatsd |
---|---|
System environment key | APPSIGNAL_ENABLE_STATSD |
Required | no |
Type | Boolean (true / false ) |
Default value | false |
Available since version | 2.2.2 |
Description
Enables the StatsD server in the AppSignal agent.
filesWorldAccessible
Config file key | filesWorldAccessible |
---|---|
System environment key | APPSIGNAL_FILES_WORLD_ACCESSIBLE |
Required | no |
Type | Boolean (true / false ) |
Default value | true |
Available since version | 2.2.4 |
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
).
filterParameters
Config file key | filterParameters |
---|---|
System environment key | APPSIGNAL_FILTER_PARAMETERS |
Required | no |
Type | list(String) |
Default value | [] |
Available since version | 2.2.5 |
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.
filterSessionData
Config file key | filterSessionData |
---|---|
System environment key | APPSIGNAL_FILTER_SESSION_DATA |
Required | no |
Type | list(String) |
Default value | [] |
Available since version | 2.2.5 |
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.
hostname
Config file key | hostname |
---|---|
System environment key | APPSIGNAL_HOSTNAME |
Required | no |
Type | String |
Default value | detected from system |
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.
httpProxy
Config file key | httpProxy |
---|---|
System environment key | APPSIGNAL_HTTP_PROXY |
Required | no |
Type | String |
Default value | nil (This is unset by default) |
Description
If you require the agent to connect to the Internet via a proxy set the complete proxy URL in this configuration key.
ignoreActions
Config file key | ignoreActions |
---|---|
System environment key | APPSIGNAL_IGNORE_ACTIONS |
Required | no |
Type | list(String) |
Default value | [] |
Description
List of actions that will be ignored, everything that happens including exceptions will not be transmitted to AppSignal.
Read more about ignoring actions.
ignoreErrors
Config file key | ignoreErrors |
---|---|
System environment key | APPSIGNAL_IGNORE_ERRORS |
Required | no |
Type | list(String) |
Default value | [] |
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.
ignoreNamespaces
Config file key | ignoreNamespaces |
---|---|
System environment key | APPSIGNAL_IGNORE_NAMESPACES |
Required | no |
Type | list(String) |
Default value | [] |
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.
instrumentHttp
Config file key | instrumentHttp |
---|---|
System environment key | APPSIGNAL_INSTRUMENT_HTTP |
Required | no |
Type | Boolean (true / false ) |
Default value | true |
Available since version | 2.4.0 |
Description
Whether to enable instrumentation for HTTP requests, can be true
or false
. We recommend this remains enabled, because other integrations like Express, Koa.js, etc. rely on it.
instrumentPg
Config file key | instrumentPg |
---|---|
System environment key | APPSIGNAL_INSTRUMENT_PG |
Required | no |
Type | Boolean (true / false ) |
Default value | true |
Available since version | 2.4.0 |
Description
Whether to enable instrumentation for PostgreSQL queries using the pg package, can be true
or false
.
instrumentRedis
Config file key | instrumentRedis |
---|---|
System environment key | APPSIGNAL_INSTRUMENT_REDIS |
Required | no |
Type | Boolean (true / false ) |
Default value | true |
Available since version | 2.4.0 |
Description
Whether to enable the instrumentation for Redis queries using the Redis package, can be true
or false
.
log
Config file key | log |
---|---|
System environment key | APPSIGNAL_LOG |
Required | no |
Type | String |
Default value | file |
Description
Select which logger to the AppSignal agent should 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.
logLevel
Config file key | logLevel |
---|---|
System environment key | APPSIGNAL_LOG_LEVEL |
Required | no |
Type | String |
Default value | info |
Available since version | 2.2.6 |
Description
Set the severity level of the AppSignal 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
logPath
Config file key | logPath |
---|---|
System environment key | APPSIGNAL_LOG_PATH |
Required | no |
Type | String |
Default value | /tmp |
Description
Override the location of the path (directory) where the appsignal.log
file can be written to.
requestHeaders
Config file key | requestHeaders |
---|---|
System environment key | APPSIGNAL_REQUEST_HEADERS |
Required | no |
Type | list(String) |
Default value | ["accept", "accept-charset", "accept-encoding", "accept-language", "cache-control", "connection", "content-length", "range"] |
Available since version | 2.2.5 |
Description
The requestHeaders
config option contains a list of HTTP request headers which are read and stored by the AppSignal Node.js package.
This requestHeaders
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.
client = Appsignal.new(
// ...Other config opts
requestHeaders: [
"accept",
"accept-charset",
"accept-encoding",
"accept-language",
"cache-control",
"connection",
"content-length",
"range"
]
)
To configure AppSignal to not store any HTTP request headers on AppSignal transactions, configure the option with an empty list.
client = Appsignal.new(
// ...Other config opts
requestHeaders: []
)
revision
Config file key | revision |
---|---|
System environment key | APP_REVISION |
Required | no |
Type | String |
Default value | nil (This is unset by default) |
Available since version | 1.0.0 |
Description
Set the app revision for the currently running version of your app. Used to create deploy markers and tag all incoming data to a certain deploy for the host.
When using Heroku with the Heroku Labs: Dyno Metadata enabled it will automatically set the revision
config option to to the HEROKU_SLUG_COMMIT
system environment variable. This will automatically report new deploys when the Heroku app gets deployed. The revision can still be overwritten by setting the revision
config option yourself.
Read more about deploy markers on the deploy markers.
sendEnvironmentMetadata
Config file key | sendEnvironmentMetadata |
---|---|
System environment key | APPSIGNAL_SEND_ENVIRONMENT_METADATA |
Required | no |
Type | Boolean (true / false ) |
Default value | true |
Available since version | 2.2.6 |
Description
Send environment metadata about the app.
For more information please read about environment metadata.
sendParams
Config file key | sendParams |
---|---|
System environment key | APPSIGNAL_SEND_PARAMS |
Required | no |
Type | Boolean (true / false ) |
Default value | true |
Available since version | 2.2.8 |
Description
Whether to skip sending request parameters to AppSignal.
For more information please read about send_params in filtering request parameters.
sendSessionData
Config file key | sendSessionData |
---|---|
System environment key | APPSIGNAL_SEND_SESSION_DATA |
Required | no |
Type | Boolean (true / false ) |
Default value | true |
Available since version | 2.2.9 |
Description
Set this option to false
to not send any session data with exception traces and performance issue samples.
workingDirectoryPath
Config file key | workingDirectoryPath |
---|---|
System environment key | APPSIGNAL_WORKING_DIRECTORY_PATH |
Required | no |
Type | String |
Default value | detected by agent |
Available since version | 1.0.0 |
Description
Override the location where AppSignal for Node.js 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.
// Example: appsignal.js
const { Appsignal } = require("@appsignal/nodejs");
const appsignal = new Appsignal({
// Other config
workingDirectoryPath: "/tmp/project_1"
});