forked from uselagoon/lagoon-images
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add blackfire php probe (uselagoon#50)
- Loading branch information
Showing
5 changed files
with
72 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[blackfire] | ||
extension=blackfire.so | ||
|
||
; Sets fine-grained configuration for Probe. | ||
; This should be left blank in most cases. For most installs, | ||
; the server credentials should only be set in the agent. | ||
blackfire.server_id = ${BLACKFIRE_SERVER_ID:-} | ||
|
||
; Sets fine-grained configuration for Probe. | ||
; This should be left blank in most cases. For most installs, | ||
; the server credentials should only be set in the agent. | ||
blackfire.server_token = ${BLACKFIRE_SERVER_TOKEN:-} | ||
|
||
; Log verbosity level (4: debug, 3: info, 2: warning, 1: error) | ||
blackfire.log_level = ${BLACKFIRE_LOG_LEVEL:-1} | ||
|
||
blackfire.agent_socket = ${BLACKFIRE_AGENT_SOCKET:-} | ||
|
||
blackfire.apm_enabled = ${BLACKFIRE_APM_ENABLED:-0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# enable blackfire only if BLACKFIRE_ENABLED is set | ||
if [ ${BLACKFIRE_ENABLED+x} ]; then | ||
|
||
# if BLACKFIRE_AGENT_SOCKET is not set already, check if we can access well known locations | ||
if [ -z "${BLACKFIRE_AGENT_SOCKET}" ]; then | ||
# check for blackfire running in cluster | ||
if nc -z -w 1 blackfire.blackfire.svc.cluster.local 8707 &> /dev/null; then | ||
export BLACKFIRE_AGENT_SOCKET=tcp://blackfire.blackfire.svc.cluster.local:8707 | ||
# check for blackfire running in same namespace | ||
elif nc -z -w 1 blackfire 8707 &> /dev/null; then | ||
export BLACKFIRE_AGENT_SOCKET=tcp://blackfire:8707 | ||
fi | ||
fi | ||
|
||
# envplate the blackfire ini file | ||
ep /usr/local/etc/php/conf.d/blackfire.disable | ||
|
||
# copy the envplated file so that php will use it | ||
cp /usr/local/etc/php/conf.d/blackfire.disable /usr/local/etc/php/conf.d/blackfire.ini | ||
|
||
fi |