Hud SDK Configuration

Environment Variables

Hud uses the following environment variables when running on your service:

Var nameDescriptionUsage
HUD_ENABLEHud will run only when this var value is set to true (default is false).HUD_ENABLE=true
HUD_KEYA secret API authentication token (provided by a Hud member). Your service data will be available on the Hud platform by selecting the environment mentioned at the key prefix.HUD_KEY=local_f47..3e
HUD_SERVICEUnique service name to your choice, that will be used across the Hud platform to consume information about your service.HUD_SERVICE=my_service
HUD_INCLUDE_MODULES (optional)A comma-separated list of glob expressions with additional modules Hud will track. Use this when internal modules are installed as external packages (e.g., from PyPI or npm), as these packages will not be automatically monitored by default.HUD_INCLUDE_MODULES=hud-core,hud/*
HUD_CONFIG_PATH (optional)A path to a file containing configurations as stated below. Could be an absolute path or relative to the process' working directory.HUD_CONFIG_PATH= /home/proj/hud.config


Configuration File

Hud uses a JSON config file named hud.config placed within the root folder, or at a path configured by the environment variable HUD_CONFIG_PATH.

Var nameDescriptionUsage
enableHud will run only when this var value is set to true (default is false)."enable": true
keyA secret API authentication token (provided by a Hud member). Your service data will be available on the Hud platform by selecting the environment mentioned at the key prefix."key": "local_f47..3e"
serviceUnique service name to your choice, that will be used across the Hud platform to consume information about your service."service": "my_service"
includeModules (optional)A comma-separated list of glob expressions with additional Hud will track. Use this when internal modules are installed as external packages (e.g., from PyPI or npm), as these packages will not be automatically monitored by default."includeModules": ["hud-core", "hud/*"]
{
  "enable": true,
  "key": "[YOUR_API_KEY]",
  "service": "[YOUR_SERVICE_NAME]"
}

📘

Configuration Precedence

Hud's SDK supports configuration via both environment variables and a configuration file, and via the code on specific cases. When both are provided, the following precedence applies:

  1. Direct init() function call (on applicable properties)
  2. Environment variables
  3. Configuration file