pyroscope icon indicating copy to clipboard operation
pyroscope copied to clipboard

The backend API should provide additional information in the HTTP response when there's an error

Open grafakus opened this issue 1 year ago • 4 comments

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

-

grafakus avatar Feb 15 '24 13:02 grafakus

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.

simonswine avatar Feb 15 '24 14:02 simonswine

This sounds like a the plugin is currently hidden errors, I do get them when query directly pyroscope.

cyriltovena avatar Feb 15 '24 16:02 cyriltovena

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"
}

simonswine avatar Feb 16 '24 08:02 simonswine

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

grafakus avatar Mar 06 '24 12:03 grafakus