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

fix(gumby): modify metric to track errors #677

Closed
wants to merge 2 commits into from
Closed

fix(gumby): modify metric to track errors #677

wants to merge 2 commits into from

Conversation

dhasani23
Copy link
Contributor

Problem

We run a mvn and javap shell command and want to track the error message that results when these commands fail.

Solution

Add a field to the relevant metrics to keep track of the error message.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dhasani23 dhasani23 requested a review from a team as a code owner January 23, 2024 21:30
@@ -3538,8 +3538,10 @@
"type": "codeTransformSessionId",
"required": true
},
{ "type": "result", "required": true },
{ "type": "reason", "required": true }
Copy link
Contributor Author

@dhasani23 dhasani23 Jan 23, 2024

Choose a reason for hiding this comment

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

We do emit result and reason for this metric, and I have no plan to change this, but I removed these here because I noticed that they are missing in many other metrics, so I want to be consistent. Let me know if this is not best practice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

EDIT: Added them back.

Copy link
Contributor

Choose a reason for hiding this comment

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

Moving forward we will want to have reason/result in all of our metrics, but since we are already working on revamping the metric schema and the majority of these metrics will be replaced, I think it's fine to not back-fill the fields at the moment.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not just relate to this case
if any field is required true, that means it needs to be populated. if you are concerned about consistency, required:true is nice way to force it.

"type": "reason",
"required": false
"type": "codeTransformRuntimeError",
"required": true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Required here because when mvn command fails we should always have an error message to emit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same as my other comment above

Copy link
Contributor

Choose a reason for hiding this comment

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

If IntelliJ uses the codeTransformRuntimeError field already then we should use this field. If not, we should move the error into the reason field if possible.

Copy link
Contributor

Choose a reason for hiding this comment

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

What kind of error message is expected here? Do you have any sample format.
Telemetry metrics are for overall analysis and we don't want to have long texts. maybe a gist in reason is good practice.

if you need long error messages, we can dump it to cloudwatch logs

{ "type": "reason", "required": true }
{
"type": "codeTransformRuntimeError",
"required": false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not required here because we use this codeTransform_isDoubleClickedToTriggerInvalidProject in many spots, in some of which it is not necessary to include any type of error message.

Copy link
Contributor Author

@dhasani23 dhasani23 Jan 23, 2024

Choose a reason for hiding this comment

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

Note that codeTransformRuntimeError is an existing field we have (already defined as a string)

Copy link
Contributor

Choose a reason for hiding this comment

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

The reason field should be sufficient to tell you why it failed. Is there a reason you specifically need this field? Can the value that would go in to this field be put in to reason instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

If IntelliJ uses the codeTransformRuntimeError field already then we should use this field. If not, we should move the error into the reason field if possible.

@@ -3890,8 +3892,8 @@
"required": true
},
{
"type": "reason",
"required": false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See first comment at very top.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are trying to keep result and reason as part of our new standard. What is the goal here from removing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added them back.

@tincheng
Copy link
Contributor

tincheng commented Jan 23, 2024

Just discussed with AWS Toolkit team on metric improvement, and moving forward we want to avoid using code transform specific fields, but since codeTransfromRuntimeError is an existing field, to align with other current error metrics, we can keep using that fields. Discussed offline and we will add result/reason fields back.

@dhasani23
Copy link
Contributor Author

Looks like we should be logging to CW Logs for longer error messages, so will close this PR

@dhasani23 dhasani23 closed this Jan 23, 2024
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.

6 participants