It is coming from the canary birds in the coal mines or in submarines[0]. They have a higher sensibility to CO than humans. This is now part of the common language to say that you sacrifice an animal or "something" to get early warning of something possibly more dangerous.
[0]: https://en.wikipedia.org/wiki/Sentinel_species#Historical_ex...