net/http.Server
HTTP server implementation.
Wrap http.Server.Handler
All of
- Configuration
- httpmode
wrap
- httpmode
- Struct literal
http.Server
- Pointer or Value
- Including field
Handler
- Not
- One of
- Import path
github.com/
go-chi/ chi/ v5 - Import path
github.com/
go-chi/ chi/ v5/ middleware - Import path
golang.org/
x/ net/ http2
Replace the expression using the template:
// Using the following synthetic imports:
import (
instrument "github.com/DataDog/orchestrion/instrument"
)
//dd:startwrap
instrument.WrapHandler({{.}})
//dd:endwrap
Wrap http.HandlerFunc
All of
- Configuration
- httpmode
wrap
- httpmode
- Function declaration
- Function literal expression
- Signature matches
- Arguments
- Results None
- Not
- One of
- Import path
github.com/
go-chi/ chi/ v5 - Import path
github.com/
go-chi/ chi/ v5/ middleware - Import path
golang.org/
x/ net/ http2
Replace the expression using the template:
// Using the following synthetic imports:
import (
instrument "github.com/DataDog/orchestrion/instrument"
)
instrument.WrapHandlerFunc({{.}})
Report http.HandlerFunc calls
All of
- Configuration
- httpmode
report
- httpmode
- Function body
- Function declaration
- Signature matches
- Arguments
- Results None
- Not
- One of
- Import path
github.com/
go-chi/ chi/ v5 - Import path
github.com/
go-chi/ chi/ v5/ middleware - Import path
golang.org/
x/ net/ http2
Prepend statements produced by the following template:
// Using the following synthetic imports:
import (
event "github.com/DataDog/orchestrion/instrument/event"
instrument "github.com/DataDog/orchestrion/instrument"
)
{{- $arg := .Function.Argument 1 -}}
{{- $name := .Function.Name -}}
{{$arg}} = {{$arg}}.WithContext(instrument.Report(
{{$arg}}.Context(),
event.EventStart,
{{with $name}}"function-name", {{printf "%q" .}},{{end}}
"span.kind", "server",
"http.method", {{$arg}}.Method,
"http.url", {{$arg}}.URL,
"http.useragent", {{$arg}}.Header.Get("User-Agent"),
{{ range .DirectiveArgs "dd:span" -}}{{printf "%q, %q,\n" .Key .Value}}{{ end }}
))
defer instrument.Report(
{{$arg}}.Context(),
event.EventEnd,
{{with $name}}"function-name", {{printf "%q" .}},{{end}}
"span.kind", "server",
"http.method", {{$arg}}.Method,
"http.url", {{$arg}}.URL,
"http.useragent", {{$arg}}.Header.Get("User-Agent"),
{{ range .DirectiveArgs "dd:span" -}}{{printf "%q, %q," .Key .Value}}{{- end }}
)