Skip to content

Commit

Permalink
fix defer linting error
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewgdewar committed Nov 3, 2023
1 parent 3fb4995 commit ec63892
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/middleware/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ func MetricsMiddlewareWithConfig(config *MetricsConfig) echo.MiddlewareFunc {
method := ctx.Request().Method
path := MatchedRoute(ctx)
err := next(ctx)
timeStart := time.Since(start)
status := mapStatus(ctx.Response().Status)
defer config.Metrics.HttpStatusHistogram.WithLabelValues(status, method, path).Observe(time.Since(start).Seconds())
defer config.Metrics.HttpStatusHistogram.WithLabelValues(status, method, path).Observe(timeStart.Seconds())
return err
}
}
Expand Down

0 comments on commit ec63892

Please sign in to comment.