-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Support for number, date and IP range data types #76971
Conversation
What is the plan for ip_range support in Kibana. Without the support in Discover (search, filter, interesting fields, tables), Visualizations the power of this field cannot be used. Also the documentation is slightly confusing on field type ip_range and the range aggregation for field type ip |
Pinging @elastic/kibana-app-services (Team:AppServices) |
I think this PR actually needs to go back into draft mode, sorry for the noise. While it does kind-of-work, I would like to test all the apps that are affected by this. For example, adding a filter from Discover causes an invalid query. |
jenkins test this |
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.
Mostly checked out Lens, this works pretty well. Do we have an issue already for adding the ability to do number histograms on number ranges?
I noticed a bug based on this, opened a separate issue because it's not directly related: #93433
@@ -127,6 +127,7 @@ export const rangeOperation: OperationDefinition<RangeIndexPatternColumn, 'field | |||
); | |||
}, | |||
onFieldChange: (oldColumn, field) => { | |||
// TODO: Handle switch with number_range fields |
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.
leftover?
it('should use provided value when number of generated buckets is less than histogram:maxBars', async function () { | ||
log.debug('Field = machine.ram_range'); | ||
await PageObjects.visEditor.selectField('machine.ram_range'); | ||
await PageObjects.common.sleep(1000); // fix this |
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.
Maybe we can retry the assertion in the next line instead of sleeping?
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.
Done. This pattern is used throughout the file but I don't need it here.
@flash1293 yes, I've updated the PR description to remove the Lens histogram changes, since we no longer support fixed interval histograms. |
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.
Tested around and this looks good to me for the Lens integration.
One thing to consider:
With partially unbounded ranges and histograms it's super easy to run very expensive queries that eventually run into OOM. E.g if there's a date range which starts at 2020-02-03
without an end date and you are doing a date histogram on them, it will eventually cause an OOM error on Elasticsearch (probably because it never stops creating buckets). Not sure how we can help with this from Kibana side though. Maybe you have an idea?
@flash1293 Does that happen when issuing the queries from Kibana, or just in dev tools? I think that the Kibana query would not do that because of the time filter + custom extents that are set on date histograms. Either way, an OOM in Elasticsearch sounds like a bug. I found this issue which appears to have closed the bug: elastic/elasticsearch#50109 |
@wylieconlon interestingly it happened to me in Kibana as well. Steps to reproduce:
|
@wylieconlon The issue you sent fixes this by adding a new parameter: |
@flash1293 Okay, I read the docs on If possible, I'd like to do this in a separate PR. This PR has been going on for way too long. |
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.
Sure, let's move it into a separate issue. LGTM otherwise
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.
code LGTM
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
* Support for number, date and IP ranges * Update tests * Ranges don't work with range agg * Fix test case * Allow Discover to create range filters * Supports ranges in Visualize, KQL, remove Lens support * Fix test mappings * Bring back field cache to work around bug * Fix some tests * Fix test expectation * Respond to review comments * Fix type error * Remove added sample data * Fix api_docs * Fix test
* Support for number, date and IP ranges * Update tests * Ranges don't work with range agg * Fix test case * Allow Discover to create range filters * Supports ranges in Visualize, KQL, remove Lens support * Fix test mappings * Bring back field cache to work around bug * Fix some tests * Fix test expectation * Respond to review comments * Fix type error * Remove added sample data * Fix api_docs * Fix test
Elasticsearch range types, like
integer_range
,date_range
, orip_range
, are now supported in only the following:Filtering support:
Support in esaggs:
Closes #12751
Checklist