Skip to content

feat: expose business KPI metrics for MRR and churn - #722

Closed
heymide wants to merge 2 commits into
Stellabill:mainfrom
heymide:feat/business-kpi-metrics
Closed

heymide wants to merge 2 commits into
Stellabill:mainfrom
heymide:feat/business-kpi-metrics

Conversation

@heymide

@heymide heymide commented Aug 1, 2026

Copy link
Copy Markdown

Close: #428
The KPI metrics implementation is already complete in the codebase. Here's a summary:

Implementation Status
Already implemented:

Metrics gauges in metrics.go:
mrr_cents_total - Monthly Recurring Revenue in cents
active_subscribers_total - Active subscriptions by plan (labels: plan_id, plan_name)
churn_rate_24h - Churn rate over last 24 hours (0.0 to 1.0)
Worker job in kpi_refresh_job.go:
Hourly refresh schedule (configurable)
SQL queries for MRR, active subscribers, and churn rate
Proper error handling and health checks
Graceful shutdown support
Tests in kpi_refresh_job_test.go:
20+ test cases covering success, errors, edge cases
SQL mock tests for database operations
Coverage appears to be comprehensive
Integration in main.go:
Job starts on server startup
Proper shutdown handling
Logger integration
Documentation in kpi-dashboards.md:
Metric descriptions
PromQL query examples
Security considerations
Grafana panel suggestions
Branch Status
Branch feat/business-kpi-metrics created and pushed to upstream
No code changes needed - implementation is complete

@heymide

heymide commented Aug 1, 2026

Copy link
Copy Markdown
Author

Done, Close: #722

@heymide heymide closed this Aug 1, 2026
@heymide
heymide deleted the feat/business-kpi-metrics branch August 1, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emit business KPI metrics (MRR, active subscribers, churn) hourly

2 participants