Daily Upstash Redis spend and usage digest posted to Slack
Every weekday morning, see what your Upstash Redis databases cost yesterday, which ones spiked, and why, without opening a dashboard.
Every weekday at 8am, give me a digest of what my Upstash serverless Redis fleet cost yesterday and how hard it is being used, and post it to Slack.
Start with the Upstash List Redis Databases operation to enumerate every database in the account. Always enumerate rather than working from a fixed list, so databases added since the last run get picked up automatically.
For each database returned, call Get Redis Database Stats. Pull the daily figures: dailybilling for what it cost, dailyrequests and daily_net_commands for command volume, daily_read_requests and daily_write_requests for the read versus write split, and current_storage for how much data it is holding. Also keep the time series arrays that come back, including hits, misses, keyspace and diskusage, because those carry the trailing days you need for the comparison.
Rank the databases by yesterday's dailybilling, highest first, and sum them for a total account spend figure for the day.
Then compare each database against its own trailing days in the returned time series rather than against the rest of the fleet, since a small cache and a busy primary are not comparable. Call out anything that moved materially, for example daily billing or command volume more than 50 percent above that database's own trailing average.
For every anomaly, give a short plain explanation of the likely driver based on what the numbers actually show. A jump in daily_read_requests with flat writes points to a read spike or a runaway loop. A rising misses series against flat or falling hits points to a cache miss regression, where keys are expiring or being evicted and traffic is falling through to the origin. Growth in current_storage or the diskusage series points to storage growth rather than traffic. Say which one it looks like and why, do not just report that a number went up.
Post the result to Slack with the Slack Bot Send a Message operation. Lead with total account spend for the day, then the top three spenders with their daily cost and request volume, then an anomalies section, and close with a right sizing note.
For the right sizing note, flag any pay as you go database that is consistently expensive enough that a fixed plan would be cheaper. Upstash pay as you go bills roughly $0.20 per 100k commands plus storage, and sustained volume above roughly 500k commands per day is the point where a fixed plan usually wins. Treat this as a recommendation only. You can mention that Change Redis Database Plan is the operation that would apply it, but never change a plan automatically.
Keep the whole message short enough to read in the channel without expanding it. A few lines per section, real numbers rather than prose, and skip the anomalies section entirely when nothing crossed the threshold. If a stats call fails for one database, note it in a single line and still report on the rest.
What does this prompt do?
- Adds up what every Redis database in your Upstash account cost yesterday and leads with the account total.
- Ranks your databases by spend so the top three cost drivers are always at the top of the message.
- Compares each database against its own recent days and calls out sharp jumps in cost or traffic, explaining the likely cause in plain language such as a read spike or a drop in cache hits.
- Flags when a usage based database has grown expensive enough that a fixed monthly plan would probably save money, and posts it all as one short Slack message.
What do I need to use this?
- An Upstash account with at least one serverless Redis database.
- A management key from your Upstash account settings, so the workflow can read your databases and their usage.
- A Slack workspace and a channel where the digest should be posted.
- The Slack bot added to that channel.
How can I customize it?
- Change the timing. Every weekday at 8am is the default, but you can run it seven days a week or push it later to line up with your team's standup.
- Change where it lands. Point it at a different channel, or send it as a direct message to whoever owns the infrastructure budget.
- Tune the sensitivity. The 50 percent jump threshold for anomalies and the point at which a fixed plan gets suggested can both be raised or lowered.
FAQs
Can this see the data stored inside my Redis databases?
Will it change my database plan automatically?
What if I only have one database?
Do I need to store any history for the comparisons to work?
Why post it in the morning instead of alerting the moment something spikes?
Related templates
When someone leaves, we check which shared passwords they used in their final months and post a ranked rotation list to your security channel.
Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.
Twice every weekday, the conversations from your social inbox land on the right HubSpot contact timelines, with a Slack recap for sales.
Every morning, find the addresses that hard bounced or filed a spam complaint, update the matching HubSpot contacts, and post a short Slack recap.
Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.
When you merge a fix in GitHub, this agent checks the matching dead-letter queue, replays the failed messages, and reports back on the pull request and in Slack.
Stop finding out about Redis cost spikes on your invoice.
Get a short Slack digest every weekday that ranks your Upstash spend, explains what actually changed, and tells you when a different plan would be cheaper.