master
李伟乐 1 year ago
parent 7086f0bf01
commit 94791bf585
  1. 4
      middleware/prome/prometheus.go

@ -54,7 +54,8 @@ func recordUptime() {
} }
} }
func Prometheus(handler middleware.Handler) middleware.Handler { func Prometheus(handler middleware.Handler) middleware.Middleware {
return func(handler middleware.Handler) middleware.Handler {
return func(ctx context.Context, a any) (any, error) { return func(ctx context.Context, a any) (any, error) {
tr, ok := transport.FromServerContext(ctx) tr, ok := transport.FromServerContext(ctx)
if !ok { if !ok {
@ -79,3 +80,4 @@ func Prometheus(handler middleware.Handler) middleware.Handler {
return resp, err return resp, err
} }
} }
}

Loading…
Cancel
Save