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