pyroscope icon indicating copy to clipboard operation
pyroscope copied to clipboard

V2: Query API incompatibility around missing time windows

Open simonswine opened this issue 9 months ago • 2 comments

Describe the bug

A clear and concise description of what the bug is.

When using the v2 mode, the API behaves directly, it seems to treat the time window as required:

$ curl -H "content-type: application/json"  -d '{"label_names":["__profile_type__"]}' "http://v1/querier.v1.QuerierService/Series"
{"labelsSet":[{"labels":[...]}]}

$ curl -H "content-type: application/json"  -d '{"label_names":["__profile_type__"]}' "http://v2/querier.v1.QuerierService/Series"
{"code":"invalid_argument","message":"missing time range in the query"}%

Expected behavior

Follow the same API behaviour, with and without v2

simonswine avatar Mar 18 '25 11:03 simonswine

Good catch! This was intentional: I consider queries without the time range invalid, and I'd like to avoid bug-to-bug compatibility. Please clarify if there's a known case where we do rely on this behaviour.

kolesnikovae avatar Mar 19 '25 04:03 kolesnikovae

I guess I am not aware of any frontend/cli tool from us relying on it.

But my curl history, is using that a lot as it is easier than working out the timestamps.

We should update this:

https://github.com/grafana/pyroscope/blob/28e1d6cda8023cf111bcec914de2a26fa16c0c96/api/querier/v1/querier.proto#L50-L51

At worst, if it turns out someone is relying on this we can reinstate a form of old behaviour.

simonswine avatar Mar 19 '25 09:03 simonswine