Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Go integrations/nrgorilla -- exclued heart beat routes.. can the exclude route names be added?


#1

func InstrumentRoutes(r *mux.Router, app newrelic.Application, heartbeat string) *mux.Router {
r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {
if route.GetName() == heartbeat {
return nil
}
fmt.Println("instrumenting " + route.GetName())
h := instrumentRoute(route.GetHandler(), app, routeName(route))
route.Handler(h)
return nil
})
if nil != r.NotFoundHandler {
r.NotFoundHandler = instrumentRoute(r.NotFoundHandler, app, “NotFoundHandler”)
}
return r

}


#2

Hey @Alexander.Polansky - It looks like this was posted twice, so I’m going to go ahead and merge this post into your other. :slight_smile:


#3

#4

A post was merged into an existing topic: Golang “github.com/newrelic/go-agent/_integrations/nrgorilla/v1” – nrgorilla.InstrumentRoutes