-
Notifications
You must be signed in to change notification settings - Fork 7
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
Log batch job failures to Slack #2561
Conversation
iamleeg
commented
Feb 28, 2022
•
edited
Loading
edited
- script doesn't depend on reaching an event from lambda
- copes with being rate limited by Slack
- Documentation
- Dockerfile
- Deploy to ECR
- Define job in Batch
- Schedule from EventBridge
Handle next token correctly Handle slack rate limiting us
I'm not familiar with boto3 logs module, but will this only return the latest logs? We wouldn't want earlier logs coming in. Also would be good to hook it up to EventBridge event on Batch job failure -- may need some changes to handle the input event which is usually passed as a JSON payload. Can add the batch job as a target for https://console.aws.amazon.com/events/home?region=us-east-1#/eventbus/default/rules/batch-job-failure once it can accept the event payload. |
Do you mean to say that there isn't a separate log stream for each run of a parser? This makes it more difficult, as I need to know what the start and end dates are of the parser run I care about to filter the log stream. Do you know how I can get those?
Ah OK, I was hoping I'd be able to define the environment variables in the event but I'll look into doing that. |
Re-reading that bit, it is fine - as there is a separate log stream with the same prefix for each parser (x-x-ingestor-prod/*), which can be obtained from the event. |
ingestion/monitoring/Dockerfile
Outdated
@@ -0,0 +1,71 @@ | |||
# `python-base` sets up all our shared environment variables | |||
FROM python:3.9-slim as python-base |
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.
3.10?
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.
I had problems installing poetry in the image when I based it on python:3.10-slim so I punted it. I will check again, it may have been a transient issue.
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.
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.
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.
This appears to be the new way of installing poetry https://github.com/python-poetry/install.python-poetry.org -- I'm wary of the direct call to install.python-poetry.org, but should be possible to pin to a git tag
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.
Good catch. We were calling get-poetry from master too so we probably need to change this throughout the repo.