-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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: Create Raw Data metric to render raw JSON docs in columns in the new table panel #26233
Conversation
@marefr @torkelo Could you please check this out and share your thoughts? I have followed up on #24521 and created a new metric as suggested. Also, do you have any suggestions on how to fix the blocker - when switching between the Raw Document and Raw Document v2 table does not update as new request is not sent (because the request is the same). |
not sure I understand why a new query is not issued, you will need to trigger a new query for the result processing to be re-executed
and then change text label (not value) for the old Raw document to Raw document (legacy). |
Figured that out in query_ctrl we are checking if queries are the same. I have added exception for Raw Data and Raw Doocument.
Changed to Raw Data, as I feel it is more clear and for intuitive for users based on Raw Document naming. Also they are right next to each other, so users can easily try it out, when they see Raw document (legacy). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have tested this. In general I wonder whether introducing a different Metric is the way to go. Worth consider having an option above or below Size
when Raw Document is selected. Maybe a switch/boolean for legacy format that's true if this property is null/undefined and when adding a new query and selecting Raw Document this gets set to false per default. Doing this gives us possibility to also add some tooltip/description of what it means. Thought?
Found some bugs.
Using Raw Data I cannot edit size option:
Comparing with old table panel and Raw Document query it doesn't include _source as a column, but using Raw Data does which feels wrong:
✅ Nice catch! Fixed in 2096cd0
✅ Removed in 611b692
Well yeah, that is a really good question and I think I might like the solution that you have just proposed slightly better. I have created a new metric as both you and @torkelo have suggested it in #24521 (comment) and #24163 (comment), so I thought that there was a consensus that this would be the best option. But I try to create another PR with the other solution and we can just choose whichever we like more. But we should make sure that this fix goes to 7.1 as it was promised. 🙂 |
I have created a new PR for the "switch-idea" #26323. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reverts commit a102ab2.
@@ -51,9 +51,15 @@ export class ElasticQueryCtrl extends QueryCtrl { | |||
} | |||
|
|||
queryUpdated() { | |||
// As Raw Data and Raw Document have the same request, we need to run refresh if they are updated | |||
const isPossiblyRawDataSwitch = this.target.metrics.some( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I get this logic here. We are checking only new ones so we do not actually compare to old one. Probably works but seems unintuitive here. Can we just use something similar to what we already have like this.oldTargetMetric
and then compare it to new one?
Probably a bit nitpicky, can be skipped if this should be time consuming, but I think it would make more clear what we are actually trying to figure out here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will create another PR for this.
All requested changes by Marcus are implemented. PR was reviewed by Andrej as Marcus is busy with other bug that directly affects 7.1 release.
…ns in the new table panel (#26233) * test * WIP: Create v2 version * Update tests, remove conosole logs, refactor * Remove incorrect types * Update type * Rename legacy and new metrics * Update * Run request when Raw Data tto Raw Document switch * Fix size updating * Remove _source field from table results as we are showing each source field as column * Remove _source just for metrics, not logs * Revert "Remove _source just for metrics, not logs" This reverts commit 611b692. * Revert "Remove _source field from table results as we are showing each source field as column" This reverts commit 31a9d5f. * Add vis preference for logs * Update visualisation to logs * Revert "Revert "Remove _source just for metrics"" This reverts commit a102ab2. Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> (cherry picked from commit 3fd8104)
…ns in the new table panel (#26233) * test * WIP: Create v2 version * Update tests, remove conosole logs, refactor * Remove incorrect types * Update type * Rename legacy and new metrics * Update * Run request when Raw Data tto Raw Document switch * Fix size updating * Remove _source field from table results as we are showing each source field as column * Remove _source just for metrics, not logs * Revert "Remove _source just for metrics, not logs" This reverts commit 611b692. * Revert "Remove _source field from table results as we are showing each source field as column" This reverts commit 31a9d5f. * Add vis preference for logs * Update visualisation to logs * Revert "Revert "Remove _source just for metrics"" This reverts commit a102ab2. Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> (cherry picked from commit 3fd8104)
What this PR does / why we need it:
Follows up on #24521. To be backwards compatible, I have created Raw Document v2 metric to process results as DataFrames and not SeriesList.
Blocker:
When switching between the Raw Document and Raw Document v2 table does not update as new request is not sent (because the request is the same).
Which issue(s) this PR fixes:
Fixes #24163