File tree Expand file tree Collapse file tree 4 files changed +7
-19
lines changed
internal/middlewares/middleware_metric Expand file tree Collapse file tree 4 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ require (
57
57
github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19
58
58
github.com/maragudk/gomponents v0.20.0
59
59
github.com/prometheus/common v0.48.0
60
- github.com/pubgo/dix v0.3.18
61
- github.com/pubgo/funk v0.5.52
60
+ github.com/pubgo/dix v0.3.19
61
+ github.com/pubgo/funk v0.5.56
62
62
github.com/pubgo/protobuild v0.0.21
63
63
github.com/rs/xid v1.5.0
64
64
github.com/rs/zerolog v1.33.0
Original file line number Diff line number Diff line change @@ -546,10 +546,10 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O
546
546
github.com/prometheus/procfs v0.6.0 /go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA =
547
547
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo =
548
548
github.com/prometheus/procfs v0.12.0 /go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo =
549
- github.com/pubgo/dix v0.3.18 h1:s7qkJUEuajBF3GhqucE6lv4pDXvfgfZ8CQaFUHnjXWY =
550
- github.com/pubgo/dix v0.3.18 /go.mod h1:J0PyuMm7mW6ZrN13l9xz0rtKbzliREFyvb7fuaGYyVw =
551
- github.com/pubgo/funk v0.5.52 h1:u/W7z3i+P6p/QV7mV5vL+OV9SxXPKo1OhQWCPOegAcc =
552
- github.com/pubgo/funk v0.5.52 /go.mod h1:kNSD071m7wU4ZXqsE15hqRobC0Pig7HI9Yil+3BESMc =
549
+ github.com/pubgo/dix v0.3.19 h1:a4RRmljw7ePUvc9uJKqXXs6JpYL8s3VqPP2NV2vxI9U =
550
+ github.com/pubgo/dix v0.3.19 /go.mod h1:J0PyuMm7mW6ZrN13l9xz0rtKbzliREFyvb7fuaGYyVw =
551
+ github.com/pubgo/funk v0.5.56 h1:LYpjOBDSSeTorRWda0lmf23sJNDm6ZtbbNS0xQjb1CE =
552
+ github.com/pubgo/funk v0.5.56 /go.mod h1:uAs5IQDz6ovr5zy4LC0Uq7No/eTIbeloSCjF0EQJesw =
553
553
github.com/pubgo/opendoc v0.0.5 h1:aM6xkBQ0XMSq8OWytl5JhTMBUv8L+aYQFXd2z9eNkZE =
554
554
github.com/pubgo/opendoc v0.0.5 /go.mod h1:uO//pJZTJNFEKGuGWrv51/of0EoyxO1il4MuoC3Enp0 =
555
555
github.com/pubgo/protobuild v0.0.21 h1:QSwh92QxsD6Mv7kQlowzE7fxtcOm1eMWmgADsD803Js =
Original file line number Diff line number Diff line change 5
5
"time"
6
6
7
7
"github.com/pubgo/funk/generic"
8
- "github.com/pubgo/funk/running"
9
- "github.com/pubgo/lava/core/lavacontexts"
10
8
"github.com/uber-go/tally/v4"
11
9
12
10
"github.com/pubgo/lava/core/metrics"
@@ -54,16 +52,6 @@ func (m MetricMiddleware) Middleware(next lava.HandlerFunc) lava.HandlerFunc {
54
52
55
53
grpcServerRpcCallTotal (m .m , req .Operation ())
56
54
57
- clientInfo := lavacontexts .GetClientInfo (ctx )
58
- if ! req .Client () && clientInfo != nil {
59
- m .m .Tagged (metrics.Tags {
60
- "server_name" : running .Project ,
61
- "server_method" : req .Operation (),
62
- "client_name" : clientInfo .GetName (),
63
- "client_method" : clientInfo .GetPath (),
64
- }).Counter ("grpc_server_info" ).Inc (1 )
65
- }
66
-
67
55
defer func () {
68
56
if ! generic .IsNil (gErr ) {
69
57
grpcServerRpcErrTotal (m .m , req .Operation ())
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ type httpRequest struct {
43
43
44
44
func (r * httpRequest ) Kind () string { return "http" }
45
45
func (r * httpRequest ) Operation () string {
46
- return fmt .Sprintf ("%s %s" , strings .TrimSpace (r .ctx .Method ()), strings .TrimSpace (r .ctx .Path () ))
46
+ return fmt .Sprintf ("%s %s" , strings .TrimSpace (r .ctx .Method ()), strings .TrimSpace (r .ctx .Route (). Path ))
47
47
}
48
48
func (r * httpRequest ) Client () bool { return false }
49
49
func (r * httpRequest ) Header () * lava.RequestHeader { return & r .ctx .Request ().Header }
You can’t perform that action at this time.
0 commit comments