Include user context in a newly built Error#1644
Open
aleksandrs-ledovskis wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this pull request do?
Captured errors now inherit the
ElasticAPM::Context::Userof the active transaction.ErrorBuilder#add_current_transaction_fieldsalready copies the transaction's labels and custom context onto each error, but silently omitted user - so errors reported during an authenticated request arrived with no user, even though the transaction (set viaElasticAPM.set_user) had one.An explicitly-set error user takes precedence; otherwise the transaction's user is inherited. This aligns the Ruby agent with the Node.js' (1, 2), and Python's (1, 2) Elastic APM agents - all attaching the transaction's user to captured errors.
Why is it important?
Lacking a user's information the error metadata is less valuable. Cross-referencing with a specific set of circumstances is harder and more time consuming.
Checklist
.rubocop.yml)Related issues