Metrics collection and analytics