Consumers Monitoring

Loading...

Consumers and CLI commands can be monitored.

The consumers and CLI command monitoring data can be displayed toggling the Web/CLI dropdown.

For PHP applications, a single setting monitors your Symfony Messenger and Laravel queue workers without any code change. Blackfire creates one transaction per consumed message or processed job. This feature is in beta and opt-in:

1
blackfire.apm_cli_workers = 1

See Symfony Messenger and Laravel queue automatic monitoring for the requirements, and concurrent workers to monitor Messenger workers started with --concurrency.

You instrument other CLI commands and consumers manually:

PHP Application

1
2
3
4
5
6
// As of Blackfire PHP Probe 1.78.0
\BlackfireProbe::startTransaction('My CLI command');

// code

\BlackfireProbe::stopTransaction();

Python Application

1
2
3
4
5
6
7
8
9
from blackfire import apm

# As of Blackfire Python Probe 1.6.1
apm.start_transaction()
apm.set_transaction_name('My CLI command')

# code

apm.stop_transaction()

CLI transactions should be manually named either before, during, or after the Instrumentation.

Blackfire supports a number of native integrations with third-party tools. Please check their dedicated documentation: