Configuration

Configuration Options

The Node agent can be configured via two methods:

  1. Code Based
  2. Environment Variables

Code Based

Scout can be configured in the Scout.install function via passing in an object/dictionary with the configuration values:

await scout.install({
    allowShutdown: true, // allow shutting down spawned scout-agent processes from this program
    monitor: true, // enable monitoring
    name: "",
    key: "",
  });

Environment Variables

You can also configure Scout APM via environment variables. To configure Scout via enviroment variables, uppercase the config key and prefix it with SCOUT_. For example, to set the key configuration via environment variables use: export SCOUT_KEY=YOURKEY

Common Configurations

Setting Name Description Default Required
key The organization API key. Yes
name Name of the application (ex: ‘Photos App’). Yes
monitor Whether monitoring data should be reported. false Yes
log_level Override the SCOUT log level. Can only be used to quiet the agent, will not override the underlying logger’s level 'info' No

Additional Configurations

Setting Name Description Default Required
revision_sha The Git SHA associated with this release. See docs No
scm_subdirectory The relative path from the base of your Git repo to the directory which contains your application code. No
ignore_endpoints A string containing a JSON array of endpoints that Scout should ignore. [] No
disabled_instruments A string containing a JSON array of instruments that Scout should not install. [] No
hostname The hostname the metrics should be aggregrated under. hostname No

Core Agent Configurations

Setting Name Description Default Required
core_agent_dir Path to create the directory which will store the Core Agent. /tmp/scout_apm_core No
core_agent_download Whether to download the Core Agent automatically, if needed. True No
core_agent_launch Whether to start the Core Agent automatically, if needed. True No
core_agent_permissions The permission bits to set when creating the directory of the Core Agent. 700 No
core_agent_full_name The release/url we look for when downloading the core-agent. Auto-detected No
core_agent_triple If you are running a MUSL based Linux (such as ArchLinux), you may need to explicitly specify the platform triple. E.g. x86_64-unknown-linux-musl Auto detected No
core_agent_log_level The log level of the core agent process. This should be one of: "trace", "debug", "info", "warn", "error". This does not affect the log level of the NodeJS library. To change that, directly configure logging as per the documentation. "info" No
core_agent_log_file The log file for the core agent process "/path/to/your/log/file" No

Environments

It typically makes sense to treat each environment (production, staging, etc) as a separate application within Scout and ignore the development and test environments.

Configure a unique app name for each environment as Scout aggregates data by the app name. For example, app-staging might be used to represent a Staging environment where as app-production would represent a Production environment.