func (h *fasthttpHandler) Handler(sn SegmentNamer, handler fasthttp.RequestHandler) fasthttp.RequestHandler {
	return func(ctx *fasthttp.RequestCtx) {
		auxCtx := context.Background()
		if h.cfg != nil {
			auxCtx = context.WithValue(context.Background(), fasthttpContextConfigKey, h.cfg)
			ctx.SetUserValue(fasthttpContextConfigKey, h.cfg)
		}
		name := sn.Name(string(ctx.Request.Host()))
		traceHeader := header.FromString(string(ctx.Request.Header.Peek(TraceIDHeaderKey)))
		req, err := fasthttpToNetHTTPRequest(ctx)
		if err != nil {
			ctx.Logger().Printf("%s", err.Error())
			ctx.Error("Internal Server Error", fasthttp.StatusInternalServerError)
			return
		}
		_, seg := NewSegmentFromHeader(auxCtx, name, req, traceHeader)
		defer seg.Close(nil)
		ctx.SetUserValue(fasthttpContextKey, seg)
		httpCaptureRequest(seg, req)
		fasthttpTrace(seg, handler, ctx, traceHeader)
	}
}
Handler wraps the provided fasthttp.RequestHandler
package xray
import (
	"context"
	"fmt"
	"net/http"
	"net/url"
	"github.com/aws/aws-xray-sdk-go/header"
	"github.com/valyala/fasthttp"
)
type FastHTTPHandler interface {
	Handler(SegmentNamer, fasthttp.RequestHandler) fasthttp.RequestHandler
}
type fasthttpHandler struct {
	cfg *Config
}
func NewFastHTTPInstrumentor(cfg *Config) FastHTTPHandler {
	return &fasthttpHandler{
		cfg: cfg,
	}
}