Skip to content

Installation

Garot Conklin edited this page Feb 6, 2025 · 3 revisions

Installation Guide

This guide provides detailed instructions for installing and setting up the DataDog Dashboard Deployer package.

Prerequisites

Before installing the package, ensure you have:

  1. Python 3.8 or higher installed
  2. pip package manager
  3. A DataDog account with API and Application keys
  4. Git installed (for development setup)

Installation Methods

1. From PyPI (Recommended)

pip install datadog-dashboard-deployer

2. From Source

git clone https://github.com/fleXRPL/datadog-dashboard-deployer.git
cd datadog-dashboard-deployer
pip install -e .

Development Setup

  1. Clone the repository:

    git clone https://github.com/fleXRPL/datadog-dashboard-deployer.git
    cd datadog-dashboard-deployer
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install development dependencies:

    pip install -r requirements-dev.txt

Configuration

  1. Set up DataDog credentials:

    export DATADOG_API_KEY='your-api-key'
    export DATADOG_APP_KEY='your-application-key'
  2. Create a basic configuration file:

    # config/dashboard_config.yaml
    dashboards:
      - name: "My First Dashboard"
        description: "Example dashboard"
        layout_type: "ordered"
        widgets:
          - title: "Example Widget"
            type: "timeseries"
            query: "avg:system.cpu.user{*}"

GitHub Actions Setup

  1. Add DataDog credentials as GitHub Secrets:

    • Go to your repository settings
    • Navigate to Secrets and Variables > Actions
    • Add the following secrets:
      • DATADOG_API_KEY
      • DATADOG_APP_KEY
  2. Create the 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: Install dependencies
            run: |
              pip install datadog-dashboard-deployer
          - name: Deploy dashboards
            env:
              DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
              DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY }}
            run: |
              datadog-dashboard-deploy config/dashboard_config.yaml

Verification

  1. Verify installation:

    python -c "import datadog_dashboard_deployer; print(datadog_dashboard_deployer.__version__)"
  2. Test configuration:

    datadog-dashboard-deploy --validate config/dashboard_config.yaml

Troubleshooting

Common Issues

  1. API Authentication Errors

    • Verify API and Application keys are correct
    • Check environment variables are properly set
    • Ensure keys have proper permissions
  2. Installation Errors

    • Update pip: pip install --upgrade pip
    • Check Python version compatibility
    • Verify all dependencies are installed
  3. Configuration Errors

    • Validate YAML syntax
    • Check configuration schema
    • Ensure all required fields are present

Getting Help

Next Steps

Clone this wiki locally