Information is key: Building alert-triggered profiling with Blackfire

By Thomas di Luccio, on Nov 27, 2024
Watch the video: https://youtu.be/IGMx42mWPMI

Making informed decisions is everything, even more so during tough times. Picture this: an application suddenly starts acting up in production. You receive an alert, but what is next? Knowing something went wrong is not enough; you must dive into the details and understand why it happened.

Information and its context are crucial to determining the root cause of any issue. That’s why the more data you can collect when an incident occurs, the better your chances of resolving it swiftly and efficiently.

With Blackfire, we cover a broad spectrum of data collection to help you in times like these. From continuous, lightweight monitoring to on-demand, in-depth profiling, Blackfire ensures you have all the information you need at your fingertips.

Our latest video, “Building alert-triggered profiling with Blackfire“, demonstrates how to take this concept to the next level by automatically triggering a comprehensive profile at the moment an alert fires in your production environment.

In the video, we explore setting up this kind of integration. Imagine a scenario where an alert is triggered due to a performance anomaly in your application. Instead of manually starting a profile to investigate the problem, you can configure Blackfire to launch a full profile using our synthetic monitoring feature.

This way, you’re not just getting a snapshot; you’re collecting a wealth of contextual information about what’s happening in your application at the exact moment the problem occurs.

Synthetic monitoring allows you to create detailed, repeatable scenarios that simulate critical user journeys. These scenarios are executed when an alert is triggered, and every step is meticulously profiled. Blackfire groups all the resulting data into a Build report, providing a holistic view of your application’s behavior under stress.

Automating the profiling process in response to production alerts saves precious time that would otherwise be spent manually configuring and running tests, potentially missing crucial information. The Build reports are comprehensive, containing the aggregation of all the performance tests executed at that time, helping you pinpoint the exact cause of the anomaly.

In summary, this video explains how to integrate a webhook notification channel with the programmatic trigger of synthetic monitoring using minimal middleware. When an alert is triggered, the webhook sends a POST request to a secure endpoint, which then makes an authenticated POST request to our API to initiate a Blackfire build.

Curious to see how it works in action? Watch the full video to learn how to implement this powerful setup for yourself. As always, feel free to reach out with any questions or suggestions—we love hearing your ideas for future projects!

Find us on Discord and let us know if this becomes one of our features or gives us ideas for future videos and integrations.

To better observability and beyond

Thomas di Luccio

Thomas is a Developer Relations Engineer at Platform.sh for Blackfire.io. He likes nothing more than understanding the users' needs and helping them find practical and empowering solutions. He’ll support you as a day-to-day user.