middleware: add url scheme to traces
This commit is contained in:
parent
26a32350c9
commit
5991cb7e69
|
@ -14,7 +14,7 @@ import (
|
|||
// Trace adds go stdlib tracing to this http handler.
|
||||
func Trace(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
sp := trace.New(filepath.Base(os.Args[0]+"-http"), "http://"+r.Host+r.RequestURI)
|
||||
sp := trace.New(filepath.Base(os.Args[0]+"-http"), r.URL.Scheme+"://"+r.Host+r.RequestURI)
|
||||
defer sp.Finish()
|
||||
ctx, cancel := context.WithTimeout(r.Context(), 30*time.Second)
|
||||
defer cancel()
|
||||
|
|
Loading…
Reference in New Issue