# Functions
ClientRequestName returns the span name for the client request, req.
FormatTraceparentHeader formats the given trace context as a traceparent header.
IgnoreNone is a RequestIgnorerFunc which ignores no requests.
NewDynamicServerRequestIgnorer returns the RequestIgnorer to use in handlers.
NewRegexpRequestIgnorer returns a RequestIgnorerFunc which matches requests' URLs against re.
NewTraceRecovery returns a RecoveryFunc for use in WithRecovery.
ParseTraceparentHeader parses the given header, which is expected to be in the W3C Trace-Context traceparent format according to W3C Editor's Draft 23 May 2018:
https://w3c.github.io/trace-context/#traceparent-field
Note that the returned TraceContext's Trace and Span fields are not necessarily valid.
ParseTracestateHeader parses the given header, which is expected to be in the W3C Trace-Context tracestate format according to W3C Editor's Draft 18 Nov 2019:
https://w3c.github.io/trace-context/#tracestate-header
Note that the returned TraceState is not necessarily valid.
RequestWithContext is equivalent to req.WithContext, except that the URL pointer is copied, rather than the contents.
ServerRequestName returns the transaction name for the server request, req.
SetContext sets the context for a transaction or error using information from req, resp, and body.
SetHeaders sets traceparent and tracestate headers on an http request.
SetTransactionContext sets tx.Result and, if the transaction is being sampled, sets tx.Context with information from req, resp, and body.
StartTransaction returns a new Transaction with name, created with tracer, and taking trace context from req.
StartTransactionWithBody returns a new Transaction with name, created with tracer, and taking trace context from req.
StatusCodeResult returns the transaction result value to use for the given status code.
UnknownRouteRequestName returns the transaction name for the server request, req, when the route could not be determined.
WithClientRequestName returns a ClientOption which sets r as the function to use to obtain the span name for the given http request.
WithClientSpanType sets the span type for HTTP client requests.
WithClientTrace returns a ClientOption for tracing events within HTTP client requests.
WithPanicPropagation returns a ServerOption which enable panic propagation.
WithRecovery returns a ServerOption which sets r as the recovery function to use for tracing server requests.
WithServerRequestIgnorer returns a ServerOption which sets r as the function to use to determine whether or not a server request should be ignored.
WithServerRequestName returns a ServerOption which sets r as the function to use to obtain the transaction name for the given server request.
WithTracer returns a ServerOption which sets t as the tracer to use for tracing server requests.
Wrap returns an http.Handler wrapping h, reporting each request as a transaction to Elastic APM.
WrapClient returns a new *http.Client with all fields copied across, and the Transport field wrapped with WrapRoundTripper such that client requests are reported as spans to Elastic APM if their context contains a sampled transaction.
WrapResponseWriter wraps an http.ResponseWriter and returns the wrapped value along with a *Response which will be filled in when the handler is called.
WrapRoundTripper returns an http.RoundTripper wrapping r, reporting each request as a span to Elastic APM, if the request's context contains a sampled transaction.
# Constants
ElasticTraceparentHeader is the legacy HTTP header for trace propagation, maintained for backwards compatibility with older agents.
TraceparentHeader is the HTTP header for trace propagation.
TracestateHeader is the standard W3C Trace-Context HTTP header for vendor-specific trace propagation.
W3CTraceparentHeader is the standard W3C Trace-Context HTTP header for trace propagation.
# Type aliases
ClientOption sets options for tracing client requests.
RecoveryFunc is the type of a function for use in WithRecovery.
RequestIgnorerFunc is the type of a function for use in WithServerRequestIgnorer.
RequestNameFunc is the type of a function for use in WithServerRequestName.
ServerOption sets options for tracing server requests.