Skip to content

Commit

Permalink
fix http metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
negrel committed Sep 23, 2024
1 parent c9d8806 commit 390dc3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/middlewares/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"time"

"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down Expand Up @@ -43,8 +44,8 @@ func ProvideMetrics(promRegistry *prometheus.Registry) Metrics {
err := c.Next()

labels := prometheus.Labels{
"path": c.Route().Path,
"method": c.Method(),
"path": utils.CopyString(c.Route().Path),
"method": utils.CopyString(c.Method()),
"status": strconv.Itoa(c.Response().StatusCode()),
}

Expand Down

0 comments on commit 390dc3f

Please sign in to comment.