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][Otel] Errors: Add fallback to span id if the parent id is undefined #4

Conversation

jennypavlova
Copy link

Closes elastic#195731

follows elastic#195796

Summary

This PR fixes a bug with error correlations not displayed correctly in the APM waterfall when using Otel native data. In Otel native data parent.id is never defined so in this case we need to fallback to span.id

@@ -129,7 +131,7 @@ export async function getErrorSampleDetails({

const errorFromFields = unflattenKnownApmEventFields(hit.fields, requiredFields);

const transactionId = errorFromFields.transaction?.id;
const transactionId = errorFromFields.transaction?.id ?? errorFromFields.span?.id;
Copy link
Author

Choose a reason for hiding this comment

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

This is needed because the otel errors don't have transaction.id but they have span.id (for APM those 2 are the same based on my testing with the PoC data/otel demo)

@crespocarlos
Copy link
Owner

Thanks!

@crespocarlos crespocarlos merged commit 7def09a into crespocarlos:192606-move-source-to-fields Oct 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants