File tree Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -3,19 +3,19 @@ Package prometheus provides middleware to add Prometheus metrics.
33
44Example:
55```
6- package main
7- import (
8- "github.com/labstack/echo/v4"
9- "github.com/labstack/echo-contrib/prometheus"
10- )
11- func main() {
12- e := echo.New()
13- // Enable metrics middleware
14- p := prometheus.NewPrometheus("echo", nil)
15- p.Use(e)
16-
17- e.Logger.Fatal(e.Start(":1323"))
18- }
6+ package main
7+ import (
8+ "github.com/labstack/echo/v4"
9+ "github.com/labstack/echo-contrib/prometheus"
10+ )
11+ func main() {
12+ e := echo.New()
13+ // Enable metrics middleware
14+ p := prometheus.NewPrometheus("echo", nil)
15+ p.Use(e)
16+
17+ e.Logger.Fatal(e.Start(":1323"))
18+ }
1919```
2020*/
2121package prometheus
@@ -375,8 +375,6 @@ func (p *Prometheus) HandlerFunc(next echo.HandlerFunc) echo.HandlerFunc {
375375 start := time .Now ()
376376 reqSz := computeApproximateRequestSize (c .Request ())
377377
378- next (c )
379-
380378 status := strconv .Itoa (c .Response ().Status )
381379
382380 elapsed := float64 (time .Since (start )) / float64 (time .Second )
You can’t perform that action at this time.
0 commit comments