Skip to content

[8.19] [Discover][APM] Add link to view related errors in Discover from the full-screen waterfall (#224033)#224422

Merged
iblancof merged 2 commits intoelastic:8.19from
iblancof:backport/8.19/pr-224033
Jun 18, 2025
Merged

[8.19] [Discover][APM] Add link to view related errors in Discover from the full-screen waterfall (#224033)#224422
iblancof merged 2 commits intoelastic:8.19from
iblancof:backport/8.19/pr-224033

Conversation

@iblancof
Copy link
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

…full-screen waterfall (elastic#224033)

## Summary

Closes elastic#222591

This PR adds the link to the “View related error” / "View X related
errors" badge in the full-screen waterfall.

Unlike the same badge in APM, here it’s handled as a native `href`, so
the user keeps the option to open it in a new tab—avoiding loss of
context from Discover if they prefer.

 **Highlights**

* Created `ApmErrorsContextService` to access the configured APM error
indices.

* I had considered merging this with `TracesContextService` into a
shared `ApmContextService` (for both traces and errors), but decided to
keep them separate to avoid mixing methods and logic. Totally open to
revisit this if anyone feels that a shared service would make things
cleaner or more maintainable.

* Created `DataSourcesProvider` to easily access the relevant indices
within our flyouts.

* Built the Discover URL using the locator, preparing an ESQL query to
filter by `span.id` and `trace.id` across both error and log indices.

* Added `getRelatedErrorsHref` as a prop to `TraceWaterfallEmbeddable`,
allowing us to pass the errors URL directly.

* Why this approach instead of triggering a callback to the parent? We
wanted to preserve native link behavior (e.g., open in new tab), which
wouldn't work if navigation was handled via `navigateTo` from the
parent.

* Created `EmbeddableRelatedErrors` to handle the badge link.

* Agreed with the EUI team to cast the `href` as `any`, since due to the
component nesting in the waterfall, it was the cleanest way to make the
native link behavior work in this context.

* Created `ExitFullScreenButton` wrapper to enable exiting full-screen
mode with the `ESC` key.

https://github.com/user-attachments/assets/d3e476ae-ee10-410f-b003-02521dc35e13

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
Co-authored-by: Milosz Marcinkowski <38698566+miloszmarcinkowski@users.noreply.github.com>
(cherry picked from commit 87cb768)

# Conflicts:
#	x-pack/solutions/observability/plugins/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/accordion_waterfall.tsx
@iblancof iblancof requested a review from kibanamachine as a code owner June 18, 2025 12:35
@iblancof iblancof added the backport This PR is a backport of another PR label Jun 18, 2025
@iblancof iblancof enabled auto-merge (squash) June 18, 2025 12:35
@botelastic botelastic bot added the Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. label Jun 18, 2025
@elasticmachine
Copy link
Contributor

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

@iblancof iblancof self-assigned this Jun 18, 2025
@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 18, 2025

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #19 / Rules Management - Prebuilt Rules (Customization Enabled) @ess @serverless @skipInServerless Customize via bulk editing applies "delete_tags" bulk edit action to prebuilt rules
  • [job] [logs] Jest Tests #14 / StepDefineRule related integrations submits a selected related integration

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1970 1972 +2
canvas 1405 1407 +2
cloudSecurityPosture 721 723 +2
discover 1355 1357 +2
esqlDataGrid 450 452 +2
eventAnnotationListing 608 610 +2
lens 1455 1457 +2
logsExplorer 478 480 +2
logsShared 381 383 +2
observability 1339 1341 +2
searchPlayground 327 329 +2
securitySolution 7494 7496 +2
slo 1219 1221 +2
unifiedDocViewer 338 342 +4
unifiedHistogram 204 206 +2
total +32

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/discover-utils 316 320 +4

Async chunks

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

id before after diff
apm 2.7MB 2.7MB +865.0B
discover 1.1MB 1.1MB +566.0B
unifiedDocViewer 231.8KB 232.7KB +938.0B
total +2.3KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/discover-utils 4 5 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
discover 22.0KB 22.0KB -1.0B
Unknown metric groups

API count

id before after diff
@kbn/discover-utils 366 370 +4

History

cc @iblancof

@iblancof iblancof merged commit 32b8770 into elastic:8.19 Jun 18, 2025
8 checks passed
@iblancof iblancof deleted the backport/8.19/pr-224033 branch July 7, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants