This integration is available to Enterprise users.

Logmatic.io is a log visualization tool where you can funnel logs from all of your sources, correlate them, be alerted on issues and find their root cause. It is a great complement to Blackfire, as it can both log Blackfire data such as build reports history, and trigger Blackfire scenarios whenever an alert is raised. Basically, combining other log sources, this integration can help you automatically get more information on the performance of your code if an issue arises.

Setting up the Logmatic.io Integration

Create a Logmatic.io Alert based on an event that would require more information about the code's behavior and its resources consumption (for instance, that could be when the CPU usage is too high for more than 15 minutes).

Then add a new Alert Endpoint and use the webhook type to enable Blackfire. Finally, configure the channel with the Base URL and Basic Auth credentials which can be found in the Dashboard Builds tab, in the Logmatic.io integration.

The JSON Template field is not useful here, so you can simply leave it empty.

A new build report will be generated each time an alert is raised through the Notification channel. You might need to adjust the alert thresholds in order to get an appropriate build report rhythm.

Customizing the Integration Endpoint

Logmatic.io's webhook URL looks like the following: https://$token_id:$token_password@blackfire.io/api/v1/build/env/UUID/logmatic. By default, this will hit the endpoint you configured in your Blackfire environment options.

In order to override it, you can append an endpoint query parameter. Example: https://$token_id:$token_password@blackfire.io/api/v1/build/env/UUID/logmatic?endpoint=http://preprod.site.com

Setting up a Logmatic.io Notification Channel

Anytime a build report is available, the Logmatic.io notification channel will send data to Logmatic.io, which can parse and display it.

To configure a Logmatic.io notification channel, in the dashboard, go to the "Builds" tab of an environment and look for the Notification Channels section. Add a new notification channel. The notification channel simply needs the HTTP/S API endpoint (Example: https://api.logmatic.io/v1/input/<your_logmatic_api_key>).

The data sent is:

uuid Build identifier
state Build status
message Build message
external_id The unique identifier of the build (if exists)
external_parent_id The unique identifier of the parent build (if exists)
summary A summary
appname blackfireio
_links Links to the build results page

Configuration Recommendation

Logmatic.io is able to trigger Blackfire to run performance tests automatically, but you will need to define upfront which URLs Blackfire should hit. Once you configured Logmatic.io as a trigger, make sure to define scenarios and performance tests.