A powerful framework for deploying DataDog dashboards as code using CI/CD pipelines. Define, version, and automate your DataDog dashboard deployments using YAML configurations.
- π Configuration as Code: Define dashboards using YAML configuration files
- π Automated Deployment: Deploy dashboards automatically via GitHub Actions
- π Rich Widget Support: Support for timeseries, query values, heatmaps, and more
- π Secure Credentials: Handle DataDog API credentials securely
- π¨ Templating Support: Create dynamic dashboards using Jinja2 templating
- π Extensible Architecture: Easy to extend and customize
pip install datadog-dashboard-deployer
- Set up your DataDog credentials:
export DATADOG_API_KEY='your-api-key'
export DATADOG_APP_KEY='your-application-key'
- Create a dashboard configuration:
# config/dashboard_config.yaml
version: "1.0"
dashboards:
- name: "System Overview"
description: "System performance metrics"
widgets:
- title: "CPU Usage"
type: "timeseries"
query: "avg:system.cpu.user{*}"
- title: "Memory Usage"
type: "timeseries"
query: "avg:system.mem.used{*}"
- Deploy your dashboard:
datadog-dashboard-deploy config/dashboard_config.yaml
datadog-dashboard-deployer/
βββ src/
β βββ datadog_dashboard_deployer/
β βββ __init__.py
β βββ core.py # Core logic for dashboard creation
β βββ config.py # Configuration handling
β βββ utils.py # Utility functions
βββ config/
β βββ dashboard_config.yaml # Main dashboard configuration
βββ .github/
β βββ workflows/
β βββ deploy.yml # GitHub Actions workflow
βββ tests/ # Test suite
βββ docs/ # Documentation
βββ requirements.txt # Project dependencies
βββ setup.py # Package configuration
βββ README.md
-
Add DataDog credentials as secrets:
- Go to repository Settings > Secrets and Variables > Actions
- Add
DATADOG_API_KEY
andDATADOG_APP_KEY
-
Create a workflow file:
# .github/workflows/deploy.yml
name: Deploy Dashboards
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Deploy dashboards
env:
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY }}
run: |
pip install datadog-dashboard-deployer
datadog-dashboard-deploy config/dashboard_config.yaml
We welcome contributions! Please see our Contributing Guide for details.
- Clone the repository:
git clone https://github.com/fleXRPL/datadog-dashboard-deployer.git
cd datadog-dashboard-deployer
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install development dependencies:
pip install -r requirements-dev.txt
- API keys are stored securely as environment variables or GitHub secrets
- Regular security audits and dependency updates
- See our Security Policy for details
- GitHub Issues for bug reports and feature requests
- GitHub Discussions for questions and community support
- Stack Overflow using the
datadog-dashboard-deployer
tag
This project is licensed under the MIT License - see the LICENSE file for details.
- DataDog for their excellent monitoring platform
- datadogpy for the official Python client
- All our contributors