contrib/valyala/fasthttp
Those integration are enabled by having the
following import in the project’s orchestrion.tool.go file:
import (
_ "github.com/DataDog/orchestrion"
_ "github.com/DataDog/dd-trace-go/contrib/valyala/fasthttp/v2" // integration
//...
)Package fasthttp provides a fast HTTP implementation for Go, with a focus on performance and low memory usage.
fasthttp.Server
Definition of
fasthttp.ServerIntroduce new declarations:
//go:linkname __dd_fasthttptrace_wrapHandler github.com/DataDog/dd-trace-go/contrib/valyala/fasthttp/v2.wrapHandlerWithDefaults
func __dd_fasthttptrace_wrapHandler(RequestHandler) RequestHandlerRecord link-time dependencies on:
Serve
Function body
- Function declaration
- Is method of
*fasthttp.Server - Function name
Serve
Prepend statements produced by the following template:
{{ $srv := .Function.Receiver }}
// Only wrap Handler once, even if Serve() is called multiple times
if !{{ $srv }}.DD_Instrumented && {{ $srv }}.Handler != nil {
{{ $srv }}.Handler = __dd_fasthttptrace_wrapHandler({{ $srv }}.Handler)
{{ $srv }}.DD_Instrumented = true
}