Quick Overview
This workflow runs daily to pull cloud spend from a billing API, compare it to a Google Sheets rolling baseline, and alert on cost spikes by creating a Jira incident, posting to Slack, emailing Finance via Gmail, and logging the run back to Google Sheets.
How it works
- Runs every day at 08:00 on a schedule.
- Fetches the latest daily cloud cost from a cloud billing API and loads historical daily costs from a Google Sheets “Baseline” sheet.
- Calculates a trailing-average baseline, computes the percentage change for today, and marks the result as valid only when enough non-zero history exists.
- Stops processing when the data is invalid or the increase is below the configured spike threshold.
- Classifies the spike severity (Watch/High/Critical) based on the percentage increase.
- Creates a Jira issue with the spike details, then posts an alert to a Slack channel and emails a text summary to Finance via Gmail.
- Appends the run details (date, service, severity, costs, and percent change) to the Google Sheets baseline sheet for future comparisons.
Setup
- Add an HTTP Header Auth credential for your cloud billing API and replace the example Authorization header value in the HTTP request.
- Connect Google Sheets OAuth credentials and set the Google Sheet document ID and ensure a “Baseline” sheet exists with a historical daily cost column (and is used for logging).
- Review and adjust the spike threshold (currently 25%) and the minimum baseline requirements (at least 3 non-zero rows) in the code step.
- Connect Jira credentials and set your Jira project ID and issue type ID for incident creation.
- Connect Slack credentials and set the target channel ID, then connect Gmail credentials and update the Finance recipient email address.
- Adjust the schedule time (currently 08:00) to match when your daily billing data is available.