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

Join Point
Definition of fasthttp.Server
Advice
Add new field DD_Instrumented of type bool.
Advice
Introduce new declarations:
//go:linkname __dd_fasthttptrace_wrapHandler github.com/DataDog/dd-trace-go/contrib/valyala/fasthttp/v2.wrapHandlerWithDefaults
func __dd_fasthttptrace_wrapHandler(RequestHandler) RequestHandler
Record link-time dependencies on:

Serve

Join Point
Function body
Advice
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
}