heroku / heroku-buildpack-php

Heroku's buildpack for PHP applications.

Home Page:https://devcenter.heroku.com/categories/php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prevent error "newrelic.transaction_tracer.enabled must be enabled in order to use distributed tracing"

holtkamp opened this issue · comments

Used configuration:
- PHP 8.1.9 @ Heroku-22 Stack
- New Relic Version | 10.0.0.312 ("cosmos" - "9fd43b56a296")

As described in https://discuss.newrelic.com/t/heroku-error-newrelic-transaction-tracer-enabled-must-be-enabled-in-order-to-use-distributed-tracing/188410, when using the free tier of NewRelic, the following error pops up quite a lot in the Heroku application logs:

2022-08-17 17:40:50.268 +0000 (249 249) error: newrelic.transaction_tracer.enabled must be enabled in order to use distributed tracing. Occurred X times.

Where X is increasing.

I used the instructions at https://docs.newrelic.com/docs/apm/agents/php-agent/advanced-installation/php-agent-heroku to create a newrelic.ini file containing:

newrelic.transaction_tracer.enabled = false

This newrelic.ini is properly respected by Heroku and a phpinfo() indicates that it is disabled.

Screenshot 2022-08-17 at 19 52 26

Still the error is logged.

This might be logical: "something" tries to use the distributed tracing while it is either not available (on the free tier) or disabled using the newrelic.ini file.

The problem is: I have no idea what might triggers the use of this functionality. Does Heroku use "distributed tracing" functionality by default when the NewRelic addon is used?

UPDATE
In the mean time it seems New Relic changed its plans and as of 24-02-2023 the free tier now does allow distributed tracing, but only up until the plan limits (100GB data ingestion) are reached. After that our Heroku App started crashing. The cause might be unrelated but removing the New Relic plugin prevented the crashing, so for now I would say the New Relic plugin + hitting free tier limits might cause problems...

Also see:

So: apparently distributed tracing has its own setting, which was not included in the suggested "clean" newrelic.ini file at https://docs.newrelic.com/83b95260c52332462e641ae6c8f1855f/newrelic.ini_.heroku. So this file might need an update to include this setting? This is a task for New Relic though, not for Heroku.

Maybe disabling it resolves the issue.

newrelic.distributed_tracing_enabled = false

I will either wait until next month (April 2023) or subscribe to a paid plain to start experimenting with this.

But then again, the error will probably not appear again, since distributed tracing now seems supported for the free tier...

Closing issue: not relevant anymore.