-
Notifications
You must be signed in to change notification settings - Fork 273
fix(amazonq): Update exception handling for feature dev to improve observability #4953
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
Conversation
...rc/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/CodeGenerationState.kt
Show resolved
Hide resolved
...unity/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/FeatureDevExceptions.kt
Outdated
Show resolved
Hide resolved
...rc/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/session/CodeGenerationState.kt
Show resolved
Hide resolved
512f66e to
05b61d7
Compare
| desc -> String.format("%s: %s", this.operation, desc) | ||
| else -> String.format("%s", this.operation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| desc -> String.format("%s: %s", this.operation, desc) | |
| else -> String.format("%s", this.operation) | |
| desc -> "$description: $desc" | |
| else -> operation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorporated as:
desc -> "$operation | Description: $desc"
else -> operation
| * - Each failure is annotated based on className, operation, and a short desc. Use the `reason()` and `reasonDesc()` members for instrumentation. | ||
| * - To throw an exception without modeling, throw FeatureDevException directly. | ||
| */ | ||
| open class FeatureDevException(override val message: String?, open val operation: String, open val desc: String?, override val cause: Throwable? = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| open class FeatureDevException(override val message: String?, open val operation: String, open val desc: String?, override val cause: Throwable? = null) | |
| open class FeatureDevException(override val message: String?, val operation: String, val desc: String?, override val cause: Throwable? = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for cleaning this up
| ) | ||
| } | ||
| else -> { | ||
| var msg = createUserFacingErrorMessage("$FEATURE_NAME request failed: ${err.message ?: err.cause?.message}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var can be val
05b61d7 to
8bdc09d
Compare
372c006 to
ac495d8
Compare
ac495d8 to
1ec073f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just FYI: feels like metadata.metricName already play the role of operation, so have operation in the description maybe redundant. Sharing some metrics links offline.
Types of changes
Description
Problem: Feature dev instrumentation 1) records all failures as
FeatureDevException, losing information about the specific exception type, and 2) lacks annotation ofreasonDescand the operation related to the error. (By operation, although we do captureamazonq_codeGenerationInvoke, we're missing the subprocess name such asStartCodeGeneration.) As a result, we do not have insight into feature dev failures in JetBrains.Solution: 1) Update exception modeling pattern for feature dev functionality to derive subclasses of
FeatureDevException, providing a meaningful class name when inspected as errorreason. 2) OnFeatureDevException, accept anoperationanddescto provide further annotation (merged when logged asreasonDesc).This change will have conflicts with #4938 and #4949. I'll rebase on top of those and reconcile any drift in a subsequent revision.
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.