Distributed Profiling Premium/Enterprise

Blackfire Distributed Profiling is a feature that makes it possible to profile any service your application interacts with, the most common being other HTTP applications such as micro-services.

When profiling with Blackfire, all eligible HTTP (and/or CLI) services involved with your main application are also profiled and generate Sub-Profiles.

Requirements

Distributed profiling is enabled by default if the probe supports it.

The main technical requirements are the following:

Note

A profile can be propagated to applications written in all languages supported by Blackfire.

For example, a profile of a CLI application written in Go can be propagated to an HTTP application written in PHP, and to another one written in Python.

1
2
3
4
Go app (CLI)
├── PHP app (HTTP)
│   └── Go app (CLI)
└── Python app (HTTP)

How Does It Work?

Profiles and sub-profiles are linked with parent/child identifiers. These identifiers are either automatically generated by the probe, or in your own code using the SDK.

Each profile is passed on to the agent and processed independently. Once they are sent to Blackfire servers, they are linked together as a hierarchy of calls.

Note

You may use different Blackfire agents. These agents may be on different infrastructures, as long as the requirements are fulfilled.

Agents may even use different credentials, and can thus be linked to different Blackfire environments. The only requirement in this case is that the user who is profiling has access to the Blackfire environments which are tied to the different agents.

Analyzing Distributed Profiles

In the Blackfire user interface, the generated profile and its sub-profiles are gathered within the same view, so that you can navigate from one profiled service to another, and thus observe how they depend on each other.

/docs/subprofiles.png

In order to locate a node that a sub-request is originated from, click on the magnifying glass icon next to the caller function name (fopen() in the screenshot below).

/docs/subprofile-node-focus.png

All the assertions and recommendations for each profiled request are also gathered in the same view. This enables the identification of bottlenecks, optimization possibilities, and which service is impacted.

/docs/subprofile-assertions.png