The backend API should provide additional information in the HTTP response when there's an error
Is your feature request related to a problem? Please describe.
In case of errors, Pyroscope's API doesn't return any additional information other than the HTTP status code.
For instance, a time range that is too big triggers an HTTP 400 (Bad Request).
Because of this limitation, the consumers of the API (like the UI) are limited in terms of:
- UX/UI: the error message displayed to the user is generic and doesn't hint them at what the problem really is
- Retry strategy: even in case of transient errors, the user has to manually refresh the data or reload the full page
Describe the solution you'd like
- The API should return additional information in the HTTP response (error code and/or message)
Describe alternatives you've considered
-
Additional context
-
Yes I think this will quite important to give good feedback to the user.
We should maybe also think of a "warning". Something that went wrong, and might affect correctness, but still some result is there.
This sounds like a the plugin is currently hidden errors, I do get them when query directly pyroscope.
That might be true, but also error messages like this are not really helping anyone:
{
"code": "unknown",
"message": "invalid_argument: protocol error: incomplete envelope: stream error: stream ID 181157; CANCEL"
}
Another example:
GET /render?query=process_cpu%3Acpu%3Ananoseconds%3Acpu%3Ananoseconds%7Bservice_name%3D%22alerting-ops%2Fgrafana%22%7D&from=0&until=0&format=dot&max-nodes=100
Returns 500 Internal Server Error