When something goes wrong with an API, the last thing you want is to be the last to know. If your API suddenly starts throwing errors or slows down unexpectedly, learning about it right away can save you a lot of trouble.
We added Custom Alerts to Treblle 3.0 to help you catch problems early without digging through logs or being bombarded with unnecessary notifications.
However, Custom Alerts are not the only new feature in Treblle 3.0. Along with alerts, we've rolled out several other powerful updates to make managing your APIs smoother and more efficient. These include Workspaces, SSO, MFA & Social Sign-on, API Catalog, and Compliance. They can significantly enhance your API management and team collaboration if you still need to explore them.
In this blog post, I will walk you through Custom Alerts, explain why they matter, and how they can help make your API workflow smoother and more effective.
What Are Custom Alerts in Treblle 3.0?
Custom Alerts is a feature that lets you define specific events or configure alerts for specific triggers, like a rise in error rates or unexpected traffic from a particular IP.
Once you set your criteria, Treblle will notify you as soon as those conditions trigger.
Here’s what makes Custom Alerts powerful:
- Saved Searches: Define precise filters to track important events, such as requests to specific endpoints or traffic from a particular region.
- Multi-Channel Notifications: Choose how you want to be alerted via email, Slack, or directly in the Treblle app.
- Recipient Control: Notify the right people by assigning up to five recipients for each alert.
It’s all about putting you in control of the noise.
How to Set Up a Custom Alert in Treblle
Create a Saved Search:
- Go to the Requests tab in Treblle and filter the events you want to monitor.
- For example, filter all
POST
requests to/auth/register
.
Save your search by clicking “Save.”
- Give it a meaningful name (e.g., “Auth Error Alerts”).
Set Up a New Alert:
- Head to the My Alerts section.
- Click New Alert and fill in the details, such as the alert name, your saved search, and how often you'd like to receive notifications.
- Choose your preferred channel: Email, Slack, or in-app notifications.
- Assign up to five team members who need to receive these alerts.
Slack Integration:
- To use Slack, add a webhook URL for your desired Slack channel under your API settings.
In-App Notifications:
- If you select In-app under the channel, you can see the alerts in the notifications section; view alerts within the Treblle app for a clutter-free option.
When Should You Use Custom Alerts?
1. For Developers
Track Error Spikes During Testing or After a New Deployment
Scenario: You’ve just deployed a new feature to production and want to ensure it’s working as expected.
Saved Search Example:
- Filters:
- Method:
POST
- Status Code:
5xx
- Endpoint:
/auth/register
- Method:
- Alert Rule: Trigger if the error rate exceeds 5% of total requests in 30 minutes.
- Why It’s Useful: This alert helps identify issues like server misconfigurations or unhandled exceptions right after deployment. By catching these problems early, you can quickly roll back changes or fix them before they impact users.
2. For Product Teams
Monitor Performance Metrics to Ensure APIs Meet Product Goals
Scenario: Your product relies on fast API response times to deliver a great user experience, and you want to ensure latency stays within acceptable limits.
Saved Search Example:
- Filters:
- Response Time:
Greater than 200ms
- Status Code:
200
- Endpoint:
/search
- Response Time:
- Alert Rule: Trigger if more than 10% of requests exceed the response time threshold within an hour.
- Why It’s Useful: This allows product teams to address performance bottlenecks proactively before they negatively impact users.
3. For Security Teams
Configure Alerts for Failed Authentication Attempts or Unusual IP Activity
Scenario 1: Detect brute force attacks on login endpoints.Saved Search Example:
- Filters:
- Method:
POST
- Endpoint:
/login
- Status Code:
401 (Unauthorized)
- Method:
- Alert Rule: Notify if failed login attempts exceed 100 in 10 minutes.
- Why It’s Useful: This can help security teams identify and mitigate brute force attacks in real-time.
4. For Operations Teams
Receive Notifications for SLA Breaches or Unexpected Downtime
Scenario: Your team has committed to a 99.9% uptime SLA, and you must be alerted when downtime or failures occur.
Saved Search Example:
- Filters:
- Status Code:
5xx
- Response Time:
Greater than 1s
- Status Code:
- Alert Rule: Notify if more than 2% of requests in 5 minutes fail or are too slow.
- Why It’s Useful: Ops teams can take immediate action, such as scaling resources or restarting services, to restore regular operations and meet SLA commitments.
Best Practices for Using Custom Alerts
Setting up alerts is easy, but getting the most out of them takes a bit of thought. Here are some tips to make sure your Custom Alerts are as helpful as possible:
1. Be Specific with Your Criteria
- When defining your saved searches, focus on what matters.
- For example, instead of setting up an alert for all errors, focus on specific endpoints or codes requiring immediate attention. This way, your team will receive only the most relevant notifications without being overwhelmed by unnecessary ones.
2. Choose the Right Notification Channels
- Different issues call for varying levels of urgency.
- Use Slack or email to notify your team instantly for high-priority events like downtime.
- In-app notifications might be enough for less critical updates. Match the channel to the importance of the alert.
3. Keep Your Recipients in Mind
- Alerts are only helpful if they reach the right people.
- Assign recipients based on their roles, such as developers for debugging issues, product managers for performance metrics, or operations teams for uptime concerns.
- Add up to five recipients per alert, so make each one count.
4. Regularly Review and Update Your Alerts
- APIs evolve, and so do the issues you care about.
- Check your saved searches and alert configurations periodically to ensure they’re still relevant. Remove outdated alerts and add new ones as your needs change.
Wrapping it up
Custom Alerts in Treblle 3.0 offer a simple yet effective way to stay on top of your APIs.
They help you focus on what matters, keeping you informed about critical events without drowning in irrelevant notifications.
Setting up tailored alerts can improve team monitoring, collaboration, and response times. Explore and set up Custom Alerts in Treblle 3.0 to take control of your API monitoring and stay ahead of potential issues.