codeforpdx / opentransit-metrics

Prototype of public transit data visualization system
https://opentransit-pdx.herokuapp.com/
MIT License
7 stars 8 forks source link

Add slack notification to S3 check GitHub Action #33

Closed sidetrackedmind closed 2 years ago

sidetrackedmind commented 2 years ago

Background

There's a GitHub action running every 8 hours to check on the opentransit-collector process. The opentransit-collector collects data from the TriMet API every 15 seconds and puts it in s3 (opentransit-pdx bucket). The collection is happening on a local raspberry pi so it doesn't have any cloud reporting or notification mechanisms. We wanted to create a process to get notifications when the opentransit-collector was failing.

The (temporary) solution

See - https://github.com/codeforpdx/opentransit-metrics/blob/master/.github/workflows/check_s3.yml. We created a GitHub action to look at the last modified time of objects in the opentransit-pdx bucket. If the last modified object time is greater than 5 minutes the GitHub action will fail. This is great but we would like to get notified.

Issue

We would like to add a slack notification to our opentransit-pdx channel when the collector is failing. This should be possible given existing GitHub action connection but someone will have to figure out the permissions and setup.