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

Elasticsearch: Fix passing of limit and datalinks to logs data frame #68554

Merged
merged 2 commits into from
May 17, 2023

Conversation

ivanahuckova
Copy link
Member

@ivanahuckova ivanahuckova commented May 16, 2023

In this PR we are fixing processing of log response on backend by adding limit to meta and also by enhancing dataFrame with data links.

Similarly as with searchWords, the dataFrames processed on backend have searchWords and limit in meta.custom. Therefore in logsModel, we need to make sure that we read at both places.

Fixes #68427

How to test:

  • Run logs query with enableElasticsearchBackendQuerying enabled and make sure that in Explore, you see limit displayed in meta.
image

@github-actions
Copy link
Contributor

Backend code coverage report for PR #68554

Plugin Main PR Difference
elasticsearch 86.6% 86.6% 0%

@github-actions
Copy link
Contributor

Frontend code coverage report for PR #68554

Plugin Main PR Difference
elasticsearch 81.68% 81.54% -.14%

@ivanahuckova ivanahuckova added this to the 10.1.x milestone May 16, 2023
@ivanahuckova ivanahuckova added backport v10.0.x and removed backport A backport PR labels May 16, 2023
@ivanahuckova ivanahuckova modified the milestones: 10.1.x, 10.0.x May 16, 2023
Co-authored-by: François Massot <francois.massot@gmail.com>
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 👍

there's one thing though..

i wonder if it's a good idea to read frame.meta.custom in logsModel.ts. we are kind of making certain custom values not-custom.
(i understand that we have been doing it before with the custom-frame-type and also with searchWords).

maybe we could just make sure the javascript-dataframe-meta is in sync with go-dataframe-meta instead.
and in the meantime, while we are waiting for that to be done,
we could have a small function in elastic/datasource.ts that transforms a "backend dataframe" to "frontend dataframe" by adjusting the location of searchWords and limit.

not sure.
wdyt?

@ivanahuckova
Copy link
Member Author

@gabor based on this I would expect it being the other way around. So after this PR is merged elasticsearch does it correctly and we should make sure that other data sources use custom.

image

@gabor
Copy link
Contributor

gabor commented May 17, 2023

@gabor based on this I would expect it being the other way around. So after this PR is merged elasticsearch does it correctly and we should make sure that other data sources use custom.

image

oh, interesting, i did not see that comment there 👍

@ivanahuckova ivanahuckova merged commit dbbbc46 into main May 17, 2023
7 checks passed
@ivanahuckova ivanahuckova deleted the ivana/es-fix-logs-limit branch May 17, 2023 12:28
@grafanabot
Copy link
Contributor

The backport to v10.0.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-68554-to-v10.0.x origin/v10.0.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x dbbbc46351d81b1c97f8dfaed25f6f0609797967
# Push it to GitHub
git push --set-upstream origin backport-68554-to-v10.0.x
git switch main
# Remove the local backport branch
git branch -D backport-68554-to-v10.0.x

Then, create a pull request where the base branch is v10.0.x and the compare/head branch is backport-68554-to-v10.0.x.

@grafanabot grafanabot added the backport-failed Failed to generate backport PR. Please resolve conflicts and create one manually. label May 17, 2023
ivanahuckova added a commit that referenced this pull request May 17, 2023
…68554)

* Elasticsearch: Fix passing of limit and datalinks to logs data frame

* Update public/app/core/logsModel.ts

Co-authored-by: François Massot <francois.massot@gmail.com>

---------

Co-authored-by: François Massot <francois.massot@gmail.com>
(cherry picked from commit dbbbc46)
ivanahuckova added a commit that referenced this pull request May 17, 2023
…ata frame (#68626)

* Elasticsearch: Fix passing of limit and datalinks to logs data frame (#68554)

* Elasticsearch: Fix passing of limit and datalinks to logs data frame

* Update public/app/core/logsModel.ts

Co-authored-by: François Massot <francois.massot@gmail.com>

---------

Co-authored-by: François Massot <francois.massot@gmail.com>
(cherry picked from commit dbbbc46)

* Add missing comment
@zerok zerok modified the milestones: 10.0.x, 10.0.0-preview, 10.1.x May 31, 2023
@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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elasticsearch: limit metadata is not displayed after backend migration
6 participants