-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration Guide
Garot Conklin edited this page Feb 6, 2025
·
3 revisions
This guide provides comprehensive information about configuring the DataDog Dashboard Deployer package.
The package uses YAML configuration files to define dashboard layouts and settings. Here's the basic structure:
version: "1.0"
defaults:
layout_type: "ordered"
refresh_interval: 300
dashboards:
- name: "System Overview"
description: "System performance metrics"
layout_type: "ordered"
widgets:
- title: "CPU Usage"
type: "timeseries"
query: "avg:system.cpu.user{*}"version: "1.0" # Configuration version
defaults:
layout_type: "ordered" # Default layout type
refresh_interval: 300 # Default refresh interval in seconds
tags: # Default tags for all dashboards
- "team:infrastructure"
- "env:production"dashboards:
- name: "Dashboard Name" # Required
description: "Dashboard description" # Optional
layout_type: "ordered" # Optional (defaults to global setting)
tags: # Optional
- "team:infrastructure"
widgets: [] # Required (list of widgets)widgets:
- title: "CPU Usage"
type: "timeseries"
size: "medium"
query: "avg:system.cpu.user{*}"
visualization:
type: "line"
yaxis:
min: 0
max: 100widgets:
- title: "Total Requests"
type: "query_value"
query: "sum:http.requests{*}"
precision: 0
format: "number"widgets:
- title: "Response Times"
type: "heatmap"
query: "avg:http.response.time{*} by {host}"layout_type: "ordered" # or "free"
layout:
height: 800
width: 1200
widgets:
- widget_id: "w1"
x: 0
y: 0
width: 600
height: 400DATADOG_API_KEY=your-api-key
DATADOG_APP_KEY=your-application-keyDATADOG_SITE=datadoghq.com # Default site
DATADOG_HOST=https://api.datadoghq.com # API endpointtemplate_variables:
- name: "env"
prefix: "env"
default: "prod"
- name: "service"
prefix: "service"
default: "*"template_variables:
- name: "datacenter"
prefix: "datacenter"
default: "us-east-1"
values:
- "us-east-1"
- "us-west-2"
- "eu-west-1"query: "avg:system.cpu.user{$env} by {host}"events_query:
q: "sources:nagios status:error"
tags_execution: "and"logs_query:
query: "service:web-api status:error"
indexes: ["main"]dashboards:
- name: "{{env}} Service Dashboard"
template_variables:
- name: "env"
values: ["prod", "staging", "dev"]widgets:
- title: "Error Rate"
conditional_formats:
- comparator: ">"
value: 1
palette: "red"
- comparator: ">"
value: 0.5
palette: "yellow"widgets:
- title: "Service Status"
custom_links:
- label: "View Logs"
link: "https://app.datadoghq.com/logs"- Use meaningful dashboard and widget names
- Group related metrics together
- Use consistent naming conventions
- Include descriptions
- Limit the number of widgets per dashboard
- Use efficient queries
- Set appropriate refresh intervals
- Consider time ranges
- Use version control
- Document changes
- Test configurations
- Regular reviews
dashboards:
- name: "Basic System Monitoring"
description: "Essential system metrics"
widgets:
- title: "CPU Usage"
type: "timeseries"
query: "avg:system.cpu.user{*}"
- title: "Memory Usage"
type: "timeseries"
query: "avg:system.mem.used{*}"dashboards:
- name: "Web Application"
template_variables:
- name: "service"
prefix: "service"
default: "web-api"
widgets:
- title: "Request Rate"
type: "timeseries"
query: "sum:http.requests{service:$service}"
- title: "Error Rate"
type: "query_value"
query: "sum:http.errors{service:$service}"datadog-dashboard-deploy --validate config.yamldatadog-dashboard-deploy --dry-run config.yaml-
Invalid Configuration
# Wrong widgets: - type: "timeseries" # Missing required 'title' field # Correct widgets: - title: "Metric" type: "timeseries" query: "avg:system.cpu.user{*}"
-
Query Syntax
# Wrong query: "avg:system.cpu.user{env:prod}}" # Extra } # Correct query: "avg:system.cpu.user{env:prod}"