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

[Metrics App] Use the timefilter API to load and persist time range selections #79301

Closed
jasonrhodes opened this issue Oct 2, 2020 · 4 comments · Fixed by #85502
Closed

[Metrics App] Use the timefilter API to load and persist time range selections #79301

jasonrhodes opened this issue Oct 2, 2020 · 4 comments · Fixed by #85502
Assignees
Labels
enhancement New value added to drive a business result Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services

Comments

@jasonrhodes
Copy link
Member

jasonrhodes commented Oct 2, 2020

When users select a time range in one app in Kibana, moving to a different section of the app should probably retain that selected time range for them. We can achieve this by using the timefilter cache in the data plugin.

Notes:

Getting the timefilter state:

const { plugins } = useApmPluginContext();
const sharedTimeState = plugins.data.query.timefilter.timefilter.getTime();

Setting the timefilter state:

const { plugins } = useApmPluginContext();

function onTimeChange({ from, to }: { from: string; to: string }) {
    plugins.data.query.timefilter.timefilter.setTime({ from, to });
}

See APM's PR for this work: #79090

@jasonrhodes jasonrhodes added enhancement New value added to drive a business result Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services labels Oct 2, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@simianhacker
Copy link
Member

I think we should expand this issue to include changing the Inventory page from the custom time picker to the same EUI datepicker used everywhere else in Kibana. This change will require us to convert the inventory time from a single value to a range that supports date strings. This will also fix some UX issues with the current date picker:

  • the inability to refresh the screen without turning on auto-refresh
  • the inability to set the time to now (and refresh)
  • reinforce consistency for time across all of Kibana.

@cyrille-leclerc
Copy link
Contributor

I can obtain the propagation of the time range initially persisted on the APM screen similarly to the propagation I get navigating to the logs, user experience or synthetics screens.
See https://www.youtube.com/watch?v=CnRhKROgL3c&feature=youtu.be

@jasonrhodes
Copy link
Member Author

Hi @cyrille-leclerc -- the inventory page can't show the same kind of range(s) as all of the other apps because it handles a point in time instead of a range. We are looking at ways to address that in this ticket: #81046

As for the Metrics Explorer, we should be reading from the time filter. I will file a bug ticket and link to this one, so we can investigate why that's happening. Thanks for the comment and video!

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:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants