Skip to content

[Discover][Traces] Fix processed OTel waterfall flyout#224548

Merged
iblancof merged 3 commits intoelastic:mainfrom
iblancof:discover-apm-fix-processed-otel-waterfall-flyout
Jun 19, 2025
Merged

[Discover][Traces] Fix processed OTel waterfall flyout#224548
iblancof merged 3 commits intoelastic:mainfrom
iblancof:discover-apm-fix-processed-otel-waterfall-flyout

Conversation

@iblancof
Copy link
Contributor

@iblancof iblancof commented Jun 19, 2025

Summary

Relates to #208707

While reviewing the Traces in Discover feature, we noticed a couple of issues affecting processed OTel data in the waterfall flyout:

  • The data wasn’t properly formatted because we were pulling it directly from _source, which meant the UI wasn’t receiving the processed version. Now we're using fields the same way it's used in Discover.
  • The logic used to set the flyout title (to determine whether the document was a span or a transaction) relied entirely on the presence of parent.id. However, since transactions can also be children of other transactions, we’ve added an extra check using transaction.name (spans reference the parent transaction via transaction.id) to ensure we're correctly identifying spans.
Discover Transaction Span
Before Screenshot 2025-06-19 at 12 48 32 Screenshot 2025-06-19 at 12 50 02 Screenshot 2025-06-19 at 12 49 47
After Same than before. Screenshot 2025-06-19 at 12 51 11 Screenshot 2025-06-19 at 12 47 52

@iblancof iblancof self-assigned this Jun 19, 2025
@iblancof iblancof requested a review from a team June 19, 2025 11:13
@iblancof iblancof added release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Jun 19, 2025
@elasticmachine
Copy link
Contributor

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

Comment on lines +12 to +14
export const isSpanHit = (hit: DataTableRecord | null): boolean => {
return !!hit?.flattened[PARENT_ID_FIELD] && !hit?.flattened[TRANSACTION_NAME_FIELD];
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this is a dumb question, but since unprocessed OTel data doesn't have a transaction field (afaik), will this work?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this will work anyway with unprocessed OTEL data yet, at least looking at the code, since it is querying for transactions. I think that would be best tackled as a separate PR/step.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the specifics for non-processed OTel data compatibility are being handled in a separate issue, but I think we’ll likely end up with something similar to what you, @Bluefinger, did in this PR, using a combination of processor.event and kind.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rmyz This PR #224654 updates the logic to support compatibility with non-processed data as well.

@iblancof iblancof enabled auto-merge (squash) June 19, 2025 12:12
@iblancof iblancof merged commit e0a4b63 into elastic:main Jun 19, 2025
22 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15758553653

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
unifiedDocViewer 330 331 +1

Async chunks

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

id before after diff
unifiedDocViewer 223.4KB 223.5KB +84.0B

cc @iblancof

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 19, 2025
## Summary

Relates to elastic#208707

While reviewing the Traces in Discover feature, we noticed a couple of
issues affecting processed OTel data in the waterfall flyout:

- The data wasn’t properly formatted because we were pulling it directly
from `_source`, which meant the UI wasn’t receiving the processed
version. Now we're using `fields` the same way it's used in Discover.
- The logic used to set the flyout title (to determine whether the
document was a span or a transaction) relied entirely on the presence of
`parent.id`. However, since transactions can also be children of other
transactions, we’ve added an extra check using `transaction.name` (spans
reference the parent transaction via `transaction.id`) to ensure we're
correctly identifying spans.

||Discover|Transaction|Span|
|-|-|-|-|
|Before|![Screenshot 2025-06-19 at 12 48
32](https://github.com/user-attachments/assets/7a2f7db9-c348-40b7-a974-c57436db70f1)|![Screenshot
2025-06-19 at 12 50
02](https://github.com/user-attachments/assets/18098108-12e9-4ed0-8fae-f9653729272b)|![Screenshot
2025-06-19 at 12 49
47](https://github.com/user-attachments/assets/6aa120b8-ba0f-48e7-b775-ab8101849635)|
|After|Same than before.|![Screenshot 2025-06-19 at 12 51
11](https://github.com/user-attachments/assets/3e29bd8a-d803-4efd-8bde-7baa63f25067)|![Screenshot
2025-06-19 at 12 47
52](https://github.com/user-attachments/assets/f82bc2a9-02a8-4a98-94ba-1449e8588d78)|

(cherry picked from commit e0a4b63)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 20, 2025
… (#224574)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Discover][Traces] Fix processed OTel waterfall flyout
(#224548)](#224548)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Irene
Blanco","email":"irene.blanco@elastic.co"},"sourceCommit":{"committedDate":"2025-06-19T13:03:56Z","message":"[Discover][Traces]
Fix processed OTel waterfall flyout (#224548)\n\n## Summary\n\nRelates
to https://github.com/elastic/kibana/issues/208707\n\n\nWhile reviewing
the Traces in Discover feature, we noticed a couple of\nissues affecting
processed OTel data in the waterfall flyout:\n\n- The data wasn’t
properly formatted because we were pulling it directly\nfrom `_source`,
which meant the UI wasn’t receiving the processed\nversion. Now we're
using `fields` the same way it's used in Discover.\n- The logic used to
set the flyout title (to determine whether the\ndocument was a span or a
transaction) relied entirely on the presence of\n`parent.id`. However,
since transactions can also be children of other\ntransactions, we’ve
added an extra check using `transaction.name` (spans\nreference the
parent transaction via `transaction.id`) to ensure we're\ncorrectly
identifying
spans.\n\n||Discover|Transaction|Span|\n|-|-|-|-|\n|Before|![Screenshot
2025-06-19 at 12
48\n32](https://github.com/user-attachments/assets/7a2f7db9-c348-40b7-a974-c57436db70f1)|![Screenshot\n2025-06-19
at 12
50\n02](https://github.com/user-attachments/assets/18098108-12e9-4ed0-8fae-f9653729272b)|![Screenshot\n2025-06-19
at 12
49\n47](https://github.com/user-attachments/assets/6aa120b8-ba0f-48e7-b775-ab8101849635)|\n|After|Same
than before.|![Screenshot 2025-06-19 at 12
51\n11](https://github.com/user-attachments/assets/3e29bd8a-d803-4efd-8bde-7baa63f25067)|![Screenshot\n2025-06-19
at 12
47\n52](https://github.com/user-attachments/assets/f82bc2a9-02a8-4a98-94ba-1449e8588d78)|","sha":"e0a4b63a98401971dc512e2ea370388502f12f4a","branchLabelMapping":{"^v9.1.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"],"title":"[Discover][Traces]
Fix processed OTel waterfall
flyout","number":224548,"url":"https://github.com/elastic/kibana/pull/224548","mergeCommit":{"message":"[Discover][Traces]
Fix processed OTel waterfall flyout (#224548)\n\n## Summary\n\nRelates
to https://github.com/elastic/kibana/issues/208707\n\n\nWhile reviewing
the Traces in Discover feature, we noticed a couple of\nissues affecting
processed OTel data in the waterfall flyout:\n\n- The data wasn’t
properly formatted because we were pulling it directly\nfrom `_source`,
which meant the UI wasn’t receiving the processed\nversion. Now we're
using `fields` the same way it's used in Discover.\n- The logic used to
set the flyout title (to determine whether the\ndocument was a span or a
transaction) relied entirely on the presence of\n`parent.id`. However,
since transactions can also be children of other\ntransactions, we’ve
added an extra check using `transaction.name` (spans\nreference the
parent transaction via `transaction.id`) to ensure we're\ncorrectly
identifying
spans.\n\n||Discover|Transaction|Span|\n|-|-|-|-|\n|Before|![Screenshot
2025-06-19 at 12
48\n32](https://github.com/user-attachments/assets/7a2f7db9-c348-40b7-a974-c57436db70f1)|![Screenshot\n2025-06-19
at 12
50\n02](https://github.com/user-attachments/assets/18098108-12e9-4ed0-8fae-f9653729272b)|![Screenshot\n2025-06-19
at 12
49\n47](https://github.com/user-attachments/assets/6aa120b8-ba0f-48e7-b775-ab8101849635)|\n|After|Same
than before.|![Screenshot 2025-06-19 at 12
51\n11](https://github.com/user-attachments/assets/3e29bd8a-d803-4efd-8bde-7baa63f25067)|![Screenshot\n2025-06-19
at 12
47\n52](https://github.com/user-attachments/assets/f82bc2a9-02a8-4a98-94ba-1449e8588d78)|","sha":"e0a4b63a98401971dc512e2ea370388502f12f4a"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224548","number":224548,"mergeCommit":{"message":"[Discover][Traces]
Fix processed OTel waterfall flyout (#224548)\n\n## Summary\n\nRelates
to https://github.com/elastic/kibana/issues/208707\n\n\nWhile reviewing
the Traces in Discover feature, we noticed a couple of\nissues affecting
processed OTel data in the waterfall flyout:\n\n- The data wasn’t
properly formatted because we were pulling it directly\nfrom `_source`,
which meant the UI wasn’t receiving the processed\nversion. Now we're
using `fields` the same way it's used in Discover.\n- The logic used to
set the flyout title (to determine whether the\ndocument was a span or a
transaction) relied entirely on the presence of\n`parent.id`. However,
since transactions can also be children of other\ntransactions, we’ve
added an extra check using `transaction.name` (spans\nreference the
parent transaction via `transaction.id`) to ensure we're\ncorrectly
identifying
spans.\n\n||Discover|Transaction|Span|\n|-|-|-|-|\n|Before|![Screenshot
2025-06-19 at 12
48\n32](https://github.com/user-attachments/assets/7a2f7db9-c348-40b7-a974-c57436db70f1)|![Screenshot\n2025-06-19
at 12
50\n02](https://github.com/user-attachments/assets/18098108-12e9-4ed0-8fae-f9653729272b)|![Screenshot\n2025-06-19
at 12
49\n47](https://github.com/user-attachments/assets/6aa120b8-ba0f-48e7-b775-ab8101849635)|\n|After|Same
than before.|![Screenshot 2025-06-19 at 12
51\n11](https://github.com/user-attachments/assets/3e29bd8a-d803-4efd-8bde-7baa63f25067)|![Screenshot\n2025-06-19
at 12
47\n52](https://github.com/user-attachments/assets/f82bc2a9-02a8-4a98-94ba-1449e8588d78)|","sha":"e0a4b63a98401971dc512e2ea370388502f12f4a"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Irene Blanco <irene.blanco@elastic.co>
@iblancof iblancof deleted the discover-apm-fix-processed-otel-waterfall-flyout 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:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants