Documentation
¶
Index ¶
- func Client(client *http.Client) *http.Client
- func Handler(tn TracingNamer, h http.Handler) http.Handler
- func HandlerWithClient(tn TracingNamer, client *xray.Client, h http.Handler) http.Handler
- func RoundTripper(rt http.RoundTripper) http.RoundTripper
- func WithClientTrace(ctx context.Context) (context.Context, context.CancelFunc)
- type DynamicTracingNamer
- type FixedTracingNamer
- type TracingNamer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Client ¶
Client creates a shallow copy of the provided http client, defaulting to http.DefaultClient, with roundtripper wrapped with xrayhttp.RoundTripper.
func Handler ¶
func Handler(tn TracingNamer, h http.Handler) http.Handler
Handler wraps the provided http handler with xray.Capture
func HandlerWithClient ¶
HandlerWithClient wraps the provided http handler with xray.Capture
func RoundTripper ¶
func RoundTripper(rt http.RoundTripper) http.RoundTripper
RoundTripper wraps the provided http roundtripper with xray.Capture, sets HTTP-specific xray fields, and adds the trace header to the outbound request.
func WithClientTrace ¶
WithClientTrace returns a new context based on the provided parent ctx.
Types ¶
type DynamicTracingNamer ¶ added in v0.0.2
DynamicTracingNamer chooses names for segments generated for incoming requests by parsing the HOST header of the incoming request. If the host header matches a given recognized pattern (using the included pattern package), it is used as the segment name. Otherwise, the fallback name is used.
func (DynamicTracingNamer) TracingName ¶ added in v0.0.2
func (tn DynamicTracingNamer) TracingName(r *http.Request) string
TracingName implements TracingNamer.
type FixedTracingNamer ¶
type FixedTracingNamer string
FixedTracingNamer records the fixed name of service node.
func (FixedTracingNamer) TracingName ¶
func (tn FixedTracingNamer) TracingName(r *http.Request) string
TracingName implements TracingNamer.
type TracingNamer ¶
TracingNamer is the interface for naming service node. If it returns empty string, the value of AWS_XRAY_TRACING_NAME environment value is used.