• EnglishEspañol日本語한국어Português
  • Log inStart now

newrelic_insert_distributed_trace_headers

Syntax

newrelic_insert_distributed_trace_headers (array $headers)

Inserts W3C Trace Context headers and New Relic Distributed Tracing headers into an outbound array of headers.

Requirements

Requires PHP agent version 9.8 or higher.

Description

Use 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.

Parameters

Parameter

Description

$headers

array

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.

Return values

true if any headers were successfully inserted into the provided array, otherwise returns false

Examples

For examples of how and when to use this API method, see the documentation to manually instrument applications and services.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.