Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APM] Missing items in the trace waterfall shouldn't break it entirely #210210

Merged
merged 5 commits into from
Feb 10, 2025

Conversation

cauemarcondes
Copy link
Contributor

@cauemarcondes cauemarcondes commented Feb 7, 2025

closes #120464

When orphan items are found, I am re-parenting them to the root transaction and adding an indication.

Test architecture:
APP_A -> APP_B -> APP_C

APP_B is not instrumented with Elastic APM, so it is not available in the trace, thus APP_C has a parent which is not available in the current trace. APP_C is reparented to point to APP_A.

Before:
Screenshot 2025-02-07 at 12 55 06

After [1]:
Screenshot 2025-02-07 at 12 03 34

After [2]:
Screenshot 2025-02-07 at 11 35 28

How to test it:

  • Run synthtrace distributed_trace.ts scenario.
  • Find a trace.id
  • Remove one of the elements from the trace.

@cauemarcondes cauemarcondes requested a review from a team as a code owner February 7, 2025 16:05
@botelastic botelastic bot added the Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team label Feb 7, 2025
@elasticmachine
Copy link
Contributor

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

@cauemarcondes cauemarcondes added release_note:fix backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) backport:prev-major Backport to (8.x, 8.18, 8.17, 8.16) the previous major branch and other branches in development labels Feb 7, 2025
Copy link
Member

@jennypavlova jennypavlova left a comment

Choose a reason for hiding this comment

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

Nice 💯 works as expected. BTW we have a scenario for this case called trace_with_orphan_items and I can see it there:
image

Edit: More of an idea, no need to do it here: We can also include more orphans in the scenario and have some orphans with children for example and this can help us test this

I added a suggestion ⬇️

@cauemarcondes cauemarcondes enabled auto-merge (squash) February 10, 2025 11:46
@cauemarcondes cauemarcondes merged commit 9bc9643 into elastic:main Feb 10, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.17, 8.18, 8.x, 9.0

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

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #19 / AddObservable opens the modal when clicked
  • [job] [logs] FTR Configs #68 / maps app geo file upload shapefile upload should add as document layer
  • [job] [logs] Jest Tests #12 / Policy form Detect Prevent Protection level component should allow detect mode to be selected

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1700 1701 +1

Async chunks

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

id before after diff
apm 4.0MB 4.0MB +1004.0B

History

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 10, 2025
elastic#210210)

closes elastic#120464

When orphan items are found, I am re-parenting them to the root
transaction and adding an indication.

Test architecture:
APP_A -> APP_B -> APP_C

`APP_B` is not instrumented with Elastic APM, so it is not available in
the trace, thus APP_C has a parent which is not available in the current
trace. `APP_C` is reparented to point to `APP_A`.

Before:
<img width="1509" alt="Screenshot 2025-02-07 at 12 55 06"
src="https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e"
/>

After [1]:
<img width="1499" alt="Screenshot 2025-02-07 at 12 03 34"
src="https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91"
/>

After [2]:
<img width="712" alt="Screenshot 2025-02-07 at 11 35 28"
src="https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b"
/>

## How to test it:
- Run synthtrace `distributed_trace.ts` scenario.
- Find a trace.id
- Remove one of the elements from the trace.

(cherry picked from commit 9bc9643)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 10, 2025
elastic#210210)

closes elastic#120464

When orphan items are found, I am re-parenting them to the root
transaction and adding an indication.

Test architecture:
APP_A -> APP_B -> APP_C

`APP_B` is not instrumented with Elastic APM, so it is not available in
the trace, thus APP_C has a parent which is not available in the current
trace. `APP_C` is reparented to point to `APP_A`.

Before:
<img width="1509" alt="Screenshot 2025-02-07 at 12 55 06"
src="https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e"
/>

After [1]:
<img width="1499" alt="Screenshot 2025-02-07 at 12 03 34"
src="https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91"
/>

After [2]:
<img width="712" alt="Screenshot 2025-02-07 at 11 35 28"
src="https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b"
/>

## How to test it:
- Run synthtrace `distributed_trace.ts` scenario.
- Find a trace.id
- Remove one of the elements from the trace.

(cherry picked from commit 9bc9643)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 10, 2025
elastic#210210)

closes elastic#120464

When orphan items are found, I am re-parenting them to the root
transaction and adding an indication.

Test architecture:
APP_A -> APP_B -> APP_C

`APP_B` is not instrumented with Elastic APM, so it is not available in
the trace, thus APP_C has a parent which is not available in the current
trace. `APP_C` is reparented to point to `APP_A`.

Before:
<img width="1509" alt="Screenshot 2025-02-07 at 12 55 06"
src="https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e"
/>

After [1]:
<img width="1499" alt="Screenshot 2025-02-07 at 12 03 34"
src="https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91"
/>

After [2]:
<img width="712" alt="Screenshot 2025-02-07 at 11 35 28"
src="https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b"
/>

## How to test it:
- Run synthtrace `distributed_trace.ts` scenario.
- Find a trace.id
- Remove one of the elements from the trace.

(cherry picked from commit 9bc9643)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.16 Backport failed because of merge conflicts
8.17 Backport failed because of merge conflicts
8.18
8.x
9.0

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 210210

Questions ?

Please refer to the Backport tool documentation

@cauemarcondes
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.16

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

Questions ?

Please refer to the Backport tool documentation

cauemarcondes added a commit to cauemarcondes/kibana that referenced this pull request Feb 10, 2025
elastic#210210)

closes elastic#120464

When orphan items are found, I am re-parenting them to the root
transaction and adding an indication.

Test architecture:
APP_A -> APP_B -> APP_C

`APP_B` is not instrumented with Elastic APM, so it is not available in
the trace, thus APP_C has a parent which is not available in the current
trace. `APP_C` is reparented to point to `APP_A`.

Before:
<img width="1509" alt="Screenshot 2025-02-07 at 12 55 06"
src="https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e"
/>

After [1]:
<img width="1499" alt="Screenshot 2025-02-07 at 12 03 34"
src="https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91"
/>

After [2]:
<img width="712" alt="Screenshot 2025-02-07 at 11 35 28"
src="https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b"
/>

## How to test it:
- Run synthtrace `distributed_trace.ts` scenario.
- Find a trace.id
- Remove one of the elements from the trace.

(cherry picked from commit 9bc9643)

# Conflicts:
#	x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/orphan_item_tooltip_icon.tsx
#	x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_helpers/waterfall_helpers.test.ts
@cauemarcondes
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.17

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

Questions ?

Please refer to the Backport tool documentation

cauemarcondes added a commit to cauemarcondes/kibana that referenced this pull request Feb 10, 2025
elastic#210210)

closes elastic#120464

When orphan items are found, I am re-parenting them to the root
transaction and adding an indication.

Test architecture:
APP_A -> APP_B -> APP_C

`APP_B` is not instrumented with Elastic APM, so it is not available in
the trace, thus APP_C has a parent which is not available in the current
trace. `APP_C` is reparented to point to `APP_A`.

Before:
<img width="1509" alt="Screenshot 2025-02-07 at 12 55 06"
src="https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e"
/>

After [1]:
<img width="1499" alt="Screenshot 2025-02-07 at 12 03 34"
src="https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91"
/>

After [2]:
<img width="712" alt="Screenshot 2025-02-07 at 11 35 28"
src="https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b"
/>

## How to test it:
- Run synthtrace `distributed_trace.ts` scenario.
- Find a trace.id
- Remove one of the elements from the trace.

(cherry picked from commit 9bc9643)

# Conflicts:
#	x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/orphan_item_tooltip_icon.tsx
#	x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_helpers/waterfall_helpers.test.ts
@cauemarcondes cauemarcondes deleted the caue-2 branch February 10, 2025 14:20
kibanamachine added a commit that referenced this pull request Feb 10, 2025
…k it entirely (#210210) (#210390)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[APM] Missing items in the trace waterfall shouldn&#x27;t break it
entirely (#210210)](#210210)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Cauê
Marcondes","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-10T14:04:33Z","message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:prev-minor","backport:prev-major","Team:obs-ux-infra_services","v9.1.0"],"title":"[APM]
Missing items in the trace waterfall shouldn't break it
entirely","number":210210,"url":"https://github.com/elastic/kibana/pull/210210","mergeCommit":{"message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210210","number":210210,"mergeCommit":{"message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7"}}]}]
BACKPORT-->

Co-authored-by: Cauê Marcondes <[email protected]>
cauemarcondes added a commit that referenced this pull request Feb 10, 2025
…entirely (#210210) (#210395)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[APM] Missing items in the trace waterfall shouldn&#x27;t break it
entirely (#210210)](#210210)

<!--- Backport version: 9.6.4 -->

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

<!--BACKPORT [{"author":{"name":"Cauê
Marcondes","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-10T14:04:33Z","message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:prev-minor","backport:prev-major","Team:obs-ux-infra_services","v9.1.0"],"title":"[APM]
Missing items in the trace waterfall shouldn't break it
entirely","number":210210,"url":"https://github.com/elastic/kibana/pull/210210","mergeCommit":{"message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210210","number":210210,"mergeCommit":{"message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7"}},{"url":"https://github.com/elastic/kibana/pull/210390","number":210390,"branch":"8.18","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/210391","number":210391,"branch":"8.x","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/210393","number":210393,"branch":"9.0","state":"OPEN"}]}]
BACKPORT-->
kibanamachine added a commit that referenced this pull request Feb 10, 2025
… it entirely (#210210) (#210393)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[APM] Missing items in the trace waterfall shouldn&#x27;t break it
entirely (#210210)](#210210)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Cauê
Marcondes","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-10T14:04:33Z","message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:prev-minor","backport:prev-major","Team:obs-ux-infra_services","v9.1.0"],"title":"[APM]
Missing items in the trace waterfall shouldn't break it
entirely","number":210210,"url":"https://github.com/elastic/kibana/pull/210210","mergeCommit":{"message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210210","number":210210,"mergeCommit":{"message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7"}}]}]
BACKPORT-->

Co-authored-by: Cauê Marcondes <[email protected]>
cauemarcondes added a commit that referenced this pull request Feb 10, 2025
…entirely (#210210) (#210397)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[APM] Missing items in the trace waterfall shouldn&#x27;t break it
entirely (#210210)](#210210)

<!--- Backport version: 9.6.4 -->

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

<!--BACKPORT [{"author":{"name":"Cauê
Marcondes","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-10T14:04:33Z","message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:prev-minor","backport:prev-major","Team:obs-ux-infra_services","v9.1.0"],"title":"[APM]
Missing items in the trace waterfall shouldn't break it
entirely","number":210210,"url":"https://github.com/elastic/kibana/pull/210210","mergeCommit":{"message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210210","number":210210,"mergeCommit":{"message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7"}},{"url":"https://github.com/elastic/kibana/pull/210390","number":210390,"branch":"8.18","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/210391","number":210391,"branch":"8.x","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/210393","number":210393,"branch":"9.0","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/210395","number":210395,"branch":"8.16","state":"OPEN"}]}]
BACKPORT-->
kibanamachine added a commit that referenced this pull request Feb 10, 2025
… it entirely (#210210) (#210391)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[APM] Missing items in the trace waterfall shouldn&#x27;t break it
entirely (#210210)](#210210)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Cauê
Marcondes","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-10T14:04:33Z","message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:prev-minor","backport:prev-major","Team:obs-ux-infra_services","v9.1.0"],"title":"[APM]
Missing items in the trace waterfall shouldn't break it
entirely","number":210210,"url":"https://github.com/elastic/kibana/pull/210210","mergeCommit":{"message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210210","number":210210,"mergeCommit":{"message":"[APM]
Missing items in the trace waterfall shouldn't break it entirely
(#210210)\n\ncloses
https://github.com/elastic/kibana/issues/120464\r\n\r\nWhen orphan items
are found, I am re-parenting them to the root\r\ntransaction and adding
an indication.\r\n\r\nTest architecture:\r\nAPP_A -> APP_B ->
APP_C\r\n\r\n`APP_B` is not instrumented with Elastic APM, so it is not
available in\r\nthe trace, thus APP_C has a parent which is not
available in the current\r\ntrace. `APP_C` is reparented to point to
`APP_A`.\r\n\r\nBefore:\r\n<img width=\"1509\" alt=\"Screenshot
2025-02-07 at 12 55
06\"\r\nsrc=\"https://github.com/user-attachments/assets/a973fa5d-1acf-4fff-b525-01957490494e\"\r\n/>\r\n\r\n\r\nAfter
[1]:\r\n<img width=\"1499\" alt=\"Screenshot 2025-02-07 at 12 03
34\"\r\nsrc=\"https://github.com/user-attachments/assets/8c49df04-de09-4d17-b6f8-f4b848e89f91\"\r\n/>\r\n\r\nAfter
[2]:\r\n<img width=\"712\" alt=\"Screenshot 2025-02-07 at 11 35
28\"\r\nsrc=\"https://github.com/user-attachments/assets/2b62a7cf-5979-4636-bc05-c25c96e9d71b\"\r\n/>\r\n\r\n##
How to test it:\r\n- Run synthtrace `distributed_trace.ts`
scenario.\r\n- Find a trace.id\r\n- Remove one of the elements from the
trace.","sha":"9bc9643e80d8b0dc7e2a81bf79c450446c16fcb7"}}]}]
BACKPORT-->

Co-authored-by: Cauê Marcondes <[email protected]>
@mistic
Copy link
Member

mistic commented Feb 11, 2025

This PR didn't make it into the latest BC for v8.16.4 and v8.17.2. Updating the labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-major Backport to (8.x, 8.18, 8.17, 8.16) the previous major branch and other branches in development backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) release_note:fix Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.16.5 v8.17.3 v8.18.0 v8.19.0 v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM] Missing items in the trace waterfall shouldn't break it entirely
5 participants