Skip to main content

A framework for deploying DataDog dashboards as code

Project description

DataDog Dashboard Deployer

A powerful framework for deploying DataDog dashboards as code using CI/CD pipelines. Define, version, and automate your DataDog dashboard deployments using YAML configurations.

versions

PyPI version PyPI version Python

health

Quality Gate Status Overall Coverage Security Rating Maintainability Rating Vulnerabilities Dependabot Status Code style: black

stats

Downloads License: MIT

Features

  • ๐Ÿš€ 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

Quick Start

Installation

pip install datadog-dashboard-deployer

Basic Usage

  1. Set up your DataDog credentials:
export DATADOG_API_KEY='your-api-key'
export DATADOG_APP_KEY='your-application-key'
  1. 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{*}"
  1. Deploy your dashboard:
datadog-dashboard-deploy config/dashboard_config.yaml

Project Structure

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

Documentation

GitHub Actions Integration

  1. Add DataDog credentials as secrets:

    • Go to repository Settings > Secrets and Variables > Actions
    • Add DATADOG_API_KEY and DATADOG_APP_KEY
  2. 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

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Clone the repository:
git clone https://github.com/fleXRPL/datadog-dashboard-deployer.git
cd datadog-dashboard-deployer
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install development dependencies:
pip install -r requirements-dev.txt

Security

  • API keys are stored securely as environment variables or GitHub secrets
  • Regular security audits and dependency updates
  • See our Security Policy for details

Support

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datadog_dashboard_deployer-0.1.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datadog_dashboard_deployer-0.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file datadog_dashboard_deployer-0.1.0.tar.gz.

File metadata

File hashes

Hashes for datadog_dashboard_deployer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 381dae1150a435b1d8dbe519e931b2f01dfe4860c565d09d8ffde618887f4d55
MD5 afc704c37bcc86f5ae122ed99bbfe228
BLAKE2b-256 f4aa627561099fdb4c7bfb15fc2c303c13d0c503349191d66bdd27ccdd0d683d

See more details on using hashes here.

Provenance

The following attestation bundles were made for datadog_dashboard_deployer-0.1.0.tar.gz:

Publisher: workflow.yml on fleXRPL/datadog-dashboard-deployer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file datadog_dashboard_deployer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for datadog_dashboard_deployer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c59f58901d8dfa9c1817ed6dd39a3bbee5945f55c6b1eb2060244e90b70e7b0
MD5 c1d7fd0a7722cc7f191fe2ccfa204038
BLAKE2b-256 7d68f4386e68cec6417898b19db247c62f217bb7f2dc9af246c4cc680d61e5db

See more details on using hashes here.

Provenance

The following attestation bundles were made for datadog_dashboard_deployer-0.1.0-py3-none-any.whl:

Publisher: workflow.yml on fleXRPL/datadog-dashboard-deployer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page