v3.2.0
New Features
- Added support for
v7
of go-redis/redis in the new v3/integrations/nrredis-v7 package.
Changes
-
Updated Gorilla instrumentation to include request time spent in middlewares. Added new
nrgorilla.Middleware
and deprecatednrgorilla.InstrumentRoutes
. Register the new middleware as your first middleware usingRouter.Use
. See the godocs examples for more details.r := mux.NewRouter() // Always register the nrgorilla.Middleware first. r.Use(nrgorilla.Middleware(app)) // All handlers and custom middlewares will be instrumented. The // transaction will be available in the Request's context. r.Use(MyCustomMiddleware) r.Handle("/", makeHandler("index")) // The NotFoundHandler and MethodNotAllowedHandler must be instrumented // separately using newrelic.WrapHandle. The second argument to // newrelic.WrapHandle is used as the transaction name; the string returned // from newrelic.WrapHandle should be ignored. _, r.NotFoundHandler = newrelic.WrapHandle(app, "NotFoundHandler", makeHandler("not found")) _, r.MethodNotAllowedHandler = newrelic.WrapHandle(app, "MethodNotAllowedHandler", makeHandler("method not allowed")) http.ListenAndServe(":8000", r)