Skip to content

Conversation

@miloszmarcinkowski
Copy link
Contributor

@miloszmarcinkowski miloszmarcinkowski commented Nov 18, 2025

Summary

Closes #243167

The getDataRange function doesn't properly propagate selected values when users switch from Classic to ESQL view in Discover. We switched over to timeRange property provided by Discover plugin to solve this issue in the Metrics grid.

Before:

Screen.Recording.2025-11-18.at.17.23.35.mov

After:

Screen.Recording.2025-11-18.at.16.21.51.mov

How to test:

  • Go to Discover and switch to ESQL mode
  • Run TS metrics-*
  • Switch to Classic mode
  • Select absolute time range
  • Switch to ESQL mode
  • Select Last 15 minutes in the time range
  • Verify if the correct time range is applied to Metrics grid.

@miloszmarcinkowski miloszmarcinkowski added release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team backport:version Backport to applied version labels v9.3.0 v9.2.2 ci:beta-faster-pr-build Uses an alternative PR build pipeline with speed optimizations labels Nov 18, 2025
@miloszmarcinkowski miloszmarcinkowski marked this pull request as ready for review November 18, 2025 16:36
@miloszmarcinkowski miloszmarcinkowski requested a review from a team as a code owner November 18, 2025 16:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 1.2MB 1.2MB -93.0B

Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR @miloszmarcinkowski.

I'd like to propose a different approach.

From what I gathered, what’s happening here is that the Metrics Experience profile misses the fetch emissions that happen while the profile or component is still loading, which makes it not call updateTimeRange. That may be amplified by the fact that the component is lazy-loaded (just a guess).

We may be able to solve this on our end by ensuring that input$ calls updateTimeRange once when it first get subscribed, and making sure this is utilized by both metrics and traces or any other component exposed in the plugin.

I'm not sure whether this can be solved on Discover side, but it may also be worth investigating.

wdyt?

Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels ci:beta-faster-pr-build Uses an alternative PR build pipeline with speed optimizations release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v9.2.2 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Metrics][Discover] No results on first load

3 participants