A fairly old trope; not sure if we already have this one. Quoth the Wikipedia: "Canaries were iconically used in coal mines to detect the presence of carbon monoxide. The bird's rapid breathing rate, small size, and high metabolism, compared to the miners, led birds in dangerous mines to succumb before the miners, thereby giving them time to take action."
Shows up in historical works (or period pieces, or some fantasy novels) about mining, naturally. Nowadays, if it still makes an appearance, it's generally done metaphorically (such as mentioning that a character with a danger sense "is like a canary in a coal mine" in that, when they panic, it's time to run away).