[APM] Fix missing exception stack trace (#208577)

Closes #203359

## Summary

Fix the incorrect condition that prevents an exception stack trace from
being displayed.

| before | after |
|-|-|
| <img width="2560" alt="Screenshot 2025-01-31 at 10 06 00"
src="https://github.com/user-attachments/assets/88656d5e-0964-4686-8a03-a07ab8459709"
/> | <img width="2560" alt="Screenshot 2025-01-31 at 10 06 38"
src="https://github.com/user-attachments/assets/037cbb98-d7cf-4388-8d94-80c32eb5b17f"
/> |

## AC:

- [x] Exception stack trace is displayed in APM,
- [x] Tested with native Otel collector,
- [x] ~~Wait until data ingestion is fixed and changes can be tested
with v8.16 and higher~~ (not applicable anymore).
This commit is contained in:
Milosz Marcinkowski 2025-02-04 11:19:07 +01:00 committed by GitHub
parent 2092c3d4ca
commit 2fd10dbabe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 5 deletions

View file

@ -176,7 +176,7 @@ export async function getErrorGroupMainStatistics({
error: {
...(event.error ?? {}),
exception:
(errorSource?.error.exception?.length ?? 0) > 1
(errorSource?.error.exception?.length ?? 0) > 0
? errorSource?.error.exception
: event?.error.exception && [event.error.exception],
},

View file

@ -159,7 +159,7 @@ export async function getErrorSampleDetails({
error: {
...errorFromFields.error,
exception:
(source?.error.exception?.length ?? 0) > 1
(source?.error.exception?.length ?? 0) > 0
? source?.error.exception
: errorFromFields?.error.exception && [errorFromFields.error.exception],
log: source?.error?.log,

View file

@ -142,7 +142,7 @@ export async function getMobileCrashGroupMainStatistics({
error: {
...(event.error ?? {}),
exception:
(errorSource?.error.exception?.length ?? 0) > 1
(errorSource?.error.exception?.length ?? 0) > 0
? errorSource?.error.exception
: event?.error.exception && [event.error.exception],
},

View file

@ -143,7 +143,7 @@ export async function getMobileErrorGroupMainStatistics({
error: {
...(event.error ?? {}),
exception:
(errorSource?.error.exception?.length ?? 0) > 1
(errorSource?.error.exception?.length ?? 0) > 0
? errorSource?.error.exception
: event?.error.exception && [event.error.exception],
},

View file

@ -166,7 +166,7 @@ export async function getTraceItems({
error: {
...(event.error ?? {}),
exception:
(errorSource?.error.exception?.length ?? 0) > 1
(errorSource?.error.exception?.length ?? 0) > 0
? errorSource?.error.exception
: event?.error.exception && [event.error.exception],
log: errorSource?.error.log,