Skip to content

I-ALiRT - Rsync alarm - #921

Merged
laspsandoval merged 13 commits into
IMAP-Science-Operations-Center:devfrom
laspsandoval:rsync_alarm
Oct 24, 2025
Merged

I-ALiRT - Rsync alarm#921
laspsandoval merged 13 commits into
IMAP-Science-Operations-Center:devfrom
laspsandoval:rsync_alarm

Conversation

@laspsandoval

@laspsandoval laspsandoval commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

Change Summary

Overview

The POC would like to know if any of their logs contain an rsync failure. This PR creates a lambda and construct that searches new logs for failtures.

New Files

  • ialirt_rsync_alarm_construct.py
    • Creates sns topics that kicks off the lambda upon arrival of a new log
    • Creates an alarm based on the metric created in the lambda
  • ialirt_rsync_alarm.py
    • Creates the metric based on contents of log file
  • stackbuilder.py
    • Call new construct

Testing

test_ialirt_rsync_alarm.py

Deployed and confirmed functionality

@laspsandoval laspsandoval self-assigned this Oct 7, 2025
@laspsandoval laspsandoval added the enhancement New feature or request label Oct 7, 2025
@laspsandoval laspsandoval added this to the October 2025 milestone Oct 7, 2025

@greglucas greglucas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks very similar to the other alarm/metric we already have, so I'm wondering if we can re-use any of that infrastructure and publish to the same "alarm" topic and just send a different message or something if that is needed.

The other thing I'm a bit unclear about here is why we need the metric/alarm at all. Could you just have the lambda triggered on every log file arrival in s3, that lambda would read the contents of the s3 object like you already have and then send a message to the topic if it found the rsync error. Then you can avoid the polling/cloudwatch alarm metrics stuff I think.

s3-log-arrival -> lambda-to-read-logs -> write-to-topic-if-error

Comment thread sds_data_manager/constructs/ialirt_rsync_alarm_construct.py Outdated
Comment thread sds_data_manager/constructs/ialirt_rsync_alarm_construct.py Outdated
Comment thread sds_data_manager/constructs/ialirt_rsync_alarm_construct.py Outdated
Comment thread sds_data_manager/lambda_code/IAlirtCode/ialirt_rsync_alarm.py Outdated
@laspsandoval

Copy link
Copy Markdown
Contributor Author

This looks very similar to the other alarm/metric we already have, so I'm wondering if we can re-use any of that infrastructure and publish to the same "alarm" topic and just send a different message or something if that is needed.

The other thing I'm a bit unclear about here is why we need the metric/alarm at all. Could you just have the lambda triggered on every log file arrival in s3, that lambda would read the contents of the s3 object like you already have and then send a message to the topic if it found the rsync error. Then you can avoid the polling/cloudwatch alarm metrics stuff I think.

s3-log-arrival -> lambda-to-read-logs -> write-to-topic-if-error

Good ideas. Check it out now.

@greglucas greglucas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice, I like this approach and think it ties your alarming together nicely.

Comment thread sds_data_manager/lambda_code/IAlirtCode/ialirt_rsync_alarm.py
@laspsandoval
laspsandoval merged commit d50e78d into IMAP-Science-Operations-Center:dev Oct 24, 2025
2 checks passed
@laspsandoval
laspsandoval deleted the rsync_alarm branch October 24, 2025 20:10
@laspsandoval laspsandoval linked an issue Oct 31, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

I-ALiRT Rsync Alarm

2 participants