[PHP] Enabling Distributed Tracing in PHP on Heroku

I’m trying to enable distributed tracing for the PHP Agent running on Heroku.

I’ve tried setting an environment variable NEW_RELIC_DISTRIBUTED_TRACING_ENABLED which did not work.

I’ve also added a newrelic.ini file as per the documentation containing the following:

[newrelic]
newrelic.enabled = true

; Enable distributed transaction tracing
newrelic.transaction_tracer.enabled = true
newrelic.distributed_tracing_enabled = true

and setting NEW_RELIC_CONFIG_FILE to newrelic.ini

However both phpinfo() and ini_get('newrelic.distributed_tracing_enabled') show the value as disabled.

How do I enable distributed tracing for PHP on Heroku, or diagnose why it is not enabling when I believe it should be?

I’ve not made any further changes to my configuration, but it appears that I am now getting distributed tracing for my PHP application.

Hello,

Thank you for following up and letting us know that distributed traces are now being generated as expected. That’s very odd that they began showing up without making any changes. Perhaps some sort of restart had to happen for the setting to be picked up. In any case, glad to hear it’s now working. Cheers!