From 4a5762871ee138e9682fdd2188d797616630223d Mon Sep 17 00:00:00 2001 From: Gorbunov Kirill Andreevich Date: Mon, 18 Mar 2024 16:08:11 +0300 Subject: [PATCH] add flush --- handler/meter/meter.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/handler/meter/meter.go b/handler/meter/meter.go index 578c4bc..7d327cf 100644 --- a/handler/meter/meter.go +++ b/handler/meter/meter.go @@ -9,7 +9,6 @@ import ( "sync" codecpb "go.unistack.org/micro-proto/v3/codec" - "go.unistack.org/micro/v3/errors" "go.unistack.org/micro/v3/logger" "go.unistack.org/micro/v3/metadata" "go.unistack.org/micro/v3/meter" @@ -81,7 +80,7 @@ func NewHandler(opts ...Option) *Handler { func (h *Handler) Metrics(ctx context.Context, req *codecpb.Frame, rsp *codecpb.Frame) error { log, ok := logger.FromContext(ctx) if !ok { - log = logger.DefaultLogger() + log = logger.DefaultLogger } buf := bufPool.Get().(*bytes.Buffer) @@ -104,7 +103,7 @@ func (h *Handler) Metrics(ctx context.Context, req *codecpb.Frame, rsp *codecpb. } if err := h.opts.Meter.Write(w, h.opts.MeterOptions...); err != nil { - log.Error(ctx, errors.InternalServerError(h.opts.Name, "%v", err)) + log.Error(ctx, "http/meter: write failed", err) return nil }