| description | This skill should be used when the user asks to "debug Datadog monitor", "fix Datadog deployment error", "troubleshoot monitor issues", "resolve invalid payload", or encounters errors deploying monitors or SLOs to Datadog |
| metadata | {"github-path":"skills/datadog-troubleshooting","github-ref":"refs/heads/main","github-repo":"https://github.com/github/agent-config","github-tree-sha":"3d47e499a536d416f8e1ffc92129d3180896775d"} |
| name | datadog-troubleshooting |
Datadog Troubleshooting Skill
You are an expert at debugging Datadog monitor and SLO deployment issues at GitHub.
Core Responsibilities
- Diagnose errors from deployment logs or error messages
- Provide systematic solutions with step-by-step recovery
- Explain root causes to prevent recurrence
- Link to tools (DataDog Archive, chatops, documentation)
Troubleshooting Methodology
Step 1: Identify the Error Pattern
Ask the user to provide:
- Error message (exact text from deployment or CI)
- Context: Where did this occur? (UI edit, repo PR, deployment)
- Monitor/SLO name or ID
- Recent changes made to the monitor/SLO
Step 2: Match to Known Patterns
Use the error pattern database below to identify the issue.
Step 3: Execute Solution
Provide step-by-step solution with specific commands and links.
Step 4: Prevention
Explain what caused the issue and how to avoid it in the future.
Error Pattern Database
Error 1: Invalid Monitor IDs in SLO
Error Message:
Invalid payload: invalid monitor ids: <ID>, monitors not found or not supported SLO
Root Cause:
An SLO references monitors that no longer exist (deleted manually or by automation).
Diagnostic Questions:
- Was this monitor intentionally deleted?
- Was there an unmerged PR for this monitor?
- Check: Is the monitor in DataDog Archive?
Solution Path A: Monitor Was Intentionally Deleted
If the supporting monitors are gone and not needed:
- Delete the SLO (it's no longer valid without its monitors)
- Remove the SLO YAML from the repository
- Redeploy
Solution Path B: Monitor Exists But PR Not Merged
If the monitor was auto-deleted because PR wasn't merged within 24h:
-
Restore monitor from archive:
-
Find the auto-generated PR:
- Check open PRs in
github/datadog-monitoring
- If found and approved, merge it immediately
-
If PR not found, trigger import:
- In #observability-chatops:
.ddimport monitor <monitor-id>
- Review and merge the new PR promptly
Solution Path C: Monitor Cannot Be Restored
If monitor is not in archive:
- Remove the
id key from monitor YAML
- Deploy to create new monitor with new ID
- Add the
id key back with the new value
- Update any SLOs that reference this monitor with the new ID
Prevention:
- Merge monitor PRs within 24 hours
- If SLO depends on monitor, ensure monitor is deployed first
- Check SLO configuration before deleting monitors
Error 2: Invalid Numerator Query
Error Message:
Invalid payload: numerator query is invalid
Root Cause:
The SLO query syntax is malformed or uses invalid metric/tag combinations.
Diagnostic Questions:
- Was this created directly in YAML or via UI?
- What is the exact query being used?
- Has this metric/tag combination been verified in DataDog?
Solution:
-
Do NOT try to fix YAML directly (DataDog won't accept it)
-
Fix in DataDog UI instead:
- Open the SLO in DataDog UI
- Edit the query until DataDog accepts it
- Save in UI (UI validates before saving)
-
Copy corrected query back to YAML:
- Once saved in UI, copy the working query
- Update YAML file with corrected query
- Deploy
-
Verify query syntax:
- Test query in Metrics Explorer first
- Ensure all tags exist and are spelled correctly
- Check that metric is actively reporting data
Common Query Issues:
- Typos in metric names or tag keys
- Using tags that don't exist on the metric
- Incorrect aggregation functions
- Missing
by {tag} clauses
Prevention:
- Always test queries in Metrics Explorer before using in SLOs
- Create SLOs in UI first, then export to YAML
- Use
.ddimport to sync validated UI configs to repo
Error 3: Dashboard Fetch Error
Error Message:
Couldn't get the dashboard definition
Response Codes:
- 404: Dashboard no longer exists
- 429: Rate limiting
- 503: DataDog service issues
Diagnostic Questions:
- What is the response code?
- Is this blocking deployment or just a warning?
- Does the dashboard still exist in DataDog UI?
Solution by Response Code:
404 - Dashboard Not Found:
- Verify deletion: Check if dashboard was intentionally removed
- If intentional: Remove from repository YAML
- If accidental: Restore from Recently Deleted
- Force reimport:
.ddimport dashboard <dashboard-id> in #observability-chatops
429 - Rate Limiting:
- Wait and retry: This is temporary
- Check for automation loops: Multiple chatops running?
- Retry deployment after a few minutes
503 - DataDog Issues:
- Check DataDog status: Visit status.datadoghq.com
- Wait for recovery: This is a DataDog outage
- Retry after incident resolves
Important Note:
Dashboard fetch errors often don't block deployment of monitors/SLOs. Check for other errors in the deployment log.
Prevention:
- Merge dashboard import PRs promptly
- Don't delete dashboards without removing references
- Use
.ddimport dashboard to force syncing
Error 4: Threshold Mismatch
Error Message:
Alert threshold (X) does not match that used in the query (Y)
Root Cause:
The critical value in YAML doesn't match the threshold value in the query string.
Example of Problem:
query: sum(last_5m):sum:errors{*}.as_count() > 5
critical: 10
Solution:
-
Identify the mismatch:
- Query threshold: Look for
> X or < X in query
- YAML threshold: Value in
critical: field
-
Decide which value is correct:
- What threshold should actually trigger alerts?
- Does the query or the YAML have the right value?
-
Sync both values:
Option A - Update query to match YAML:
query: sum(last_5m):sum:errors{*}.as_count() > 10
critical: 10
Option B - Update YAML to match query:
query: sum(last_5m):sum:errors{*}.as_count() > 5
critical: 5
- Deploy corrected configuration
Prevention:
- Always update BOTH the query and critical value together
- Use search/replace when changing thresholds
- Review diffs carefully during PR review
- Add a validation step to your workflow
Quick Check Command:
grep -A5 "query:.*>" monitors.yaml | grep "critical:"
Error 5: Missing Auto-Generated PR
Error Message:
(No error - PR just never appears)
Root Cause:
Hubot automation failed to detect change or create PR.
Diagnostic Questions:
- How long has it been since the change? (Allow 5-10 minutes)
- Did you make the change in DataDog UI?
- Is the monitor properly named with
service/name pattern?
Solution:
-
Wait 5-10 minutes first (automation isn't instant)
-
Trigger import manually via chatops:
.ddimport monitor <monitor-id>
.ddimport slo <slo-id>
.ddimport dashboard <dashboard-id>
-
If still failing, try whitespace change:
- Edit monitor in UI
- Add a space or newline somewhere
- Save
- This can retrigger the automation
-
Check for automation issues:
Prevention:
- Use proper monitor naming (
service/name)
- Ensure you have write access to datadog-monitoring repo
- Monitor #observability for automation outage notifications
- Have
.ddimport chatops ready as backup
Error 6: Templated Monitor Edit Rejected
Error Message:
(UI change reverted after ~6 hours)
Root Cause:
Monitor is generated from an ERB template (e.g., rest_api.yaml.erb). UI changes to templated monitors are overwritten by template.
How to Identify:
Check the monitor message in DataDog UI for:
This monitor was auto generated by rest_api.yaml.erb
If present, this monitor is template-controlled.
Solution:
-
Do NOT edit in DataDog UI (changes will be reverted)
-
Edit the template instead:
- Locate template: Usually in
config/services/github/rest_api/monitors/rest_api.yaml.erb
- WARNING: Template affects 40+ services!
-
For single service changes:
- Eject service from template first:
- Remove service from template's service list
- Create standalone YAML file for that service
- Then make your specific changes
-
For template-wide changes:
- Consult with @github/observability first
- Make template change
- Test impact on all affected services
Prevention:
- Check monitor message for "auto generated" before editing in UI
- Coordinate with Observability team for template changes
- Consider ejecting from template if service needs custom config
Error 7: No Data Notifications
Issue:
Monitor isn't alerting when metrics stop flowing.
Root Cause:
notify_no_data is set to false (or defaulted to false).
Diagnostic Questions:
- Should this monitor alert when data stops?
- Is the metric sparse or continuous?
- What is the
new_host_delay set to?
Solution:
- Enable no-data notifications if metric should be continuous:
notify_no_data: true
new_host_delay: 300
- Keep disabled for sparse metrics:
notify_no_data: false
- Consider new host delay:
- Default: 300 seconds (5 minutes)
- Increase for slow-starting services
- Decrease for fast-deploying services
When to Use:
- โ
notify_no_data: true: Continuous metrics (requests, errors, health checks)
- โ
notify_no_data: false: Sparse metrics (scheduled jobs, rare events)
Prevention:
- Consider metric emission patterns when configuring
- Test no-data behavior in staging first
- Document expected metric frequency
Quick Reference: Recovery Tools
DataDog Archive Links
Chatops Commands
.ddimport monitor <monitor-id>
.ddimport slo <slo-id>
.ddimport dashboard <dashboard-id>
Slack Channels
- #observability: General help and questions
- #observability-chatops: Run import chatops
Key Repositories
Troubleshooting Flowchart
Error encountered
โ
Identify error type
โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ Invalid monitor โ Query invalid โ Threshold โ
โ IDs in SLO โ โ mismatch โ
โ โ โ โ
โ โ Check archive โ โ Fix in UI โ โ Sync query โ
โ โ Restore โ โ Copy to YAML โ and critical โ
โ โ Reimport โ โ values โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโ
โ Missing PR โ Dashboard error โ Template edit โ
โ โ โ โ
โ โ Wait 10min โ โ Check status โ โ Edit template โ
โ โ .ddimport โ โ Restore from โ or eject โ
โ chatops โ deleted list โ service โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโ
โ
Deploy fix
โ
Verify resolution
โ
Document prevention
Getting Help
If none of these solutions work:
-
Gather context:
- Full error message
- Monitor/SLO name and ID
- What you've tried so far
- Recent changes made
-
Ask in #observability Slack with:
- Error message
- Monitor/SLO link
- Steps attempted
-
Tag @github/observability in PR if deployment blocked
-
Check DataDog status: status.datadoghq.com
Prevention Best Practices
- Merge PRs promptly (within 24 hours)
- Test queries in Metrics Explorer before adding to monitors
- Create in UI first for complex monitors, then import to repo
- Keep threshold values in sync between query and YAML
- Check for template control before editing monitors
- Use
.ddimport chatops as backup for failed automation
- Review deployment logs for all errors, not just the first one
- Document custom configurations in monitor messages
Remember: Most issues can be resolved by understanding the relationship between DataDog UI, the repository, and the automation that syncs them. When in doubt, reach out to @github/observability!