III-V optoelectronics grown epitaxially on Si substrates have large networks of dislocations due to a lattice constant mismatch between the device layers and the substrate. Recombination-enhanced dislocation glide (REDG) allows these dislocations to move and increase in length during device operation, which degrades performance. In this paper, we study REDG dynamics of threading dislocations in situ in (In)AlGaAs double heterostructures grown on Si substrates using scanning electron microscopy cathodoluminescence. The driving force for REDG arises due to coefficient of thermal expansion differences between Si and the III-V layers leading to large residual strains in the films. Tracking of threading dislocations as moving dark spot defects reveals glide characteristics that vary based on the nature of the dislocation. Remarkably, the alloying of a few atom percent of indium using metamorphic structures arrests threading dislocation glide by more than two orders of magnitude. Finally, we present REDG-based filtering as a pathway to reducing the threading dislocation density in select areas, removing a large fraction of the mobile dislocations. Together, these techniques will enable the understanding of dislocation-dislocation and carrier-dislocation interactions that have so far remained elusive during device operation, leading to reliable III-V integrated optoelectronics on silicon.