SFP transceiver
acronymSmall Form-factor Pluggable: the swappable module that gives a switch port its physical medium - copper or fiber, short reach or long haul.
SFP+ carries 10G, QSFP bundles four lanes; the port is a socket, the transceiver is the decision.
An SFP is a contract as much as a module: a cage shape, an electrical interface and a management interface that let any compliant optic fill any compliant port. The management side is the specification SFF-8472, whose second address, A2h, 'is used to access measurements of transceiver temperature, internally measured supply voltage, TX bias current, TX output power, received optical power'. That is digital optical monitoring, read on Cisco IOS with 'show interface transceiver' and on Junos with 'show interfaces diagnostics optics'.
The reading worth learning is received power. Set against the receiver sensitivity in the module's data sheet, it is the link's loss budget measured instead of estimated, so a link whose margin is shrinking shows it there before it starts dropping frames. Not every module supports the diagnostics; the data sheet says which.