Monthly MongoDB Atlas cluster cost review posted to Slack

By General Input

On the first business day of each month, see exactly which database clusters drove your bill, what changed, and where you can safely cut spend.

Integrations

  • MongoDB Atlas
  • Google Sheets
  • Slack Bot

Type

Agentic Task

Categories

  • Engineering
  • Finance

On the first business day of every month at 8am, review our MongoDB Atlas spend and post a written cost review to Slack. Use a cron trigger. Because cron cannot express "first business day" on its own, schedule it for the 1st, 2nd, and 3rd of each month at 8am and stop immediately unless today is actually the first business day of that month, skipping weekends.

Start with MongoDB Atlas List Organization Invoices for my organization to find the invoice covering the month that just ended and the invoice for the month before it. Then call Get Organization Invoice for each of those two invoice ids to pull the full line items. Atlas returns every invoice amount in cents (USD), so divide by 100 and format as dollars before reporting any number.

Break the line items down two ways: by cluster, using the clusterName field on each line item, and by SKU, so I can see which clusters drive spend and what kind of charge each one is (instance hours, backup, data transfer, and so on). Any line item with no cluster name goes into an "organization level / unattributed" bucket rather than being dropped.

Cross-reference every cost line against the real cluster. Call List Projects in Organization to get the project ids, then for each project call List Clusters and List Flex Clusters. Match on cluster name and label each cost line with that cluster's actual tier or instance size, cloud provider, region, and current state. Call out clusters that are paused but still costing money, clusters that look idle, and clusters that look oversized relative to what they cost.

Compare each cluster's cost this month against last month and flag any cluster that grew more than 20 percent, showing both dollar amounts alongside the percentage so the size of the jump is obvious.

Append one row per cluster per month to the tracking tab of my Google Sheets spend history spreadsheet using Append Values. Each row should carry: month, project name, cluster name, tier or instance size, cloud provider, region, cluster state, total cost in dollars, prior month cost in dollars, percent change, and the largest SKU for that cluster. Before appending, read the tab with Get Values and skip any month and cluster combination that is already recorded, so a re-run never creates duplicate rows.

Finally, post the review to our #eng-costs channel using Slack Bot Send a Message. Use the slackbot integration rather than the user-level Slack one. Cover total spend for the month in dollars, the month-over-month change in dollars and percent, the top three cost drivers with what each one costs, every cluster flagged for growing more than 20 percent, and concrete right-sizing recommendations such as which tier to drop to, which paused or idle cluster to remove, and where backup retention could be reduced. Write it as prose a non-engineer can follow, not a raw data dump, and keep it short enough to read comfortably in the channel.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerA brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensStop cold emails to anyone with a live deal in PipedriveLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasoniMessage campaign console with pre-flight checks and delivery board