Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detected field values: Response sometimes has space between digits and units, breaking queries #910

Open
gtk-grafana opened this issue Nov 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@gtk-grafana
Copy link
Contributor

Sometimes we get responses like this:

{"limit":1000,"values":["4.4 kB","568 kB","916 B","949 B","761 B","7.2 kB","865 B","1.7 kB","292 B","575 B","3.7 kB","17 kB","1.9 kB","866 kB","2.5 kB","2.1 kB","479 B","708 B","768 B","799 B","1.1 kB","79 kB","5.4 kB","3.2 kB","681 B","62 kB","596 B","921 B","297 B","3.3 kB","241 kB","6.4 kB","699 B","899 B","515 B","3.4 kB","550 B","2.7 kB","1.2 kB","432 B","1.5 kB","438 B","425 B","29 kB","5.2 kB","793 B","189 B","166 kB","38 kB","562 B","5.7 kB","175 kB","9.7 kB","0 B","13 kB","4.1 kB","654 B","3.1 kB","7.1 kB","30 kB","1.4 kB","409 kB","20 kB","7.6 kB","11 kB","1.8 kB","1.3 kB","504 B","2.6 kB"]}

And other times like this:

{"limit":1000,"values":["514B","116B","136B","154B","807B","908B","642B","775B"]}

Currently the spaces before the unit is making it into the query, which breaks the query as that is not valid logQL.
Please strip out white-spaces before the units and bring up to Loki folks to make sure this isn't a bug Loki side.

@gtk-grafana gtk-grafana added the bug Something isn't working label Nov 21, 2024
@gtk-grafana
Copy link
Contributor Author

gtk-grafana commented Nov 21, 2024

So this might be a bit more work then I was hoping in the frontend. We'll need to store the fieldType (e.g. bytes, float, duration, etc) in the JSON encoded value for the ad-hoc filter (like we currently store the parser) to only strip out white-space when the field is of type duration or bytes.

@gtk-grafana
Copy link
Contributor Author

gtk-grafana commented Nov 21, 2024

We're going to push on a Loki side change grafana/loki#15052 instead of needing to encode the field type with every field value for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant