Skip to content

Commit

Permalink
Fix metric start in iris integration (#321)
Browse files Browse the repository at this point in the history
Fix metric start in iris integration
  • Loading branch information
chimanjain authored Oct 12, 2022
1 parent c5b539c commit be6fad6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions iris/irisbrake.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@ import (
// It can be used with Use() methods.
func New(n *gobrake.Notifier) iris.Handler {
return func(ctx iris.Context) {
ctx.Next()
if n == nil {
log.Println("airbrake notifier not defined")
return
}

_, metric := gobrake.NewRouteMetric(context.TODO(), ctx.Method(), ctx.GetCurrentRoute().Path())

ctx.Next()
metric.StatusCode = ctx.GetStatusCode()
_ = n.Routes.Notify(context.TODO(), metric)

}
}

0 comments on commit be6fad6

Please sign in to comment.