Python Configuration

Python Configuration

How can I configure Scout for Python?

Scout can be configured via three methods:

  1. Scout Config API :
from scout_apm.api import ConfigConfig.set(    key="YOUR_KEY",    name="My App",    monitor=True,)
  1. Framework settings (e.g., Django’s settings.py or Flask’s app.config)
  2. Environment variables: Uppercase the key and prefix with SCOUT_ (e.g., SCOUT_KEY, SCOUT_NAME)

What are the required configuration settings?

Setting Description
key Your organization API key from Scout UI
name Application name (e.g., “Photos App”)
monitor Set to True to enable monitoring

How do I configure different environments?

Use unique app names for each environment to keep data separate:

exportSCOUT_KEY=yourkeyexportSCOUT_NAME="My App (Production)"

For staging: SCOUT_NAME="My App (Staging)"

How do I ignore certain URL paths?

Use the ignore configuration option:

Config.set(    ignore=["/health-check/", "/admin/"],)

Or via environment variable:

exportSCOUT_IGNORE='/health-check/,/admin/'

What Core Agent configurations are available?

The Core Agent handles data transmission. Key options include:

Setting Description Default
core_agent_dir Directory for Core Agent /tmp/scout_apm_core
core_agent_download Auto-download Core Agent True
core_agent_launch Auto-start Core Agent True
core_agent_log_level Log level (trace, debug, info, warn, error) info
core_agent_socket_path Socket path for connection tcp://127.0.0.1:6590

How do I enable debug logging?

For debugging, you can: - Set core_agent_log_level to debug or trace - Set log_payload_content to True to log payloads sent to the core agent