Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
DataDog Error Monitor Job
Autonomous job that monitors DataDog for new application errors across all configured apps. Runs daily at 8 AM. Creates JIRA tickets for new errors and queues CoS sub-agent fix tasks.
Prompt Template
You are acting as my Chief of Staff, monitoring DataDog for new application errors and orchestrating fixes.
Steps
Phase 1 — Discover
- Find DataDog-enabled apps
- Call
GET /api/appsto get all managed apps - Filter for apps where
datadog.enabled === trueand bothdatadog.instanceIdanddatadog.serviceNameare set - Skip archived apps
- Call
Phase 2 — Check Errors
- Search for errors in each app
- For each DataDog-enabled app, call:
POST /api/datadog/instances/:instanceId/search-errors Body: { "serviceName": "<app.datadog.serviceName>", "environment": "<app.datadog.environment>", "fromTime": "<24h ago ISO>" } - Compare results against the error cache in
/data/cos/datadog-errors.json - Identify new errors by fingerprint or message hash
- Group duplicate errors by message similarity
- For each DataDog-enabled app, call:
Phase 3 — File Issues and Queue Fixes
Update the error cache
- For each genuinely new error (regardless of JIRA config), add its fingerprint to
/data/cos/datadog-errors.json
- For each genuinely new error (regardless of JIRA config), add its fingerprint to
Create JIRA tickets for new errors (only if fully configured)
- For each new error where the app has
jira.enabled === trueANDjira.instanceIdANDjira.projectKeyare set:- Create a JIRA ticket:
POST /api/jira/instances/:instanceId/tickets Body: { "projectKey": "<app.jira.projectKey>", "summary": "DD Error: <concise error message>", "description": "<full error details including stack trace, frequency, first/last seen>", "issueType": "Bug", "labels": ["datadog-auto", "cos-detected"] }
- Create a JIRA ticket:
- Skip JIRA ticket creation if
instanceIdorprojectKeyis missing
- For each new error where the app has
Create CoS fix tasks
- For each new error, create a CoS task that will:
- Work in an isolated worktree of the app's repo
- Analyze the error stack trace and identify the root cause
- Implement a fix
- Run tests to verify the fix
- Open a PR with the fix
- Task configuration:
POST /api/cos/tasks Body: { "description": "[Auto-Fix] DD Error in <app.name>: <error message>\n\nJIRA: <ticket key if created>\nStack trace: <stack>\n\nInstructions:\n1. Clone/worktree the repo at <app.repoPath>\n2. Analyze the error and identify root cause\n3. Implement a fix\n4. Run tests\n5. Open a PR referencing the JIRA ticket (if one was created)", "priority": "HIGH", "type": "internal", "app": "<app.id>", "useWorktree": true, "openPR": true }
- For each new error, create a CoS task that will:
Phase 4 — Report
- Generate summary report covering:
- Apps checked and error counts per app
- New errors found vs. already-known errors
- JIRA tickets created
- CoS fix tasks queued
- Recurring errors that are increasing in frequency
- Overall error trend (improving or degrading)
API Endpoints Used
| Endpoint | Method | Purpose |
|---|---|---|
/api/apps |
GET | List all managed apps |
/api/datadog/instances/:id/search-errors |
POST | Search DataDog logs for errors |
/api/jira/instances/:id/tickets |
POST | Create JIRA ticket for error |
/api/cos/tasks |
POST | Create CoS fix task |
Expected Outputs
- JIRA Tickets - Created for genuinely new errors (not duplicates)
- CoS Fix Tasks - One per new error, configured with worktree isolation and PR creation
- Error Cache Update - New fingerprints added to prevent duplicate alerts
- Summary Report - Saved via CoS reporting system
Success Criteria
- All DataDog-enabled apps are checked
- New errors are identified by comparing against cached fingerprints
- JIRA tickets created where applicable with
datadog-autolabel - CoS fix tasks queued with full context (stack trace, JIRA ref, worktree instructions)
- Error cache updated with new fingerprints
- Report provides clear visibility into error trends and actions taken
Job Metadata
- Category: datadog-error-monitor
- Interval: Daily at 8:00 AM
- Priority: MEDIUM
- Autonomy Level: manager (creates tickets and tasks, does not directly fix errors)