Lando

Lando is a development platform based on Docker containers, which dramatically simplifies local development and DevOps.

Blackfire provides an official plugin for Lando, so that you can seamlessly leverage the power provided by Blackfire Profiler and Lando.

Install

1
mv blackfire ~/.lando/plugins/

Note

If the plugins directory doesn’t exist, create it:

1
mkdir -p ~/.lando/plugins

Configuration

  1. Configure Blackfire within Lando by setting up a service:

or to display your Blackfire's credentials.

services:
    blackfire:
        type: blackfire
        server_id: <YOUR_BLACKFIRE_SERVER_ID>
        server_token: <YOUR_BLACKFIRE_SERVER_TOKEN>
        client_id: <YOUR_BLACKFIRE_CLIENT_ID>
        client_token: <YOUR_BLACKFIRE_CLIENT_TOKEN>
  1. Rebuild Lando:
1
lando rebuild

Increasing The Log Level

If you need to increase the log level for the Blackfire Probe or Agent, you may configure the log_level directive:

1
2
3
4
5
services:
  blackfire:
    type: blackfire
    # ...
    log_level: 4

Then run lando rebuild.

You can now check the logs:

1
2
3
4
5
# Blackfire agent log
lando logs -s blackfire

# Blackfire probe log, as part of the appserver ones
lando logs -s appserver

Custom App Service name

By default, Lando’s main app service is called appserver.

If you decided to call it differently, you need to configure the blackfire service:

1
2
3
4
services:
  blackfire:
    type: blackfire
    app_service: my_app_service_name

Known Limitations

  • It only works with Debian-based application containers, which is the case for most Lando recipes;
  • The probe is automatically installed in PHP application services. For Python, you need to install the PIP package and use blackfire-python instead of python.