diff --git a/context/http.go b/context/http.go index ab3a3744d..357f0dc32 100644 --- a/context/http.go +++ b/context/http.go @@ -133,6 +133,10 @@ func (ctx *httpRequestContext) Value(key interface{}) interface{} { return ctx.r } + if !strings.HasPrefix(keyStr, "http.request.") { + goto fallback + } + parts := strings.Split(keyStr, ".") if len(parts) != 3 { @@ -241,6 +245,10 @@ func (irw *instrumentedResponseWriter) Value(key interface{}) interface{} { return irw.ResponseWriter } + if !strings.HasPrefix(keyStr, "http.response.") { + goto fallback + } + parts := strings.Split(keyStr, ".") if len(parts) != 3 {