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: Add PPL response parser for logs and table format #7

Conversation

euniceek
Copy link

@euniceek euniceek commented Nov 20, 2020

What this PR does / why we need it:

This PR is one of several PRs targeting the elasticsearch-ppl-support-frontend branch, which should ultimately contain all the changes required for basic PPL support from the Elasticsearch plugin on the client-side. Basic PPL support entails being able to write PPL queries in the query editor and visualize responses from Elasticsearch instances with the ODFE SQL plugin installed. Expected functionality such as variable interpolation and ad hoc filtering should also work with PPL queries. Features that are out of scope for the elasticsearch-ppl-support-frontend branch include alerting on PPL queries and the option to use PPL queries in the dashboard settings menu.

This PR adds the functionality to parse PPL response for log and table visualization in Grafana. The response format is chosen by the user through a dropdown in the PPL query editor UI which is implemented in PR # 3. The response structure for PPL is in JDBC format, meaning the response consists of a schema containing the response field name and type, and the datarows array containing the data results. These two components are merged together and flattened to work with the current Elasticsearch data frame structure.

Please note that there is a bug in the response nested field when using PPL with Elasticsearch 7.9.1. It outputs extra types as fields causing the flatten method to include additional type names in their response. This bug has been fixed and will be available starting Elasticsearch 7.10.

image

image

Which issue(s) this PR fixes:

Partially resolves Grafana issue 28674

Special notes for your reviewer:

The relevant issue is not linked to avoid having this PR referenced in the issue conversation upstream.

cc: @alolita @robbierolin

@euniceek euniceek marked this pull request as ready for review November 23, 2020 06:28
@euniceek euniceek requested a review from alolita November 23, 2020 23:46
Copy link

@robbierolin robbierolin left a comment

Choose a reason for hiding this comment

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

LGTM

@euniceek euniceek force-pushed the elasticsearch-ppl-log-response branch from ccca174 to 900ca45 Compare November 26, 2020 23:57
Copy link

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants