For any SaaS business, growth isn't just a goal; it's a science. The health and trajectory of your company are measured by a handful of critical Key Performance Indicators (KPIs). Monthly Recurring Revenue (MRR), Churn Rate, and Customer Lifetime Value (LTV) aren't just numbers on a dashboard—they are the vital signs of your business.
But tracking them is often a painful, manual process. You pull data from Stripe, query your production database, stitch it together in a spreadsheet, and present a static snapshot that's already stale by the time your team sees it. This reactive approach leaves you constantly playing catch-up.
What if you could treat your metrics like you treat your application code? What if your KPIs were dynamic, automated services that didn't just report the past, but actively drove future results? This is the promise of "Metrics as Code," and it's how you can transform your SaaS growth strategy from reactive to proactive.
Traditional business intelligence (BI) dashboards were a step up from spreadsheets, but they come with their own set of limitations in a fast-paced SaaS environment:
At KPIs.do, we believe your most important business metrics deserve the same rigor and automation as your core product. Our platform is built on the principle of Metrics as Code, an agentic workflow approach to performance management.
Instead of building a dashboard, you define your KPI's logic, data sources, and targets through a simple API. Our autonomous agents then take over the entire lifecycle:
This turns your static metrics into dynamic, reliable, and actionable services.
Let's walk through how you would automate the three most critical SaaS metrics using the KPIs.do platform.
MRR is the predictable revenue you can expect to receive every month. It's the foundation of your financial model.
With KPIs.do, you define your MRR metric as
a service. You tell our agent where your subscription data lives (e.g., Stripe) and how to calculate it.
A conceptual definition might look like this:
kpi: monthly-recurring-revenue
description: "Total normalized monthly revenue from all active subscriptions."
owner: finance-team
dataSources:
- name: stripeSubscriptions
type: api
connector: stripe # Use a pre-built connector
resource: subscriptions
params: { status: "active", limit: 100 }
logic:
type: sum # The agent will sum a specific field
field: "plan.amount_decimal"
frequency: "0 * * * *" # Run every hour
thresholds:
- when: "value < 95000 and trend == 'decreasing'"
status: at-risk
notify:
- channel: slack
to: "#finance-alerts"
message: "🚨 MRR is at-risk! Current value: {{value}}, trending down."
Once defined, the MRR agent works tirelessly in the background. You can query its status anytime with a simple API call.
import { KPIs } from '@do/sdk';
// Get the current status of the MRR KPI
const mrr = await KPIs.get('monthly-recurring-revenue');
console.log({
name: mrr.name,
value: mrr.currentValue, // e.g., 98500.00
status: mrr.status, // e.g., 'at-risk'
trend: mrr.trend, // e.g., 'decreasing'
});
Churn is the silent killer of SaaS companies. Automating its tracking is non-negotiable for sustainable growth.
The Churn Rate agent can be configured to use the same data source as MRR but with different logic. It needs to count customers who cancelled their subscriptions within a given period.
kpi: monthly-customer-churn
description: "Percentage of customers who cancelled in the last 30 days."
owner: product-team
dataSources:
- name: stripeEvents
type: api
connector: stripe
resource: events
params: { type: "customer.subscription.deleted" }
logic:
# Custom logic to calculate percentage against total customer base
type: custom
script: "./scripts/calculate_churn.js"
frequency: "0 0 * * *" # Run daily at midnight
thresholds:
- when: "value > 4.5"
status: off-track
# Trigger a webhook to start a customer feedback workflow
notify:
- channel: webhook
url: "https://api.myapp.com/v1/workflows/start-churn-feedback"
Now, instead of discovering a churn problem at the end of the month, you are notified the moment it crosses a critical threshold, enabling you to take immediate corrective action.
LTV represents the total revenue you can expect from a single customer. It's a powerful metric for making decisions about sales, marketing, and customer acquisition costs (CAC).
The beauty of an agentic platform is creating composite KPIs. The LTV metric doesn't need its own data source; it can be defined programmatically using the real-time values of your other KPIs.
kpi: customer-lifetime-value
description: "Calculates LTV based on real-time ARPA and Churn metrics."
owner: marketing-team
dataSources:
# This KPI's data sources are other KPIs
- name: arpa
type: kpi
id: average-revenue-per-account
- name: churn
type: kpi
id: monthly-customer-churn
logic:
# The agent's logic is a simple formula using the values from other agents
type: formula
expression: "kpi.arpa.value / (kpi.churn.value / 100)"
frequency: "on_dependency_update" # Recalculate whenever ARPA or Churn changes
Your LTV metric is now a living, breathing number that automatically updates as your revenue and churn rates fluctuate, giving you the most accurate possible insight for strategic decisions.
By defining your SaaS growth metrics as code, you move beyond passive reporting. You create an intelligent, automated system that not only tells you where you are but helps you get where you need to go. When your churn-rate KPI becomes 'at-risk', you can automatically trigger a workflow that identifies at-risk users in your CRM and enrolls them in a customer-saving campaign.
Stop wrestling with brittle dashboards and stale data. It's time to put your metrics to work.
Ready to turn your key metrics into actionable services? Explore the KPIs.do API and start automating your performance tracking today.