The only vibration that produces a change in the dipole moment is observed as a signal in an IR spectrum.
for example, we have a magnitude of charges which are separated by distance d, then the dipole moment is M= $ * d ..................... where $ is the magnitude of charge and d is the distance between them so obviously, we are going to have a dipole moment. if we are changing the distance then the dipole moment wl be changed and that occurred when the bond stretches which change the distance due to which we can observe the signal in IR spectrum.