Skip to main content
Version: Cloud

Monitor PHP Application in ECS


  1. Install sfagent to integrate your application with SnappyFlow.
  2. Make sure that the project and application are created in the SnappyFlow server. If not, click here to create a project and an application in SnappyFlow.
  3. Provide the PROFILE_KEY, PROJECT_NAME , and APP_NAME in the config.yaml file.


  1. Download the shell script into the root folder of the project.

  2. Add the config.yaml to the project root folder.

  3. Make sure that the projectName, appName and profileKey values are correct.

  4. Add the following changes to the Docker file of the project and build the image.

    # Begin Snappyflow changes
    RUN apk add --no-cache wget git curl-dev bash jq
    RUN mkdir -p /opt/elasticapm/phpagent
    RUN mkdir -p /opt/sfagent
    RUN wget
    RUN tar -zxvf sftrace-agent.tar.gz >/dev/null && mv -f sftrace /opt/sfagent && mv -f /opt/sfagent/sftrace/sftrace /bin && mv -f /opt/sfagent/sftrace/java/sftrace /opt/sfagent/sftrace
    ADD ./config.yaml /opt/sfagent/config.yaml
    ADD ./ /mnt
    RUN chmod +x /mnt/
    # Specify trace service name
    RUN /mnt/ <service-name>
    # End Snappyflow Changes


    Tracing service name should be specified in Docker build step.


    In case, if you need to update Snappyflow projectName, appName or profileKey then you need to uninstall the existing PHP agent and install the agent again. While installing the agent back update the projectName, appName and profileKey.

View Trace Data

Follow the below steps to view the trace data.

  1. Go to the Application tab in SnappyFlow and navigate to your Project > Application > Dashboard.

  2. In the dashboard window, navigate to the Tracing section and click the View Transactions button.

  3. You can view the traces in the Aggregate and the Real Time tabs.

Steps to Uninstall PHP Agent

  1. Download the PHP agent configuration.

  2. Use the below-given command to assign executable permission.

    chmod +x ./

  3. Run the below script with sudo.

    sudo ./

  4. Restart the PHP service.