-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
Garot Conklin edited this page Feb 6, 2025
·
1 revision
This guide helps you diagnose and resolve common issues when using the DataDog Dashboard Deployer.
Error: Unauthorized. Please check your API/Application keysSolution:
- Verify environment variables are set correctly:
echo $DATADOG_API_KEY echo $DATADOG_APP_KEY
- Check key permissions in DataDog
- Ensure keys are valid and not expired
- Verify correct API endpoint for your region
Error: Invalid configuration in dashboard.yamlCommon Causes:
-
Invalid YAML syntax
# Invalid dashboards: name: "My Dashboard" # Missing hyphen for list # Valid dashboards: - name: "My Dashboard"
-
Missing required fields
# Invalid - missing required fields dashboards: - name: "My Dashboard" # Valid dashboards: - name: "My Dashboard" description: "System metrics dashboard" widgets: []
-
Invalid widget configuration
# Invalid widget type widgets: - title: "CPU Usage" type: "unknown_type" # Valid widget type widgets: - title: "CPU Usage" type: "timeseries"
Error: Failed to deploy dashboard "System Overview"Troubleshooting Steps:
-
Run with debug logging:
datadog-dashboard-deploy --debug config.yaml
-
Use dry-run mode:
datadog-dashboard-deploy --dry-run config.yaml
-
Check API rate limits:
# View rate limit headers in response curl -I -H "DD-API-KEY: ${DATADOG_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DATADOG_APP_KEY}" \ "https://api.datadoghq.com/api/v1/dashboard"
# Common query problems
queries:
# Too many group by terms
bad: "avg:system.cpu.user{*} by {host,region,az,service,version}"
# Better - limited cardinality
good: "avg:system.cpu.user{service:web} by {host}"Solutions:
- Reduce query complexity
- Limit group by terms
- Use appropriate time aggregation
- Add relevant filters
Causes:
- Too many widgets
- Complex queries
- High cardinality metrics
Solutions:
# Optimize widget count
dashboards:
- name: "System Overview"
widgets:
# Limit to essential metrics
- title: "CPU Usage"
type: "timeseries"
query: "avg:system.cpu.user{service:$service}.rollup(avg, 300)"Monitoring:
# Check API rate limits
curl -I -H "DD-API-KEY: ${DATADOG_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DATADOG_APP_KEY}" \
"https://api.datadoghq.com/api/v1/usage/summary"Solutions:
- Implement rate limiting
- Batch updates
- Use caching where appropriate
| Code | Description | Solution |
|---|---|---|
| 401 | Unauthorized | Check API/App keys |
| 403 | Forbidden | Check permissions |
| 429 | Rate Limited | Implement backoff |
| 500 | Server Error | Retry with exponential backoff |
try:
deployer.deploy("config.yaml")
except AuthError:
# Handle authentication errors
check_credentials()
except RateLimitError:
# Handle rate limiting
implement_backoff()
except ValidationError as e:
# Handle configuration errors
print(f"Configuration error: {e}")# Enable debug output
export DATADOG_DASHBOARD_DEBUG=1
datadog-dashboard-deploy config.yaml# Validate configuration
datadog-dashboard-deploy --validate config.yaml
# Dry run deployment
datadog-dashboard-deploy --dry-run config.yaml# Example debug code
response = api.create_dashboard(config)
print(f"Status: {response.status_code}")
print(f"Headers: {response.headers}")
print(f"Body: {response.json()}")- Check logs for detailed error messages
- Review Configuration Guide
- Search GitHub Issues
- Contact support:
- Open GitHub issue
- Email support@your-org.com
- Join Slack channel #dashboard-deployer