Skip to content

Commit 0bfc7e7

Browse files
committed
Fix example
Signed-off-by: Carlos de Paula <[email protected]>
1 parent 7da34ba commit 0bfc7e7

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

prometheus/prometheus.go

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ Package prometheus provides middleware to add Prometheus metrics.
33
44
Example:
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
*/
2121
package 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)

0 commit comments

Comments
 (0)