Python Installation
Python support is currently in beta.
While the core functionality is stable, some features may evolve. We welcome your feedback during this phase.
SDK Installation Overview
- Install Hud SDK package 📦
- Run your service with Hud 🎉
- Install the IDE extension to see production data 📈
Install SDK package
pip install hud-sdk
poetry add hud-sdk
Run service with Hud
1. Set environment variables
The auto init makes use of the following environment variables.
HUD_ENABLE=true //Hud’s SDK will not be loaded without this being set to true
HUD_KEY=xxx //The API key provided to you, treat it as a secret
HUD_SERVICE=xxx //The service name which will identify this service
HUD_MODULES_TO_TRACE=server //The modules hud will trace, recommended when using running like gunicorn or celery; comma seprated string
2. Initialize service
Hud's SDK need to be imported and initialized as early as possible in your code, to make sure it instruments any forthcoming modules' functions. Call to init can be done after your imports. Note: the SDK does not instrument the functions in the file it's imported in.
# 1. Import Hud first
from hud_sdk.auto_hook import init
# 2. Add your imports
## from acme.api import SaveTheWorld
# 3. Initialize Hud magic
init(tags={'region':'us-east-1'})
# 4. Run your legendary code
## SaveTheWorld.run()
Install the IDE extension
To see Hud information for your service, install Hud's extension in VSCode or Pycharm, Webstorm..].
You’re all set! 🎉
Updated 17 days ago