Configure BlackFire
How to configure BlackFire on the Hipex platform
BlackFire is a profile, test and debug tool to be used in production environments. For more info please refer to
blackfire.io.
Configuration
Configuring BlackFire is done using the Pack panel at https://pack.hipex.io/. Search for your application and go to application settings. There you will find "APM and profiling" with the BlackFire ID & BlackFire token fields.
The required value of these fields can be found in your BlackFire account under Settings -> Credentials -> My Server Credentials.
Then all is left is to save the changes and wait a few minutes for the platform to update your server.
Varnish
When using BlackFire behind varnish it is essential that the reqeusts get handled by PHP and not Varnish. Therefor
you need to add this configuration to your vcl_recv
method in your vcl.
sub vcl_recv {
if (req.esi_level > 0) {
# ESI request should not be included in the profile.
# Instead you should profile them separately, each one
# in their dedicated profile.
# Removing the Blackfire header avoids to trigger the profiling.
# Not returning let it go trough your usual workflow as a regular
# ESI request without distinction.
unset req.http.X-Blackfire-Query;
}
# If it's a Blackfire query and the client is authorized,
# just pass directly to the application.
if (req.http.X-Blackfire-Query) {
return (pass);
}
}