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

Add logging to the cyhy-nvdsync and cyhy-kevsync scripts #67

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

jsf9k
Copy link
Member

@jsf9k jsf9k commented Apr 7, 2022

🗣 Description

This pull request adds standard Python logging to the cyhy-nvdsync and cyhy-kevsync scripts, particularly for uncaught exceptions.

💭 Motivation and context

By logging a message for any uncaught exceptions, we are able to trigger AWS CloudWatch metric alarms via the code in terraform/nvdsync_failure_alarms.tf and terraform/kevsync_failure_alarms.tf of cisagov/cyhy_amis#394 whenever either of these scripts fails.

Contributes to the resolution of cisagov/cyhy-system#37. See also:

🧪 Testing

I ran each scripts locally and verified that the expected log message was emitted upon failure.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.

@jsf9k jsf9k self-assigned this Apr 7, 2022
@jsf9k jsf9k added the improvement This issue or pull request will add new or improve existing functionality label Apr 7, 2022
@jsf9k jsf9k marked this pull request as ready for review April 7, 2022 14:34
@jsf9k jsf9k requested review from dav3r, felddy and mcdonnnj as code owners April 7, 2022 14:34
jsf9k added a commit to cisagov/cyhy_amis that referenced this pull request Apr 7, 2022
…gov/cyhy-core#67

By logging a message for any uncaught exceptions, we are able to
trigger AWS CloudWatch metric alarms via the code in
terraform/nvdsync_failure_alarms.tf and
terraform/kevsync_failure_alarms.tf whenever the cyhy-nvdsync or
cyhy-kevsync scripts fails.
By logging a message for any uncaught exceptions, we are able to
trigger AWS CloudWatch metric alarms via the code in
terraform/nvdsync_failure_alarms.tf and
terraform/kevsync_failure_alarms.tf of cisagov/cyhy_amis.
@jsf9k jsf9k force-pushed the improvement/tweak-error-messages-for-notifications branch from e1bb053 to 4f7e4e6 Compare April 7, 2022 15:06
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

image

jsf9k added a commit to cisagov/cyhy_amis that referenced this pull request Apr 7, 2022
…gov/cyhy-core#67

By logging a message for any uncaught exceptions, we are able to
trigger AWS CloudWatch metric alarms via the code in
terraform/nvdsync_failure_alarms.tf and
terraform/kevsync_failure_alarms.tf whenever the cyhy-nvdsync or
cyhy-kevsync scripts fails.
jsf9k added a commit to cisagov/cyhy_amis that referenced this pull request Apr 7, 2022
…gov/cyhy-core#67

By logging a message for any uncaught exceptions, we are able to
trigger AWS CloudWatch metric alarms via the code in
terraform/nvdsync_failure_alarms.tf and
terraform/kevsync_failure_alarms.tf whenever the cyhy-nvdsync or
cyhy-kevsync scripts fails.
Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

:shipit:

@jsf9k jsf9k merged commit d6926ed into develop Apr 13, 2022
@jsf9k jsf9k deleted the improvement/tweak-error-messages-for-notifications branch April 13, 2022 19:37
@dav3r dav3r mentioned this pull request Apr 18, 2022
10 tasks
jsf9k added a commit to cisagov/cyhy_amis that referenced this pull request Apr 20, 2022
…gov/cyhy-core#67

By logging a message for any uncaught exceptions, we are able to
trigger AWS CloudWatch metric alarms via the code in
terraform/nvdsync_failure_alarms.tf and
terraform/kevsync_failure_alarms.tf whenever the cyhy-nvdsync or
cyhy-kevsync scripts fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement This issue or pull request will add new or improve existing functionality
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants