diff --git a/internal/observabilityproxy/appscope.go b/internal/observabilityproxy/appscope.go index 561a92ab8..526bd0b52 100644 --- a/internal/observabilityproxy/appscope.go +++ b/internal/observabilityproxy/appscope.go @@ -196,7 +196,10 @@ func lookupRefusal(label string, body io.Reader) *HTTPError { _ = json.NewDecoder(io.LimitReader(body, 64<<10)).Decode(&answer) switch { case strings.Contains(answer.Error, seriesLimitError): - return errorf(http.StatusUnprocessableEntity, "the application's %s lookup: %s", label, answer.Error) + // From the limit on: what precedes it is cluster vmselect's context, + // which can name vmstorage nodes. + limit := answer.Error[strings.Index(answer.Error, seriesLimitError):] + return errorf(http.StatusUnprocessableEntity, "the application's %s lookup: %s", label, limit) case strings.Contains(answer.Error, "timeout exceeded"): return errorf(http.StatusGatewayTimeout, "the application's %s lookup did not answer in time", label) default: diff --git a/internal/observabilityproxy/server_app_test.go b/internal/observabilityproxy/server_app_test.go index 9a56e9e18..52cfaa255 100644 --- a/internal/observabilityproxy/server_app_test.go +++ b/internal/observabilityproxy/server_app_test.go @@ -487,7 +487,7 @@ func TestServerApplicationLookupStoreErrors(t *testing.T) { } // Other store errors may name vmstorage nodes; only the limit // message, which the client can act on, is passed on. - if tc.want != http.StatusUnprocessableEntity && strings.Contains(string(body), "vmstorage") { + if strings.Contains(string(body), "vmstorage") { t.Errorf("the store's error text reached the client: %q", body) } }