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

[Discover] Breakdown support for fieldstats #199028

Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3c51e10
[Discover] Breakdown support for fieldstats
mohamedhamed-ahmed Nov 5, 2024
3fad548
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Nov 5, 2024
3662347
Merge branch 'main' into 192700-fieldstats-popover-breakdown-field
mohamedhamed-ahmed Nov 5, 2024
2c66f0d
code refactor
mohamedhamed-ahmed Nov 6, 2024
064dd18
Merge branch '192700-fieldstats-popover-breakdown-field' of https://g…
mohamedhamed-ahmed Nov 6, 2024
93ffa66
bug fix
mohamedhamed-ahmed Nov 6, 2024
96848c1
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Nov 6, 2024
93b9894
revert code
mohamedhamed-ahmed Nov 6, 2024
39dc06a
Merge branch '192700-fieldstats-popover-breakdown-field' of https://g…
mohamedhamed-ahmed Nov 6, 2024
6f06144
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Nov 6, 2024
7297442
add unit tests
mohamedhamed-ahmed Nov 6, 2024
dfd7fb6
Merge branch '192700-fieldstats-popover-breakdown-field' of https://g…
mohamedhamed-ahmed Nov 6, 2024
3dd24d4
Merge branch 'main' into 192700-fieldstats-popover-breakdown-field
mohamedhamed-ahmed Nov 6, 2024
26c21e9
added component tests
mohamedhamed-ahmed Nov 6, 2024
a56102e
Merge branch 'main' into 192700-fieldstats-popover-breakdown-field
mohamedhamed-ahmed Nov 7, 2024
2e13155
code refactor
mohamedhamed-ahmed Nov 7, 2024
e491c54
code refactor
mohamedhamed-ahmed Nov 8, 2024
3b19865
Merge branch 'main' into 192700-fieldstats-popover-breakdown-field
mohamedhamed-ahmed Nov 8, 2024
263eaab
export fix
mohamedhamed-ahmed Nov 8, 2024
98ed647
icon change
mohamedhamed-ahmed Nov 8, 2024
f3d78dd
Merge branch 'main' into 192700-fieldstats-popover-breakdown-field
mohamedhamed-ahmed Nov 11, 2024
923e305
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Nov 11, 2024
62c0e56
code refactor and tests
mohamedhamed-ahmed Nov 11, 2024
31978dd
Tests
mohamedhamed-ahmed Nov 11, 2024
e0a313d
swap icon positions
mohamedhamed-ahmed Nov 12, 2024
f0e94eb
Merge branch 'main' into 192700-fieldstats-popover-breakdown-field
mohamedhamed-ahmed Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
code refactor
mohamedhamed-ahmed committed Nov 7, 2024
commit 2e13155bf940b6b0e00b9e4b4eba05085f6ec464
6 changes: 2 additions & 4 deletions packages/kbn-esql-utils/src/utils/esql_fields_utils.ts
Original file line number Diff line number Diff line change
@@ -63,8 +63,6 @@ export const isESQLColumnGroupable = (column: DatatableColumn): boolean => {
};

export const isESQLFieldGroupable = (field: FieldSpec): boolean => {
const isCounterTimeSeries = field.timeSeriesMetric === 'counter';
const esType =
isCounterTimeSeries && field.esTypes?.[0] ? `counter_${field.esTypes[0]}` : field.esTypes?.[0];
return isGroupable(field.type, esType);
if (field.timeSeriesMetric === 'counter') return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (field.timeSeriesMetric === 'counter') return false;
if (field.timeSeriesMetric) return false;

Other cases like histogram I guess also would not work.

Copy link
Contributor

Choose a reason for hiding this comment

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

They are not supported by ESQL yet. What other options can this timeseriesMetric take? Let's evaluate first before doing the suggested change

Copy link
Contributor

Choose a reason for hiding this comment

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

Here are possible values for data view mode

timeSeriesMetric?: 'histogram' | 'summary' | 'gauge' | 'counter' | 'position';

It does not exactly apply to ES|QL at the moment but it might in the future.

Copy link
Contributor

@stratoula stratoula Nov 11, 2024

Choose a reason for hiding this comment

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

I see, thanx for sharing Julia.

In the columns function we check for counter related metrics as only these are partially supported by ESQL and only for these we know for sure that they are not groupable.

We have 2 options. Either keep it as it is (which aligns with the above function) or change both.

I personally prefer the first option. (Aligns with the existing column function too). When more tsdb metrics will be added we should test (and update if is the case the isGroupable functionality). But I dont have a strong opinion, mostly a preference

return isGroupable(field.type, field.esTypes?.[0]);
};