mirror of
https://github.com/caddyserver/caddy.git
synced 2026-01-16 17:20:34 +00:00
create otel transport in Provision
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
This commit is contained in:
@@ -257,6 +257,7 @@ func (h *Handler) Provision(ctx caddy.Context) error {
|
||||
if module, ok := h.Transport.(caddy.Module); ok && module.CaddyModule().ID.Name() == "fastcgi" && h.RequestBuffers == 0 {
|
||||
h.RequestBuffers = 4096
|
||||
}
|
||||
h.Transport = otelhttp.NewTransport(h.Transport)
|
||||
}
|
||||
if h.LoadBalancing != nil && h.LoadBalancing.SelectionPolicyRaw != nil {
|
||||
mod, err := ctx.LoadModule(h.LoadBalancing, "SelectionPolicyRaw")
|
||||
@@ -867,8 +868,7 @@ func (h *Handler) reverseProxy(rw http.ResponseWriter, req *http.Request, origRe
|
||||
|
||||
// do the round-trip
|
||||
start := time.Now()
|
||||
otelTransport := otelhttp.NewTransport(h.Transport)
|
||||
res, err := otelTransport.RoundTrip(req)
|
||||
res, err := h.Transport.RoundTrip(req)
|
||||
duration := time.Since(start)
|
||||
|
||||
// record that the round trip is done for the 1xx response handler
|
||||
|
||||
Reference in New Issue
Block a user