From a6e9e2e49b88947740fb76ca4586ac1994d1e1ac Mon Sep 17 00:00:00 2001 From: Steve Simpson Date: Thu, 11 Dec 2025 20:16:32 +0000 Subject: [PATCH] Alerting: Improve errors from failed requests in historian app. Passing an empty body to the query handler would result in the rather unhelpful response of "EOF", so add some prefixes to errors in useful places. --- apps/alerting/historian/pkg/app/notification/notification.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/alerting/historian/pkg/app/notification/notification.go b/apps/alerting/historian/pkg/app/notification/notification.go index 2a28e258de2..4ac89d2bb26 100644 --- a/apps/alerting/historian/pkg/app/notification/notification.go +++ b/apps/alerting/historian/pkg/app/notification/notification.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "errors" + "fmt" "net/http" "github.com/grafana/grafana-app-sdk/app" @@ -49,7 +50,7 @@ func (n *Notification) QueryHandler(ctx context.Context, writer app.CustomRouteR ErrStatus: metav1.Status{ Status: metav1.StatusFailure, Code: http.StatusBadRequest, - Message: err.Error(), + Message: fmt.Sprintf("parse request: %s", err.Error()), }} } @@ -67,7 +68,7 @@ func (n *Notification) QueryHandler(ctx context.Context, writer app.CustomRouteR ErrStatus: metav1.Status{ Status: metav1.StatusFailure, Code: http.StatusInternalServerError, - Message: err.Error(), + Message: fmt.Sprintf("notification query: %s", err.Error()), }} }