[Lens] date histogram sent with wrong interval on non-time index-patterns #55165
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:Lens
Team:Visualizations
Visualization editors, elastic-charts and infrastructure
Kibana version:
master
Describe the bug:
If the selected index-pattern doesn't have a configured
time
field, Lens still display the time filter and still use the time filter range (and its date histogram interval) to aggregate a date field.This will to main issues:
date_histogram
interval relative to the time filter configured.Steps to reproduce:
To reproduce the
too many buckets
issue follow these steps:kibana_sample_data_logs
samples dataindex-pattern
calledkibana_sample_data_l*
without a time field specified (select theI don't want to use the Time Filter
option from the dropdown)Last 15 minutes
on the time filter@timestamp
field into the x axis.The query sent to elastic search will contain a date_histogram agg with the 30s interval (coming from the time filter) that is not ideal. An auto interval should be configured in that case, or we should apply the time filter to that query too
To reproduce the freeze issue follow these steps, it's a bit long, but I wasn't able to properly reproduce the same with a different data set
Check that all the data is ingested
GET opensky_aircrafts/_count
should return a value near 460058Set the timepicker to
Last 15 minutes
Select the
opensky_aircrafts
index, drag thebuilt
time field into the x field (lens will display the error of too many buckets, but you can go on)select count as the y field (the error still displayed)
Click on the
build
field and selectCustomize min interval
, select than 1 year. This will remove the error (because the data_histogram is now using a1 year
interval, but the min and max value of the chart are not always restricted to the last15 minutes
.Expected behavior:
If displaying data from a index-pattern without a default time field, than:
auto_date_histogram
to create a nice histogram without issuing a time filter or,Issues can arrive when mixing multiple layers from different indices: in this case the 2. solution will is preferable, or if on the 1. solution you should in some way warn the user of what is going on behind the scene like: "oh since you are adding a time sensitive index-pattern, we are now limiting the NON_TIME_SENSITIVE_INDEX_P to the same time-range selected"
The text was updated successfully, but these errors were encountered: