Alert fatigue is real. The constant stream of notifications from your monitoring systems can be overwhelming. More often than not, a critical alert requires manual intervention: copy the error message, open your issue tracker, create a new ticket, paste the details, assign it to the right team, and set a priority. This manual process is slow, error-prone, and a waste of valuable engineering time.
What if your alerts could create their own tickets? What if an incident could automatically be documented with perfect context, assigned, and prioritized, all within seconds of being detected?
This isn't a fantasy—it's the power of treating your issues as code. With an API-first issue tracker like issues.do, you can build simple, powerful bots to connect your monitoring systems directly to your development workflow. Let's build one.
Before we dive into the code, let's establish why this is a game-changer for any development or on-call team.
Our goal is to create a small service—a "bot"—that listens for a webhook from our monitoring system and uses the issues.do API to create a new issue.
This bot can be a simple serverless function (like an AWS Lambda, Google Cloud Function, or Vercel Edge Function), which is perfect for this kind of event-driven task.
Most modern monitoring tools (like Datadog, Sentry, Grafana, or Prometheus Alertmanager) can be configured to send a POST request to a URL of your choice when an alert is triggered. This request contains a JSON payload with all the alert details.
Let's imagine our monitoring system sends a payload that looks like this:
{
"alertName": "API Latency > 500ms",
"severity": "critical",
"service": "billing-api",
"details": "The p99 latency for the /checkout endpoint is 742ms.",
"dashboardLink": "https://monitoring.example.com/dash/d/Abc123xyz"
}
Our bot's job is to catch this JSON payload and map its fields to the fields required by the issues.do API.
We'll want to:
Now for the payoff. Using the issues.do SDK, we translate the logic from Step 2 into a simple API call. Here’s how it looks in TypeScript (running in a Node.js environment like a serverless function):
import { dotdo } from '@dotdo/sdk';
import { Request, Response } from 'express'; // Example using Express types
// This is your serverless function handler
export default async function handleWebhook(req: Request, res: Response) {
// 1. Get the payload from the monitoring system
const alert = req.body;
// 2. Map monitoring severity to our issue priority
const mapPriority = (severity: string): 'High' | 'Medium' | 'Low' => {
if (severity === 'critical') return 'High';
if (severity === 'warning') return 'Medium';
return 'Low';
};
// 3. Craft the API call to issues.do
try {
const newIssue = await dotdo.issues.create({
title: `[${alert.service}] ${alert.alertName}`,
description: `A new alert was triggered.
\n\n**Details:** ${alert.details}
\n\n**Investigate Here:** ${alert.dashboardLink}`,
assignee: 'oncall-team@example.com',
priority: mapPriority(alert.severity),
labels: ['from-monitoring', alert.service, 'needs-triage']
});
console.log(`Successfully created issue: ${newIssue.id}`);
// 4. Respond to the webhook source to confirm receipt
res.status(200).json({ message: 'Issue created successfully', issueId: newIssue.id });
} catch (error) {
console.error('Failed to create issue:', error);
res.status(500).json({ message: 'Error creating issue' });
}
}
With just a few lines of code, you've bridged the gap between your monitoring and your issue management.
An API-first approach opens up a world of possibilities. Once you've mastered the basics, you can enhance your bot with more advanced logic.
Manual, repetitive tasks are a drain on your team's potential. By automating issue creation, you build a more responsive, consistent, and efficient incident response workflow.
issues.do provides the programmable foundation to integrate issue tracking seamlessly into the tools you already use. Stop treating your issue tracker like a digital filing cabinet and start treating it like a core part of your automated development lifecycle.
Ready to connect your first workflow? Get started with issues.do today.