Skip to content

Commit df5b2b6

Browse files
authored
[8.19] [APM][Unified Waterfall] Enable telemetry by removing unnecessary stopPropagation calls and updating data-test-subj attributes (#229182) (#229566)
# Backport This will backport the following commits from `main` to `8.19`: - [[APM][Unified Waterfall] Enable telemetry by removing unnecessary stopPropagation calls and updating data-test-subj attributes (#229182)](#229182) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Irene Blanco","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-25T19:07:23Z","message":"[APM][Unified Waterfall] Enable telemetry by removing unnecessary stopPropagation calls and updating data-test-subj attributes (#229182)\n\n## Summary\n\nRelates to https://github.com/elastic/kibana/issues/225472\n\nWhile building the Unified Waterfall, part of the code was inspired by\nthe APM waterfall, and there were some `e.stopPropagation` calls that\nwere no longer needed and they were preventing the click event from\nreaching our EBT.\n\nTo bring those events back and enable telemetry analysis on waterfall\nusage, the `e.stopPropagation` calls have been removed, and a few\n`data-test-subj` attributes have been renamed and/or added.\n\nA minor UI issue with the dependency field was also detected and fixed\nalong the way.\n\n|Before|After|\n|-|-|\n|<img width=\"1317\" height=\"969\" alt=\"Screenshot 2025-07-23 at 17 26 11\"\nsrc=\"https://github.com/user-attachments/assets/bfea8171-9430-4480-9664-65d1e6780c61\"\n/>|<img width=\"1317\" height=\"965\" alt=\"Screenshot 2025-07-23 at 17 28\n27\"\nsrc=\"https://github.com/user-attachments/assets/46ddac58-c723-4ab2-82b7-b6d9ee9996b5\"\n/>|\n\n\n## How to test\n- Go to Discover in an Observability Solution space\n- Query traces (`FROM traces-*`)\n- Open any span/transaction flyout\n- Open the full screen waterfall\n- Open flyout from the waterfall\n- Check for the sent events, we now have clicks\n\n---------\n\nCo-authored-by: Cauê Marcondes <[email protected]>","sha":"46e1b78c9d6d282bd8222f69d4ab692b05cfb25a","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:obs-ux-infra_services","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[APM][Unified Waterfall] Enable telemetry by removing unnecessary stopPropagation calls and updating data-test-subj attributes","number":229182,"url":"https://github.com/elastic/kibana/pull/229182","mergeCommit":{"message":"[APM][Unified Waterfall] Enable telemetry by removing unnecessary stopPropagation calls and updating data-test-subj attributes (#229182)\n\n## Summary\n\nRelates to https://github.com/elastic/kibana/issues/225472\n\nWhile building the Unified Waterfall, part of the code was inspired by\nthe APM waterfall, and there were some `e.stopPropagation` calls that\nwere no longer needed and they were preventing the click event from\nreaching our EBT.\n\nTo bring those events back and enable telemetry analysis on waterfall\nusage, the `e.stopPropagation` calls have been removed, and a few\n`data-test-subj` attributes have been renamed and/or added.\n\nA minor UI issue with the dependency field was also detected and fixed\nalong the way.\n\n|Before|After|\n|-|-|\n|<img width=\"1317\" height=\"969\" alt=\"Screenshot 2025-07-23 at 17 26 11\"\nsrc=\"https://github.com/user-attachments/assets/bfea8171-9430-4480-9664-65d1e6780c61\"\n/>|<img width=\"1317\" height=\"965\" alt=\"Screenshot 2025-07-23 at 17 28\n27\"\nsrc=\"https://github.com/user-attachments/assets/46ddac58-c723-4ab2-82b7-b6d9ee9996b5\"\n/>|\n\n\n## How to test\n- Go to Discover in an Observability Solution space\n- Query traces (`FROM traces-*`)\n- Open any span/transaction flyout\n- Open the full screen waterfall\n- Open flyout from the waterfall\n- Check for the sent events, we now have clicks\n\n---------\n\nCo-authored-by: Cauê Marcondes <[email protected]>","sha":"46e1b78c9d6d282bd8222f69d4ab692b05cfb25a"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229182","number":229182,"mergeCommit":{"message":"[APM][Unified Waterfall] Enable telemetry by removing unnecessary stopPropagation calls and updating data-test-subj attributes (#229182)\n\n## Summary\n\nRelates to https://github.com/elastic/kibana/issues/225472\n\nWhile building the Unified Waterfall, part of the code was inspired by\nthe APM waterfall, and there were some `e.stopPropagation` calls that\nwere no longer needed and they were preventing the click event from\nreaching our EBT.\n\nTo bring those events back and enable telemetry analysis on waterfall\nusage, the `e.stopPropagation` calls have been removed, and a few\n`data-test-subj` attributes have been renamed and/or added.\n\nA minor UI issue with the dependency field was also detected and fixed\nalong the way.\n\n|Before|After|\n|-|-|\n|<img width=\"1317\" height=\"969\" alt=\"Screenshot 2025-07-23 at 17 26 11\"\nsrc=\"https://github.com/user-attachments/assets/bfea8171-9430-4480-9664-65d1e6780c61\"\n/>|<img width=\"1317\" height=\"965\" alt=\"Screenshot 2025-07-23 at 17 28\n27\"\nsrc=\"https://github.com/user-attachments/assets/46ddac58-c723-4ab2-82b7-b6d9ee9996b5\"\n/>|\n\n\n## How to test\n- Go to Discover in an Observability Solution space\n- Query traces (`FROM traces-*`)\n- Open any span/transaction flyout\n- Open the full screen waterfall\n- Open flyout from the waterfall\n- Check for the sent events, we now have clicks\n\n---------\n\nCo-authored-by: Cauê Marcondes <[email protected]>","sha":"46e1b78c9d6d282bd8222f69d4ab692b05cfb25a"}}]}] BACKPORT-->
1 parent b7b1e53 commit df5b2b6

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

x-pack/solutions/observability/plugins/apm/public/components/shared/trace_waterfall/toggle_accordion_button.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import React from 'react';
99
import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiToolTip } from '@elastic/eui';
10+
import { i18n } from '@kbn/i18n';
1011
import { asBigNumber } from '../../../../common/utils/formatters';
1112

1213
export const TOGGLE_BUTTON_WIDTH = 20;
@@ -23,17 +24,22 @@ export function ToggleAccordionButton({ isOpen, childrenCount, onClick }: Props)
2324
justifyContent="center"
2425
responsive={false}
2526
css={{ position: 'relative', width: `${TOGGLE_BUTTON_WIDTH}px` }}
27+
data-test-subj="toggleAccordionButton"
28+
onClick={onClick}
29+
onKeyDown={(e) => {
30+
if (onClick && (e.key === 'Enter' || e.key === ' ')) {
31+
e.preventDefault(); // Prevent scroll if Space is pressed
32+
onClick();
33+
}
34+
}}
35+
tabIndex={0}
36+
role="button"
37+
aria-label={i18n.translate('xpack.apm.toggleAccordionButton', {
38+
defaultMessage: 'Toggle accordion',
39+
})}
2640
>
2741
<EuiFlexItem grow={false}>
28-
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}
29-
<div
30-
onClick={(e) => {
31-
e.stopPropagation();
32-
onClick();
33-
}}
34-
>
35-
<EuiIcon type={isOpen ? 'arrowDown' : 'arrowRight'} />
36-
</div>
42+
<EuiIcon type={isOpen ? 'arrowDown' : 'arrowRight'} />
3743
</EuiFlexItem>
3844
<EuiFlexItem grow={false}>
3945
<div

x-pack/solutions/observability/plugins/apm/public/components/shared/trace_waterfall/trace_item_row.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ export function TraceItemRow({ item, childrenCount, state, onToggle }: Props) {
4646
<>
4747
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}
4848
<div
49+
data-test-subj="traceItemRowWrapper"
4950
css={css`
5051
border-bottom: ${euiTheme.border.thin};
5152
${onClick || hasToggle ? 'cursor: pointer;' : 'cursor: default'}
5253
`}
53-
onClick={(e: React.MouseEvent) => {
54+
onClick={() => {
5455
if (!hasToggle && onClick) {
55-
e.stopPropagation();
5656
onClick(item.id);
5757
}
5858
}}
@@ -78,6 +78,7 @@ export function TraceItemRow({ item, childrenCount, state, onToggle }: Props) {
7878
{hasToggle ? (
7979
<EuiFlexItem grow={false}>
8080
<ToggleAccordionButton
81+
data-test-subj="traceItemRowToggleAccordionButton"
8182
isOpen={state === 'open'}
8283
childrenCount={childrenCount}
8384
onClick={() => onToggle(item.id)}
@@ -86,13 +87,12 @@ export function TraceItemRow({ item, childrenCount, state, onToggle }: Props) {
8687
) : null}
8788
<EuiFlexItem>
8889
<div
89-
data-test-subj="trace-bar-row"
90+
data-test-subj="traceItemRowContent"
9091
css={css`
9192
margin-left: ${calculateMarginLeft()}px;
9293
`}
93-
onClick={(e: React.MouseEvent) => {
94+
onClick={() => {
9495
if (hasToggle && onClick) {
95-
e.stopPropagation();
9696
onClick(item.id);
9797
}
9898
}}
@@ -138,11 +138,6 @@ export function TraceItemRow({ item, childrenCount, state, onToggle }: Props) {
138138
paddingSize="none"
139139
forceState={state}
140140
arrowDisplay="none"
141-
onToggle={() => {
142-
if (hasToggle) {
143-
onToggle(item.id);
144-
}
145-
}}
146141
buttonContentClassName="accordion__buttonContent"
147142
css={css`
148143
.accordion__buttonContent {

0 commit comments

Comments
 (0)