metrico / qryn

⭐️ All-in-One Polyglot Observability with OLAP Storage for Logs, Metrics, Traces & Profiles. Drop-in Grafana Cloud replacement compatible with Loki, Prometheus, Tempo, Pyroscope, Opentelemetry, Datadog and beyond :rocket:
https://qryn.dev
GNU Affero General Public License v3.0
1.21k stars 67 forks source link

Grafana 9: step parameter behaviour #175

Closed lmangani closed 2 years ago

lmangani commented 2 years ago

The usage pattern for the step query parameter seems to have changed in Grafana 9.x switching to a time-unit-signed format to control the pixel to point resolution of visualised charts using the Resolution parameter. From the docs:

Resolution 1/1 sets step parameter of Loki metrics range queries such that each pixel corresponds to one data point. For better performance, lower resolutions can be picked. 1/2 only retrieves a data point for every other pixel, and 1/10 retrieves one data point per 10 pixels.

Grafana 8.x

/loki/api/v1/query_range?direction=BACKWARD&limit=1752&query=rate(%7Btype%3D%22prom%22%7D%5B1m%5D)&start=1656446049927000000&end=1656449649927000000&step=2"

Grafana 9.x

/loki/api/v1/query_range?direction=backward&end=1656448770349000000&limit=1000&query=rate%28%7Btype%3D%22prom%22%7D%5B1s%5D%29&start=1656445170349000000&step=2000ms

Issue

The step format change (2 vs 2000ms) results in excessive aggregation of time buckets in qryn 2.x

Assuming the 8.x format was expressed in seconds the new format should be scaled accordingly in the transpiler.

akvlad commented 2 years ago

Should be fixed in the 2.1.5 version.