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

errors inbox fingerprinting #1858

Merged
merged 14 commits into from
Mar 13, 2023
Merged

Conversation

fallwith
Copy link
Contributor

@fallwith fallwith commented Mar 7, 2023

Allow the customer to register a proc to be invoked on each noticed error in order to associate each noticed error with an error group

Changes made:

  • A new public set_error_group_callback API method exists. It must be given a Ruby proc or lambda (must be of type Proc)
  • When a noticed error is created by the error collector, it will invoke the callback with a hash of information about the error, and apply the resulting error group string (if returned) as the error group.
  • Any noticed error with an error group property set will have that error group name present in its agent attributes with the key error.group.name.
  • Internal errors (of which we only have a single stats hash related type currently) will now be routed through the error collector's method for creating a noticed error, thus ensuring the error group callback is invoked for the error.

resolves #1845

fallwith added 2 commits March 6, 2023 16:58
Allow the customer to register a proc to be invoked on each noticed
error in order to associate each noticed error with an error group
remove comment placeholder (since satisfied)
lib/new_relic/agent.rb Show resolved Hide resolved
lib/new_relic/agent.rb Show resolved Hide resolved
lib/new_relic/agent.rb Outdated Show resolved Hide resolved
lib/new_relic/noticed_error.rb Outdated Show resolved Hide resolved
fallwith added 10 commits March 7, 2023 14:19
- in the (potentially customer facing) log message, give the class and
  method name for the public API method producing the message
- typo fix ("GRUP" -> "GROUP") in a constant name
- added tests
- added getter for the error group callback
- fix pre-existing bug with request.uri applying
- make sure internal errors are routed through the error group callback
- revert fix for request.uri setting (to be addressed with a separate
  PR)
- update comment for request.uri setting to have it apply also to error
  group setting
- restore logic to use the caller location as a backtrace (calling
  `#backtrace` on a noticed error will always return either a trace or a
  string, but never `nil`).
also include the error group in the agent attributes hash when it is
available
add supportability reporting for `set_error_group_callback`
CHANGELOG entries for error fingerprinting and user tracking
@fallwith fallwith changed the base branch from dev to error_fingerprinting_user_tracking March 10, 2023 23:13
@fallwith fallwith marked this pull request as ready for review March 10, 2023 23:13
@kaylareopelle
Copy link
Contributor

The logic to update the transaction's agent attributes with the noticed error's request.uri was modified to also update those attributes with the error.group.name value.

@fallwith - Is this still part of the PR?

Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

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

I haven't had a chance to think through the tests yet, but will get back to those on Monday!

CHANGELOG.md Show resolved Hide resolved
lib/new_relic/agent/error_collector.rb Show resolved Hide resolved
lib/new_relic/agent/error_trace_aggregator.rb Show resolved Hide resolved
lib/new_relic/supportability_helper.rb Outdated Show resolved Hide resolved
@fallwith
Copy link
Contributor Author

The logic to update the transaction's agent attributes with the noticed error's request.uri was modified to also update those attributes with the error.group.name value.

@fallwith - Is this still part of the PR?

Good call. We landed on a decision around that bit of code in separate PR #1871. Removed the entry from this PR's description, thank you.

@github-actions
Copy link
Contributor

SimpleCov Report

Coverage Threshold
Line 93.99% 93%
Branch 85.5% 84%

@fallwith fallwith requested a review from kaylareopelle March 13, 2023 17:26
@fallwith fallwith merged commit 314966d into error_fingerprinting_user_tracking Mar 13, 2023
@fallwith fallwith deleted the yojimbo branch March 13, 2023 18:20
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.

Create a new set_error_group_callback public API and set a new error_group agent attribute
2 participants