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

[Lens] Options to scale metrics into a "rate per second" or "rate per minute" #77811

Closed
wylieconlon opened this issue Sep 17, 2020 · 3 comments · Fixed by #83904
Closed

[Lens] Options to scale metrics into a "rate per second" or "rate per minute" #77811

wylieconlon opened this issue Sep 17, 2020 · 3 comments · Fixed by #83904
Assignees
Labels
enhancement New value added to drive a business result Feature:Lens Project:LensDefault Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects

Comments

@wylieconlon
Copy link
Contributor

wylieconlon commented Sep 17, 2020

This issue is re-creating another issue which has turned into a discussion thread. This issue is focused on the implementation decisions for the average event rate aggregation.

Detailed description

Date histograms in Kibana have a minimum interval which is often higher than what users want to see. For example, when looking at 24 hours of data, Kibana prevents users from looking at a per-second value. To work around this, we should offer a "time scale" feature to give an approximate "rate per second". Some examples are:

  • Count of documents per second
  • Sum of quantity per second

The default scale would be "per second", and other intervals would be:

  • Per millisecond
  • Per minute
  • Per hour
  • Per day
  • Per week

I expect that we will combine these features into a single text input allowing the user to choose to scale their values to specific time intervals.

Inputs and outputs

This table is showing how I would expect the number 6000 to get converted in a few different examples:

Input time period Output time period Display
3 hours 1 hour 2,000/h
10 minutes 1 second 10/s
1 second 1 hour 360,000/h

In the last example, the user is actually scaling up the values instead of scaling down. We can't prevent this, so it's worth pointing out here that this is going to be possible.

Form design

This is shown as an advanced option in the form in this mock:

The form in the mock is allowing users to type any time interval they choose, which is definitely possible, but it might be preferable to have users select from a pre-defined list so that we can assign the right suffix.

Implementation details

We will offer this form option when:

  • There is a date histogram aggregation
  • Users are configuring the Count, Sum, or Derivative metrics- but not other metrics. (edit: removed Average)

There are two sub-features that are required to implement this:

  1. Scaling the numbers to a specific time period. This is equivalent to the TSVB feature allowing time scale (screenshot for clarification only):

Screen Shot 2020-09-17 at 2 44 28 PM

  1. Applying a "per second" or "per minute" suffix to values. This is equivalent to the TSVB feature allowing you to type a suffix manually (screenshot for clarification only):

Screen Shot 2020-09-17 at 2 49 44 PM

We will automatically configure the "per second" suffix when the data is scaled to 1 second. We will automatically configure the "per hour" suffix when the data is scaled to hourly.

@wylieconlon wylieconlon added enhancement New value added to drive a business result Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens Project:LensDefault labels Sep 17, 2020
@wylieconlon wylieconlon added this to Long-term goals in Lens via automation Sep 17, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@wylieconlon wylieconlon moved this from Long-term goals to Lens by default in Lens Sep 17, 2020
@flash1293
Copy link
Contributor

@wylieconlon Just to clarify - there wouldn't be a separate "rate" operation in the side bar for this, but it's a setting for the sum, average and derivative operations?

@wylieconlon
Copy link
Contributor Author

wylieconlon commented Sep 18, 2020

@flash1293 Yes, it would be an option on those functions, instead of a separate function. This lets us avoid creating new functions with potentially confusing names, which was proposed and rejected in the discussion thread. Based on @cchaos's previous work, we already agreed to have this as an option on the Derivative function. The only change is to take that concept and expand it to Count and Sum functions. (edit: not Average)

@flash1293 flash1293 added the loe:needs-research This issue requires some research before it can be worked on or estimated label Oct 2, 2020
@flash1293 flash1293 moved this from Lens by default to 7.11 in Lens Oct 8, 2020
@flash1293 flash1293 removed the loe:needs-research This issue requires some research before it can be worked on or estimated label Oct 12, 2020
@flash1293 flash1293 self-assigned this Nov 18, 2020
Lens automation moved this from 7.11 to Done Nov 30, 2020
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:Lens Project:LensDefault Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
No open projects
Lens
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants