Skip to content

Conversation

@knz
Copy link
Contributor

@knz knz commented May 21, 2020

The recent update to the new Sentry SDK has decreased the utility
compared to previously, where it wasn't even great to start with.

This patch fixes it. (screenshots below)

The most salient improvements:

  • The bold Sentry issue title now reports the error location
    (file/line/function) if available, instead of the constant
    string "reported error"

  • The remainder of the Sentry issue title now lists some more
    details about the error type and the first safe detail string
    if available, instead of an empty string.

  • The stack traces are not any more duplicated between Sentry
    "Exception" objects and the "Additional data" payloads.

  • The Message field is now properly populated, like it was prior to
    the SDK upgrade.

The improvement can be observed by comparing the two following screenshots side-by-side.

"Before" screenshot:

screencapture-sentry-io-organizations-cockroach-labs-issues-1681555741-2020-05-22-00_39_38

"After" screenshot:

screencapture-sentry-io-organizations-cockroach-labs-issues-1681553199-2020-05-22-00_38_24


This change is Reviewable

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! I have one question and several nits.

Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @knz and @tbg)


report/report.go, line 135 at r1 (raw file):

	// typesBuf will become the payload for the "error types" Additional
	// data field. It explains the go types of the layers in the error

nit: maybe s/go/Go/g.


report/report.go, line 152 at r1 (raw file):

	var firstDetailLine string

	for i := len(details) - 1; i >= 0; i-- {

Why are we iterating in the reverse order? Maybe if we iterate in the forward order, then we won't need to reverse the exceptions below?


report/report.go, line 155 at r1 (raw file):

		// Collect the type name for this layer of error wrapping, towards
		// the "error types" additional data field.
		fullTypename := details[i].OriginalTypeName

nit: s/Typename/TypeName/g to be inline with OriginalTypeName.


report/report.go, line 159 at r1 (raw file):

		fm := "*"
		if fullTypename != mark.FamilyName {
			// tn can be different from the family when an error type has

nit: s/tn/fullTypename/g.


report/report.go, line 241 at r1 (raw file):

			//
			// Note: we only print the details if no stack trace was found
			// that that level. This is because stack trace annotations also

nit: s/that that/at that/g.


report/report.go, line 294 at r1 (raw file):

	// If there is no exception payload, synthetize one.
	if len(event.Exception) == 0 {
		// We know we don't have a strack trace to extra line/function

nit: s/strack/stack/g

The recent update to the new Sentry SDK has *decreased* the utility
compared to previously, where it wasn't even great to start with.

This patch fixes it.

The most salient improvements:

- The bold Sentry issue title now reports the error location
  (file/line/function) if available, instead of the constant
  string "`reported error`"

- The remainder of the Sentry report title now lists some more
  details about the error type and the first safe detail string
  if available, instead of an empty string.

- The stack traces are not any more duplicated between Sentry
  "Exception" objects and the "Additional data" payloads.

- The Message field is now properly populated, like it was prior to
  the SDK upgrade.
@knz knz force-pushed the 20200522-error-report branch from c799aab to d6e8831 Compare May 23, 2020 15:21
Copy link
Contributor Author

@knz knz left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 2 files reviewed, 1 unresolved discussion (waiting on @tbg and @yuzefovich)


report/report.go, line 135 at r1 (raw file):

Previously, yuzefovich wrote…

nit: maybe s/go/Go/g.

Done.


report/report.go, line 152 at r1 (raw file):

Previously, yuzefovich wrote…

Why are we iterating in the reverse order? Maybe if we iterate in the forward order, then we won't need to reverse the exceptions below?

Clarified in comment: the "long message" wants to describe the error object from innermost to outermost layer of detail.


report/report.go, line 155 at r1 (raw file):

Previously, yuzefovich wrote…

nit: s/Typename/TypeName/g to be inline with OriginalTypeName.

Done.


report/report.go, line 159 at r1 (raw file):

Previously, yuzefovich wrote…

nit: s/tn/fullTypename/g.

Done.


report/report.go, line 241 at r1 (raw file):

Previously, yuzefovich wrote…

nit: s/that that/at that/g.

Done.


report/report.go, line 294 at r1 (raw file):

Previously, yuzefovich wrote…

nit: s/strack/stack/g

Done.

@knz knz merged commit 489491a into cockroachdb:master May 26, 2020
@knz knz deleted the 20200522-error-report branch May 26, 2020 11:14
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.

3 participants