newrelic_insert_distributed_trace_headers (array $headers)
Inserts W3C Trace Context headers and New Relic Distributed Tracing headers into an outbound array of headers.
Requires PHP agent version 9.8 or higher.
newrelic_insert_distributed_trace_headers to manually add distributed tracing headers an array of outbound headers.
When Distributed Tracing is enabled,
newrelic_insert_distributed_trace_headers will always insert W3C trace context headers. It also, by default, inserts the New Relic Distributed Tracing header, but this can be disabled via the
newrelic.distributed_tracing_exclude_newrelic_header INI setting.
Required. An (optionally empty) array of outbound headers. This argument is passed by reference, and therefore must be a variable as opposed to a literal.
True if any headers were successfully inserted into the provided array, otherwise returns
For examples of how and when to use this API method, see the documentation to manually instrument applications and services.
If you need more help, check out these support and learning resources:
- Suggest a change and learn how to contribute to our PHP agent open source repository.
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's data security and licenses documentation.