Your Magento Cloud package enables your team to use Blackfire on their development machines, on the Magento Cloud integration platform, and on staging and production clusters.
We strongly advise you to configure Blackfire on all machines in order to get the best out of profiling and testing.
- Have the
magento-cloudCLI v1.23.0 or more recent installed, follow these instructions to install it;
- Be a Super User / admin for the entire project.
- Check if the
MAGENTO_CLOUD_APPLICATIONenvironment variable exists in your project (can be done with the
magento-cloud variable:listcommand). Else, please reach out to your Magento Cloud account manager. Your architecture should be something like this.
If you do not meet one of those requirements, please use reach out to your Magento Cloud account manager.
Enabling Blackfire on Production, Staging, Integration and Active branches
Blackfire is fully safe to use in production. It will not generate any overhead for your end users.
- Open your terminal and locate your Magento Cloud project
- Execute the following command:
magento-cloud blackfire:setup. Please note this command will trigger a redeploy of all of your environments, including production. Please plan execution accordingly.
This command will automatically configure Blackfire on all environments, and activate automated profiling each time some change is applied to an environment (code change, merge, deploy,...).
You can also find more information to configure Blackfire on Magento Cloud via the Blackfire website:
- Login to https://blackfire.io
- Find your Magento Cloud project under https://blackfire.io/my/organizations
- Go to each environment under the Project, to the "Builds" tab and click on the "i" icon next to "Magento Cloud" in the list of integrations
- Follow the instructions shown in the dialog
Configuring Blackfire on your local machine
- Go to your "Integration and Development" or "Dev" environment Blackfire environment and click the Settings tab. Scroll down to the bottom to find the Server ID and Server Token for the environment.
- Follow the installation procedure depending on your machine and OS, and use the environment's server credentials.