Documentation ¶
Overview ¶
Package nrb3 supports adding B3 headers to outgoing requests.
When using the New Relic Go Agent, use this package if you want to add B3 headers ("X-B3-TraceId", etc., see https://github.com/openzipkin/b3-propagation) to outgoing requests.
Distributed tracing must be enabled (https://docs.newrelic.com/docs/understand-dependencies/distributed-tracing/enable-configure/enable-distributed-tracing) for B3 headers to be added properly.
Example (ZipkinReporter) ¶
This example demonstrates how to create a Zipkin reporter using the standard Zipkin http reporter (https://godoc.org/github.com/openzipkin/zipkin-go/reporter/http) to send Span data to New Relic. Follow this example when your application uses Zipkin for tracing (instead of the New Relic Go Agent) and you wish to send span data to the New Relic backend. The example assumes you have the environment variable NEW_RELIC_API_KEY set to your New Relic Insights Insert Key.
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRoundTripper ¶
func NewRoundTripper(original http.RoundTripper) http.RoundTripper
NewRoundTripper creates an `http.RoundTripper` to instrument external requests. The RoundTripper returned creates an external segment and adds B3 tracing headers to each request if and only if a `newrelic.Transaction` (https://godoc.org/github.com/newrelic/go-agent#Transaction) is found in the `http.Request`'s context. It then delegates to the original RoundTripper provided (or http.DefaultTransport if none is provided).
Example ¶
Output:
Types ¶
This section is empty.