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

Loki: Fix showing of correct line limit in options #69572

Merged
merged 2 commits into from
Jun 8, 2023

Conversation

ivanahuckova
Copy link
Member

Fixes: #69555

In this PR we simplifying the logic of preprocessMaxLines and we are returning:

  • undefined if value is:
    • empty string
    • non-numeric string (e.g. e)
    • negative number
  • actual number if it is valid number

This also fixes showing of correct log lines in the Query options as we have there query.maxLines ?? maxLines, which is correct, but it wasn't correctly working with NaN.

How to test:

  1. make sure your loki datasource has a configured line limit
  2. go to explore, run a query
  3. adjust the line-limit in the query editor, run the query
  4. now clear the value of the line-limit field in the query editor, run the query
  5. you should see correctly displayed configured log line limit from
lineLimit.mov

@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

Backend code coverage report for PR #69572
No changes

@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

Frontend code coverage report for PR #69572

Plugin Main PR Difference
loki 84.98% 85.22% .24%

@ivanahuckova ivanahuckova requested review from gabor and a team June 6, 2023 11:43
Copy link
Contributor

@gabor gabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@ivanahuckova ivanahuckova merged commit 0245ef6 into main Jun 8, 2023
14 checks passed
@ivanahuckova ivanahuckova deleted the ivana/loki-line-limit branch June 8, 2023 12:40
@ricky-undeadcoders ricky-undeadcoders modified the milestones: 10.1.x, 10.1.0 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loki: query editor: max-lines, if cleared, report NaN
4 participants