Builds are the results of running scenario; they are environment specific, they need to be defined on the Blackfire.io Environment page.
Blackfire starts builds periodically, provides a webhook for starting builds and supports integrations like Platform.sh, New Relic and Quanta Monitoring.
Caution
Scenarios are run from the Blackfire's servers. If the profiled application
is behind a firewall, let the Blackfire servers access the application by
allowing IP 46.51.168.2 and 54.75.240.245 in your configuration for
the web ports (usually 80 and 443).
Note
Periodic builds are only available to Premium and Enterprise users.
Periodic builds allows you to run your scenarios on a regular basis. That's a must on production servers.
Only public websites can be targeted by Blackfire to run scheduled scenarios. In general, if your environment is configured as a development environment, you will need to use our PHP SDK. Check your Endpoint and dev Environment configuration in the Dashboard's "Settings" tab of your environment.
Starting a build with a webhook offers the most flexible way of triggering Blackfire scenarios based on third-party tool events. Thereby, you can add performance tests at any point of your tool-chain. For instance, you can:
Note
The webhook is only available to Enterprise users.
1 2 3 4 | curl -X POST https://blackfire.io/api/v2/builds/env/ENV-UUID/webhook \
--user "CLIENT-ID:CLIENT-TOKEN" \
-d "endpoint=http://symfony.com/" \
-d "title=Build title"
|
Replace ENV-UUID by your environment UUID (and CLIENT-ID:CLIENT-TOKEN
by your personal credentials if needed).
The webhook endpoint accepts the following request parameters:
endpoint |
The endpoint to profile |
title |
The title |
metadata |
A hash of keys/values. For example with curl: -d "metadata[key1]=value1" -d "metadata[key2]=value2" |
http_username |
The username for HTTP Basic authentication |
http_password |
The password for HTTP Basic authentication |
ip |
The IP for forcing DNS |
ssl_no_verify |
Disable SSL certificates verification (this is unsecure) |
external_id |
A unique identifier for the build; commonly, a unique reference from a third party service like the Git commit sha1 related to the build |
external_parent_id |
The unique identifier of the parent build |
external_url |
A URL related to the build, like a Pull Request |
You can also trigger a build via the Blackfire CLI:
1 2 3 4 5 6 7 8 9 10 11 | blackfire build-trigger \
http://example.com/ \
--env=ENV-UUID \
--title="Build PR 1234" \
--external-id=`git log -1 --pretty=\"%H\"` \
--external-parent-id=`git merge-base master HEAD` \
--external-url="https://github.com/symfony/symfony/pull/11882" \
--http-password="http-password" \
--http-username="http-username" \
--ip="127.0.0.1" \
--ssl-no-verify
|
Note
If you are going to use the webhook from a shared service (like a Jenkins server), we recommend that you create a specific "bot" user to be used for automation like triggering webhooks from your continuous integration platform.
Tip
Blackfire environment pages provide a simple form (in the Dashboard Builds tab)
that lets you configure a webhook payload and generate the corresponding
cURL command. For your convenience, you can even trigger a build from there.
Blackfire supports a number of native integrations with third-party tools. Please check their dedicated documentation: