Skip to content

Commit

Permalink
fix: do not record ip in metric (#1016)
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq authored Oct 13, 2023
1 parent ceb40fa commit 933ca67
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/server/xecho/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,8 @@ func metricServerInterceptor() echo.MiddlewareFunc {
beg := time.Now()
err = next(c)
method := c.Request().Method + "_" + c.Path()
peer := c.RealIP()
if aid := extractAID(c); aid != "" {
peer += "?aid=" + aid
}
metric.ServerHandleHistogram.Observe(time.Since(beg).Seconds(), metric.TypeHTTP, method, peer)
metric.ServerHandleCounter.Inc(metric.TypeHTTP, method, peer, http.StatusText(c.Response().Status))
metric.ServerHandleHistogram.Observe(time.Since(beg).Seconds(), metric.TypeHTTP, method, extractAID(c))
metric.ServerHandleCounter.Inc(metric.TypeHTTP, method, extractAID(c), http.StatusText(c.Response().Status))
return err
}
}
Expand Down

0 comments on commit 933ca67

Please sign in to comment.