live: better error logging in push API (#36601)

This commit is contained in:
Alexander Emelin 2021-07-10 16:46:21 +03:00 committed by GitHub
parent d4a990215f
commit e1358eeb76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -89,6 +89,7 @@ func (g *Gateway) Handle(ctx *models.ReqContext) {
for _, mf := range metricFrames {
err := stream.Push(ctx.SignedInUser.OrgId, mf.Key(), mf.Frame())
if err != nil {
logger.Error("Error pushing frame", "error", err, "data", string(body))
ctx.Resp.WriteHeader(http.StatusInternalServerError)
return
}

View File

@ -191,6 +191,7 @@ func (s *Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
for _, mf := range metricFrames {
err := stream.Push(user.OrgId, mf.Key(), mf.Frame())
if err != nil {
logger.Error("Error pushing frame", "error", err, "data", string(body))
return
}
}