This integration also brings the feature to trace some Symfony and Doctrine events.
This integration is not enabled by default, and some libraries must be present:
First install opencensus extension for php, see documentation page.
If you are using Google App Engine standard environment*, you only need to enable extension in your php.ini file:
# php.ini
extension=opencensusAlso you need to install opencensus/opencensus-exporter-stackdriver package:
$ composer require opencensus/opencensus-exporter-stackdriverTo enable it, you must set GCLOUD_TRACE environment variable to 1.
As well as error reporting, the integration needs to be loaded before Symfony initialization, so it's not an option to set it in your .env file.
You must configure it for your system:
$ export GCLOUD_TRACE=1If you are using Docker:
# Dockerfile
ENV GCLOUD_TRACE 1
or docker-compose:
# docker-compose.yaml
services:
fpm:
environment:
GCLOUD_TRACE: 1Also you must add it to your deployment configuration. For example, if you are using Google App Engine, you must add it to your config file:
# app.yaml
env_variables:
GCLOUD_TRACE: 1