Skip to content

Instantly share code, notes, and snippets.

@dbisso
Last active February 1, 2023 15:12
Show Gist options
  • Save dbisso/a78b4e54dce60a9eedbde41d25699933 to your computer and use it in GitHub Desktop.
Save dbisso/a78b4e54dce60a9eedbde41d25699933 to your computer and use it in GitHub Desktop.
Set up Blackfire on AWS Elastic Beanstalk
commands:
01_add_blackfire_repo:
command: "sudo yum install -y pygpgme && wget -O - 'http://packages.blackfire.io/fedora/blackfire.repo' | sudo tee /etc/yum.repos.d/blackfire.repo"
packages:
yum:
blackfire-agent: []
blackfire-php: []
files:
"/opt/elasticbeanstalk/hooks/appdeploy/enact/90_blackfire_setup.sh":
mode: "000755"
content: |
#!/usr/bin/env bash
. /opt/elasticbeanstalk/support/envvars
sudo sed -i "s/server-token=.*/server-token=${BLACKFIRE_SERVER_TOKEN}/" /etc/blackfire/agent
sudo sed -i "s/server-id=.*/server-id=${BLACKFIRE_SERVER_ID}/" /etc/blackfire/agent
sudo /etc/init.d/blackfire-agent restart

Put the files in your '.ebextensions' directory in your project.

Set the following environment variables in your Elastic Beanstalk environment configuration. They can be found at https://blackfire.io/account

  • BLACKFIRE_SERVER_TOKEN : Your server token
  • BLACKFIRE_SERVER_ID : Your server ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment