Skip to content

Commit

Permalink
Merge pull request #317 from materialagora/fix/echo/times
Browse files Browse the repository at this point in the history
fix metric start
  • Loading branch information
chimanjain authored Oct 10, 2022
2 parents cbb0df0 + 356ba95 commit c5b539c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions echo/echobrake.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package echo

import (
"context"
"log"

"github.com/airbrake/gobrake/v5"
Expand All @@ -26,11 +25,12 @@ func (h *handler) handle(next echo.HandlerFunc) echo.HandlerFunc {
log.Println("airbrake notifier not defined")
return next(c)
}
_, metric := gobrake.NewRouteMetric(c.Request().Context(), c.Request().Method, c.Path())

err := next(c)
_, metric := gobrake.NewRouteMetric(context.TODO(), c.Request().Method, c.Path())

metric.StatusCode = c.Response().Status
_ = h.notifier.Routes.Notify(context.TODO(), metric)
_ = h.notifier.Routes.Notify(c.Request().Context(), metric)
return err
}
}

0 comments on commit c5b539c

Please sign in to comment.