Metrics and Analytics
This guide explains how to monitor and analyze your app updates using Source Push metrics and analytics.
Overview
Source Push provides comprehensive metrics to help you:
- Track update deployment success rates
- Monitor download and installation performance
- Analyze user adoption patterns
- Identify potential issues early
Available Metrics
Deployment Metrics
-
Update Status
- Download success rate
- Installation success rate
- Rollback frequency
- Error rates
-
Performance Metrics
- Download time
- Installation time
- Network bandwidth usage
- Storage impact
-
User Metrics
- Active users
- Update adoption rate
- Version distribution
- Geographic distribution
Accessing Metrics
Console Dashboard
Access metrics through the Source Push Console:
- Navigate to your app in the console
- Select "Metrics" from the sidebar
- Choose the deployment environment
- Select the time range
API Access
Fetch metrics programmatically:
# Get deployment metrics
srcpush metrics get-deployment MyApp Production
# Get specific metric
srcpush metrics get MyApp --metric download_success_rate
Setting Up Alerts
Alert Configuration
{
"alerts": {
"errorRate": {
"threshold": 5,
"timeWindow": "1h"
},
"rollbackRate": {
"threshold": 2,
"timeWindow": "24h"
}
}
}
Notification Channels
Configure alerts through various channels:
- Email notifications
- Slack integration
- Webhook callbacks
- SMS alerts
Custom Metrics
Implementing Custom Tracking
import { MetricsService } from "@srcpush/metrics";
// Track custom events
MetricsService.trackEvent("custom_update_event", {
updateVersion: "1.2.3",
deviceType: "ios",
customData: {
feature: "newUI",
userSegment: "beta",
},
});
Custom Dashboards
Create custom dashboards using the metrics API:
const customMetrics = await MetricsService.query({
timeRange: "7d",
metrics: ["download_time", "install_time"],
dimensions: ["app_version", "device_type"],
filters: {
deployment: "Production",
country: "US",
},
});
Best Practices
1. Regular Monitoring
- Set up daily/weekly metric reviews
- Establish baseline metrics
- Track trends over time
- Document anomalies
2. Performance Optimization
- Monitor bundle sizes
- Track download speeds
- Analyze installation times
- Optimize based on metrics
3. User Impact Analysis
- Track user segments
- Monitor device types
- Analyze geographic patterns
- Measure user engagement
Troubleshooting
Common Issues
-
High Error Rates
- Check network conditions
- Verify bundle integrity
- Review device compatibility
- Analyze error patterns
-
Slow Performance
- Monitor bundle size
- Check CDN performance
- Analyze device metrics
- Review network metrics
Debug Logging
Enable detailed metric logging:
MetricsService.setLogLevel("debug");
MetricsService.enableDetailedLogging();
Integration Examples
CI/CD Integration
# GitHub Actions example
steps:
- name: Check Deployment Metrics
run: |
srcpush metrics check \
--app MyApp \
--deployment Production \
--threshold error_rate=5
Monitoring Integration
// Prometheus integration
const metrics = new PrometheusMetrics();
metrics.trackSourcePush({
app: "MyApp",
deployment: "Production",
metrics: ["error_rate", "download_time"],
});
Next Steps
- Set up CI/CD Integration
- Learn about Deployment Strategies
- Configure Release Management