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

Date range aggregation does not convert ranges #9916

Closed
lukasolson opened this issue Jan 17, 2017 · 4 comments
Closed

Date range aggregation does not convert ranges #9916

lukasolson opened this issue Jan 17, 2017 · 4 comments
Labels
enhancement New value added to drive a business result Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@lukasolson
Copy link
Member

When you select a time range using the time picker (e.g. "Today"), the URL will update with a representation of this time range (e.g. { from: "now/d", to: "now/d" }). This is consistent with Elasticsearch's date math formats. However, what ends up being sent in the request to Elasticsearch isn't this same representation. It is converted to milliseconds since the epoch. You can see this in the request body:

{"range":{"date":{"gte":1483858800000,"lte":1484636400000,"format":"epoch_millis"}}}

From my understanding, the reasoning behind this is that the time on the Kibana/Elasticsearch server can be off from the time of the user using Kibana in the browser.

If you create a visualization, one of the aggregation types we support is "Date Range". If you select this aggregation, it allows you to specify different date ranges, and it accepts values in Elasticsearch date formats:

screen shot 2017-01-17 at 3 31 12 pm

However, the range in this case does NOT get converted on the client into number of milliseconds since the epoch. You can see this in the request body:

{"date_range":{"field":"date","ranges":[{"from":"now/d","to":"now/d"}]}}

This is inconsistent. Either we should always be translating to milliseconds since the epoch, or we should always stick to the relative format.

@lukasolson lukasolson added Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) Feature:Visualizations Generic visualization features (in case no more specific feature label is available) bug Fixes for quality problems that affect the customer experience labels Jan 17, 2017
@Bargs
Copy link
Contributor

Bargs commented Jan 18, 2017

Related #9427

These custom dates are a pain, we should really define our own syntax and translate everything into millis as @lukasolson said.

@ppisljar ppisljar added the P3 label Jan 18, 2017
@ppisljar
Copy link
Member

We should think this thru well, find every place this applies, decide on solution and only then proceed.

@epixa epixa removed the P3 label Apr 25, 2017
@timroes timroes added Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Visualizations Generic visualization features (in case no more specific feature label is available) labels Sep 16, 2018
@lukeelmers lukeelmers added enhancement New value added to drive a business result Team:AppArch and removed bug Fixes for quality problems that affect the customer experience labels Jul 2, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Jun 21, 2021
@ppisljar
Copy link
Member

ppisljar commented Aug 8, 2022

Thank you for contributing to this issue, however, we are closing this issue due to inactivity as part of a backlog grooming effort. If you believe this feature/bug should still be considered, please reopen with a comment.

@ppisljar ppisljar closed this as completed Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Aggregations Aggregation infrastructure (AggConfig, esaggs, ...) impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

7 participants