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

Add additional transaction labels with error details to requests. #3124

Merged
merged 4 commits into from
Nov 28, 2023

Conversation

michel-laterman
Copy link
Contributor

@michel-laterman michel-laterman commented Nov 27, 2023

What is the problem this PR solves?

It's difficult to determine if a fleet-server error is caused by a downstream elasticsearch error, or it indicates an actual issue (fleet-server misconfiguration etc.)

How does this PR solve the problem?

Add transaction labels with more error details when a request would send an APM error.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool

Related issues

@michel-laterman michel-laterman added enhancement New feature or request Team:Fleet Label for the Fleet team labels Nov 27, 2023
@michel-laterman michel-laterman marked this pull request as ready for review November 28, 2023 00:39
@michel-laterman michel-laterman requested a review from a team as a code owner November 28, 2023 00:39
Comment on lines +533 to +538
trans.Context.SetLabel("error.type", "ErrElastic")
trans.Context.SetLabel("error.details.status", esErr.Status)
trans.Context.SetLabel("error.details.type", esErr.Type)
trans.Context.SetLabel("error.details.reason", esErr.Reason)
trans.Context.SetLabel("error.details.cause.type", esErr.Cause.Type)
trans.Context.SetLabel("error.details.cause.reason", esErr.Cause.Reason)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@joshdover is this closer to what you had in mind (in the issue description)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes this makes sense to me. One thing I can't tell from just reading this is if any of these fields contain anything instance-specific content that will create noise and make it harder to group related errors, such as specific disk usage stats, node names, etc. This would probably be tricky to normalize though at this point and I think we can do this at query time later if it's an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, we'll merge as is for now and we can revist/clean up the labels in the future

Comment on lines +533 to +538
trans.Context.SetLabel("error.type", "ErrElastic")
trans.Context.SetLabel("error.details.status", esErr.Status)
trans.Context.SetLabel("error.details.type", esErr.Type)
trans.Context.SetLabel("error.details.reason", esErr.Reason)
trans.Context.SetLabel("error.details.cause.type", esErr.Cause.Type)
trans.Context.SetLabel("error.details.cause.reason", esErr.Cause.Reason)
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes this makes sense to me. One thing I can't tell from just reading this is if any of these fields contain anything instance-specific content that will create noise and make it harder to group related errors, such as specific disk usage stats, node names, etc. This would probably be tricky to normalize though at this point and I think we can do this at query time later if it's an issue.

@michel-laterman michel-laterman enabled auto-merge (squash) November 28, 2023 19:39
Copy link

@michel-laterman michel-laterman merged commit b8005f9 into elastic:main Nov 28, 2023
9 checks passed
@michel-laterman michel-laterman deleted the error-details branch November 28, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Team:Fleet Label for the Fleet team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enrich traces and request logs with Elasticsearch error details
2 participants