Sensing circuitry of an implantable medical device (IMD) system may sense a cardiac signal that varies according to a cardiac cycle of a patient. Processing circuitry of the IMD system may determine a series of consecutive cardiac cycle length metric values based on the sensed cardiac signal, identify a plurality of pairs of the cardiac cycle length metrics, each of the pairs of cardiac cycle length metrics separated by an integer ‘n’ of the cardiac cycle length metrics, and construct a distribution of the pairs of cardiac cycle length metrics based on values of the cardiac cycle length metrics for each of the pairs. The processing circuitry may detect a sleep apnea episode of the patient based on one or more characteristics of the constructed distribution, and control communication circuitry of the IMD system to transmit an indication of the detected sleep apnea episode to the external computing device.