Installation & Setup π°
Install the Python client
pip install iudex
Create a write-only API key π
Click settings in the top left corner of the IUDEX dashboard and create a write-only API key.
Add IUDEX into your app π
Add the following code to the very top of your entrypoint file (usually main.py
, app.py
, etc.).
from iudex import instrument
instrument(
service_name="YOUR_SERVICE_NAME", # Highly encouraged
iudex_api_key="WRITE_ONLY_IUDEX_KEY", # Only ever commit your WRITE ONLY key
github_url="GITHUB_URL_TO_YOUR_REPO", # Optional, this sets up code linking
env="prod", # Optional, dev, local, etc
)
# ^ Must run above all imports
Set up Slack alerts π£
Click the Slack logo in the top right of the dashboard and follow the prompts.
Note: you must have admin permissions to add apps to your workspace.
Create a log πͺ΅
Add code to emit a log in your app.
# import logging
# logger = logging.getLogger(__name__)
logger.info("Hello IUDEX!", extra={"iudex.slack_channel_id": "YOUR_SLACK_CHANNEL_ID"})
Then run your app to emit the log.
Verify π§
You should see the log in Slack and in your IUDEX dashboard log view.
Go in-depth π
Check out more in-depth guides on how to get the most out of IUDEX for your stack.