Skip to content

Add Compare metrics in Discover button to infrastructure metrics tables#273406

Merged
bryce-b merged 5 commits into
elastic:mainfrom
bryce-b:infra-tab-compare-discover
Jun 22, 2026
Merged

Add Compare metrics in Discover button to infrastructure metrics tables#273406
bryce-b merged 5 commits into
elastic:mainfrom
bryce-b:infra-tab-compare-discover

Conversation

@bryce-b

@bryce-b bryce-b commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a Compare metrics in Discover action to the host, container, and pod infrastructure metrics tables in metrics_data_access.
  • Introduces AnalyzeMetricButton and CompareMetricNodesLink, which build an ES|QL time-series query filtering the visible table rows and open Discover with a breakdown field for side-by-side metric comparison.
  • Wires the button into all three node-type tables and exports AnalyzeMetricButton from the infrastructure metrics tables public surface.
Screenshot.2026-06-10.at.2.52.41.PM.mov

Caveats

Currently, this implementation only captures the ids of entities from the first page of the infrastructure table. I think that this is sufficient for the feature, and to reduce potential for URI length limitation issues. For example: the containers table in the demo video has 10 pages of results. However, other solutions are welcome.

@bryce-b bryce-b marked this pull request as ready for review June 18, 2026 16:46
@bryce-b bryce-b requested a review from a team as a code owner June 18, 2026 16:46

@jennypavlova jennypavlova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The Code LGTM 💯 PS. The PR labels were missing, I guess we don't need to backport, do we?

);
const discoverParams = {
timeRange: { from: timerange.from, to: timerange.to },
breakdownField: getDiscoverBreakdownForNodeType(nodeType as NodeTypeForLink),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Q: Why do we need this type cast? From what I see the nodeType should be of type NodeTypeForLink 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I initial had the nodeType prop as a string, and refactored; missed this in the refactor. Thanks for catching it!

@jennypavlova jennypavlova added release_note:enhancement backport:skip This PR does not require backporting Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation labels Jun 18, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/obs-presentation-team (Team:obs-presentation)

@bryce-b bryce-b added the release_note:feature Makes this part of the condensed release notes label Jun 22, 2026
@bryce-b bryce-b enabled auto-merge (squash) June 22, 2026 15:19
@kibanamachine

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - UptimeIntegrationDeprecation - returns true when non-managed synthetics policies exist

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
metricsDataAccess 244 245 +1

Async chunks

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

id before after diff
metricsDataAccess 73.2KB 75.3KB +2.1KB

History

@bryce-b bryce-b merged commit 0df07e5 into elastic:main Jun 22, 2026
39 checks passed
mbondyra added a commit to mbondyra/kibana that referenced this pull request Jun 22, 2026
…g_generation

* commit '60291b6f7d78ff0d63fd22e399543fb8a444ace8': (78 commits)
  [Fleet] Take into account checkin jitter delay to compute offline status (elastic#274365)
  [ObsUX][Scout] Add global teardown + per-suite cleanup for APM/Infra/Profiling (elastic#274313)
  [Entity Store] Add CPS log extraction support (elastic#268007)
  [DOCS] Add changelogs for Jun 16 and 18 serverless releases (elastic#274217)
  Add Compare metrics in Discover button to infrastructure metrics tables (elastic#273406)
  [Content List] Migrate Graph Listing to Content List (elastic#268796)
  [One Workflow] Make workflow Liquid limit errors configurable (elastic#273596)
  Add Security data generator agent skill (elastic#274042)
  [Security Solution] Remove unnecessary async/act wrappers in InvestigationSection tests (elastic#274363)
  [User storage] improve dev docs (elastic#274073)
  [Security Solution] Refactor shared alert route handlers into pure operations (elastic#274228)
  [Flaky] Fix index.test.ts (fixes elastic#267813) (elastic#274242)
  Fix FIPS Pipeline - Leave OSS enabled (elastic#273776)
  [Alerting V2] Hide "Create with agent" button when agent builder is unavailable (elastic#274165)
  [ML] Remove old FTR filter lists API tests after migration to Scout (elastic#274374)
  [Fleet] Fix version selector not showing after uninstall when newer version is available (elastic#273929)
  Make profile ID available in Task Manager fake requests (elastic#261423)
  fix(test): logout before deleting anonymous_user to prevent afterEach timeout (elastic#274001)
  [Security Solution] Fix flaky install_table sort: guard against React state race in sortByTableColumn (elastic#274262)
  [discover-scout] Tabs FTR tests to Scout migration part 1 (elastic#272293)
  ...

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	x-pack/platform/plugins/shared/agent_builder_dashboards/server/skills/dashboard_management_skill.ts
#	x-pack/platform/plugins/shared/agent_builder_dashboards/server/tools/generate/core/operations/set_metadata.ts
flash1293 pushed a commit to flash1293/kibana that referenced this pull request Jun 23, 2026
…es (elastic#273406)

## Summary

- Adds a **Compare metrics in Discover** action to the host, container,
and pod infrastructure metrics tables in `metrics_data_access`.
- Introduces `AnalyzeMetricButton` and `CompareMetricNodesLink`, which
build an ES|QL time-series query filtering the visible table rows and
open Discover with a breakdown field for side-by-side metric comparison.
- Wires the button into all three node-type tables and exports
`AnalyzeMetricButton` from the infrastructure metrics tables public
surface.


https://github.com/user-attachments/assets/27a12a27-18be-4e37-978d-f8a41704c230

## Caveats
Currently, this implementation only captures the ids of entities from
the first page of the infrastructure table. I think that this is
sufficient for the feature, and to reduce potential for URI length
limitation issues. For example: the containers table in the demo video
has 10 pages of results. However, other solutions are welcome.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:enhancement release_note:feature Makes this part of the condensed release notes Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants