A professional grade Datadog data downloader that helps you fetch metrics from your Datadog account.
- pyenv
- pyenv-virtualenv
- Poetry package manager
- VSCode (optional)
- Set up Python environment:
# Install Python 3.9
pyenv install 3.9.18
# Create virtualenv
pyenv virtualenv 3.9.18 datadog-downloader
# Activate virtualenv
pyenv local datadog-downloader
# Verify Python version
python --version # Should show Python 3.9.18
- Clone the repository:
git clone <repository-url>
cd datadog-downloader
- Install dependencies using Poetry:
poetry install
- Install the Python extension for VSCode
- Open the command palette (Cmd/Ctrl + Shift + P)
- Search for "Python: Select Interpreter"
- Choose the interpreter at
.venv/bin/python
The included .vscode/settings.json
will:
- Set up the correct Python interpreter
- Enable format on save with black
- Enable automatic import sorting with isort
Create a .env
file in the root directory with your Datadog credentials:
DATADOG_API_KEY=your_api_key_here
DATADOG_APP_KEY=your_app_key_here
DATADOG_SITE=datadoghq.com # Optional, defaults to datadoghq.com
To get your API and application keys:
- Log into your Datadog account
- Navigate to Organization Settings > API Keys
- Create a new API key or use an existing one
- Navigate to Team > Application Keys to create or use an existing application key
- Activate the Poetry virtual environment:
poetry shell
- Run the application:
# Command line usage instructions will be added as features are implemented
This project uses several development tools:
black
for code formattingisort
for import sortingflake8
for code lintingmypy
for type checkingpytest
for testing
To run the development tools:
# Format code
poetry run black .
poetry run isort .
# Run linting
poetry run flake8 .
# Run type checking
poetry run mypy .
# Run tests
poetry run pytest
After cloning the repository:
- Copy the environment template:
cp .env.example .env
- Add your Datadog credentials to
.env
(never commit this file)
- Activate the Poetry virtual environment:
poetry shell
- Run the application:
poetry run python -m datadog_downloader.main