Bug fixes
Under some circumstances, Drupal 8 transactions were named after generic controllers. These names were not useful for troubleshooting.
Drupal 8 transaction naming is now improved and hooks into Symfony routing to resolve the main controller associated with a route.
New Features
Support for W3C Trace Context, with easy upgrade from New Relic trace context
- Distributed Tracing now supports W3C Trace Context headers for HTTP protocols when distributed tracing is enabled. Our implementation can accept and emit both W3C trace header format and New Relic trace header format. This simplifies agent upgrades, allowing trace context to be propagated between services with older and newer releases of New Relic agents. W3C trace header format will always be accepted and emitted. New Relic trace header format will be accepted, and you can optionally disable emission of the New Relic trace header format.
- When distributed tracing is enabled, there are two new API function calls available that now support W3C
tracestateandtraceparentdistributed tracing headers in addition to the New Relic distributed tracing header information:newrelic_insert_distributed_trace_headers()is used to add distributed tracing headersnewrelic_accept_distributed_trace_headers()is used to accept distributed tracing headers
- When distributed tracing is enabled, you can use the new configuration setting
newrelic.distributed_tracing_exclude_newrelic_headerto exclude the New Relic distributing tracing header and only rely on W3C Trace Context headers.
Bug fixes
- Fixed a case where the memory usage of the PHP agent increases when
newrelic.transaction_tracer.max_segments_clilimit is reached. - In rare cases, optimized segment data structures could cause crashes for long-running transactions that hit the segment limit set via
newrelic.transaction_tracer.max_segments_cliornewrelic.transaction_tracer.max_segments_web. This has been fixed.
Known Issues and Workarounds
- If a .NET agent is initiating distributed traces as the root service, you must update that .NET agent to version
8.24or later before upgrading your downstream PHP New Relic agents to this agent release.
New Features
Avoid potential memory exhaustion for long running transactions
The configuration settings
newrelic.transaction_tracer.max_segments_cliandnewrelic.transaction_tracer.max_segments_webwere added. These settings can be used to limit the number of segments the PHP agent records during a CLI transaction and a web transaction respectively.newrelic.transaction_tracer.max_segments_clidefaults to100000and thus avoids potential memory exhaustion for long running CLI transactions.newrelic.transaction_tracer.max_segments_webdefaults to0, meaning that the PHP Agent shall capture all segments during a web transaction.For more information, see the documentation about the PHP agent configuration.
Performance improvements
- The PHP agent now creates segments in a more efficient way, which results in improved performance.
Bug fixes
- The Debian init script now uses
pidofinstead ofps. This solves issues related to starting the daemon with systemctl on Debian. Previously, the daemon would start and immediately stop.
Bug Fixes
- In 9.6.0, custom outbound headers added to curl requests could be silently removed if both
newrelic.cross_application_tracer.enabledandnewrelic.distributed_tracing_enabledare disabled. This has been fixed.
New Features
Enhanced visibility into curl_multi_exec calls
- Previously, curl_multi_exec requests appeared as one segment with one total time. Now, we expose the individual segments of a curl_multi_exec request that include individual times and host details. This provides greater visibility as to which URLs are being called and improved ability to troubleshoot slow curl calls.
Configurable daemon start timeout
The PHP Agent has introduced a new configuration
newrelic.daemon.start_timeout. Customers may use this to specify a timeout for the agent to wait for the daemon after a daemon was launched by the agent.With this timeout set, the agent will not immediately drop a transaction when the launched daemon hasn't acquired a socket yet, but rather grants the daemon time to do so.
It is recommended to only set this timeout when instrumenting long-lived background tasks, as in case of daemon start problems the agent will block for the given timeout at every transaction start.
Upgrade Notice
For cross agent conformance, the agent attribute
httpResponseCodehas been renamed tohttp.statusCode. In PHP agent release 9.4, we erroneously introducedhttpResponseCodeas the replacement forresponse.statusCode.The new
http.statusCodeagent attribute name will align with other agents and enables standardized alerts and INSIGHTS queries based on a common attribute name.Attributes are reported with both the new
http.statusCodename and the
legacyhttpResponseCodeandresponse.statusCodeattribute names.Support for legacy attribute names will be removed in future agent versions.
Known issues and workarounds
Potential memory exhaustion for long running transactions
- See description and recommendations under Known issues and workarounds in the PHP 9.0.0.242 release notes.
New Features
Support for Real Time Streaming
- Event data is now sent to New Relic every five seconds, instead of every minute. As a result, transaction, error, and custom events will now be available in New Relic and Insights dashboards in near real time. For more information on how to view your events with a five-second refresh, see the real time streaming documentation.
- Note that the overall limits on how many events can be sent per minute have not changed. Also, span events, metrics, and trace data is unaffected, and will still be sent every minute.
Laravel 6 is now fully supported by the PHP agent.
Known issues and workarounds
Potential memory exhaustion for long running transactions
- See description and recommendations under Known issues and workarounds in the PHP 9.0.0.242 release notes.
Bug fixes
- A potential segfault when using PHP 7.4 in connection with framework instrumentation has been fixed.
Known issues and workarounds
Potential memory exhaustion for long running transactions
- See description and recommendations under Known issues and workarounds in the PHP 9.0.0.242 release notes.
Known issues and workarounds
Potential memory exhaustion for long running transactions
- See description and recommendations under Known issues and workarounds in the PHP 9.0.0.242 release notes.
New features in 9.4
Added support for PHP 7.4
- The PHP agent can detect libraries and frameworks that were preloaded via the
opcache.preloadsetting.- You can disable this feature by using the following configuration setting:
newrelic.preload_framework_library_detection = false.
- You can disable this feature by using the following configuration setting:
Request URI attribute is now captured
- We now capture the
request.uriattribute. The request URI appears in transaction queries in New Relic Insights.- You can disable this attribute by using the following configuration setting:
newrelic.attributes.exclude = "request.uri".
- You can disable this attribute by using the following configuration setting:
Upgrade Notices
- For cross agent conformance, the agent attributes
request.headers.User-AgentandhttpResponseCodeare renamed torequest.headers.userAgentandresponse.statusCode. The valueresponse.StatusCodeis changed to an integer.- Attributes are reported with both the new and the legacy attribute names.
- Support for legacy attribute names will be removed in future agent versions.
Bug Fixes
Since 9.0, transaction traces and span events were not created when
newrelic_end_transactionwas called inside a PHP function.newrelic_end_transactionnow creates transaction traces and span events in any case. It reports all traces and span events for segments that weren't ended at the time of its invocation asunknown.Since 9.0, Predis calls weren't instrumented when the Predis client was loaded from a path ending in
Predis/Client.php. This has been fixed.For inbound distributed tracing payloads with invalid or missing values for
pr(priority) and/orsa(sampled) the agent used to assign a default priority of -1 and/or a default sampled value offalseto the transaction.- This has been fixed, the agent now keeps initial priority and sampled values if the respective values in the inbound distributed tracing payload are missing or invalid.
The daemon used to erroneously send
SIGUSR1signals to its parent process group in case one of the flags--foregroundor--watchdog-foregroundwas given. This has been fixed.
Known issues and workarounds
Potential memory exhaustion for long running transactions
- See description and recommendations under Known issues and workarounds in the PHP 9.0.0.242 release notes.
New features in 9.3
Trace and entity metadata API calls
- A new API function
newrelic_is_sampled()has been added. This call returns true if the current transaction is part of a sampled distributed trace. - A new API function for obtaining linking metadata been added.
newrelic_get_linking_metadata(). This call returns an opaque map of key/value pairs that can be used to correlate this application to other data in the New Relic backend. - A new API function
newrelic_get_trace_metadata()has been added. This call returns a collection of metadata used to identify a trace:trace.id, which provides the currently executing trace's identifier; andspan.id, which provides the span identifier associated with the currently executing span.
Configurable connection timeout
The PHP agent has introduced a new configuration
newrelic.daemon.app_connect_timeout. Customers may use this to specify a timeout for the agent to wait for a daemon connection.With this timeout set, the agent will not immediately drop a transaction when the daemon hasn't connected to the backend yet, but rather grant the daemon time to establish the connection.
It is recommended to only set this timeout when instrumenting long-lived background tasks, as in case of connection problems the agent will block for the given timeout at every transaction start.
New features in 9.2
More flexibility for container deployments
- The PHP daemon and agent no longer have to reside on the same host and can now communicate over a IPv4 or IPv6 TCP socket. This can be configured via the
newrelic.daemon.addresssetting in the agent and the--addresscommand line option for the daemon. - When terminating the New Relic PHP daemon via the
SIGTERMsignal (and/or theSIGINTsignal if started with the-f,--foregroundflag), the daemon will now send all buffered data to New Relic prior to exiting. - The PHP daemon has introduced a new configuration
--watchdog-foreground. This keeps the daemon watchdog process in the foreground, whereas the--foregroundconfiguration keeps the daemon worker process in the foreground. The new configuration makes it possible to use the daemon in a blocking way, without losing the additional stability provided by the watchdog process.
Upgrade notices
The PHP agent has introduced a new configuration
newrelic.daemon.addresswhich serves as an alias tonewrelic.daemon.port. You may use either to specify the location of the New Relic PHP daemon. If both values are set,newrelic.daemon.addresstakes precedence.Similarly, the PHP daemon has introduced a new configuration
--addresswhich serves as an alias to--port. Customers may use either to specify the location of the New Relic PHP daemon. If both values are set,--addresstakes precedence.When starting the daemon as an external process, the daemon will now wait for up to three seconds for the listening port to be ready to receive connections before forking into the background. This usually occurs in (much) less than a second, and most users with this configuration will notice no difference in practice.
The time that the daemon will wait can be controlled by setting the
--wait-for-portsetting with a duration. This duration may be0to prevent any blocking. If the option is omitted, the default value is3s.Note that this is not the default configuration shipped with the PHP agent, and generally is only used in conjunction with the PHP agent configured with
newrelic.daemon.dont_launchset to3.Daemons started in foreground mode (with the
--foregroundflag) are unaffected, and will behave as before.
Bug fixes
- When duplicating database connections to generate explain plans, the agent will no longer make those connections persistent, even if the original connection was persistent.
- The daemon now synchronously handles critical code paths related to harvesting and merging transaction data. This prevents crashes caused by race conditions.
- Previously, the PHP agent was silently ignoring the setting
newrelic.daemon.portif the value was outside of the range 1 - 65535. In this case, it used the default value of/tmp/.newrelic.sock. The PHP agent no longer silently ignores these port values; it now logs these errors inphp_agent.log.
Known issues and workarounds
- Potential memory exhaustion for long running transactions. See description under Known issues and workarounds in the PHP 9.0.0.242 release notes.