The phrase a, or the, canary in a, or the, (coal) mine denotes an early indicator of potential danger or failure.
It refers to the former practice of taking live canaries into coal mines to test for the presence of toxic gases, particularly carbon monoxide, the illness or death of the canaries serving as an indication that such gases were present.
The earliest mention of this practice that I have found is from the Yorkshire Telegraph and Star (Sheffield, Yorkshire) of Friday 21st December 1906, which gave an account of the inquest that had been held the previous day at Ouston, near Chester-le-Street, on the four victims of an explosion at Arpeth pit:
Mr. W. C. Blackett, a mining expert, said that along with the Mines Inspector he made an attempt to reach the scene of the explosion, taking with him a canary in a cage, a safety lamp, and an electric hand lamp. They were well equipped to explore the workings with safety. Upon reaching a point beyond which it had hitherto been impossible to penetrate, they got a competent man to test the place with a safety lamp, and finding only a small bluecap, he took a deep breath, and with the electric lamp and the bird he made a rapid advance, left the bird, and retired. Returning with the safety lamp, and finding the bird on its perch, he advanced again and again in the same way, until he and the inspector came to the place where a body was lying. He saw at once that the man had died from after-damp, and was not burned. Still advancing in this way, they presently came to a stentor where another man had been working. Here he saw the bird fall from its perch, and, incautiously taking a breath of the air himself, his knees gave way to a small extent, but he managed to scramble out into the better air, taking the bird with him. The bird recovered within three or four minutes, and again got on to its perch. It was most extraordinary to see the rapid effect which the carbonic monoxide had on the bird, and he was quite satisfied, after the experience with a bird in this way, that a bird was a comparative safe guide, and much to be preferred to using mice, as the fall of the bird from the perch could easily be seen.
It was not long before the image of a canary in a coal mine was used for analogies. For example, this is the beginning of an article giving the reasons “as to why Hendersonville should have a live Chautauqua”, published in the Western Carolina Democrat and French Broad Hustler (Hendersonville, North Carolina) of Thursday 29th July 1915:
Canary birds are placed in coal mines to protect the lives of the miners. If the atmosphere becomes foul, the canary stops singing and begins to show unmistakable signs of distress. Then the miners know the atmosphere must be changed quickly or they must get out.
Chautauqua Versus Canary.
A Chautauqua is to a town what a canary is to a coal mine. If the intellectual and moral atmosphere of this town is such that a Chautauqua can’t live in it, then we must change the atmosphere or get out.
The earliest instance of the phrase a, or the, canary in a, or the, (coal) mine that I have found is from the Albuquerque Journal (Albuquerque, New Mexico) of Sunday 13th September 1964:
It wouldn’t take much imagination to select the trout as a symbol of good luck and good health in the United States. The trout lives where it is allowed and encouraged to live; he leaves, or dies when his life becomes intolerable or he is ambushed by man. he is the canary in the mine . . . the warning x-ray . . . the Geiger counter. What troubles him must trouble us and warn us as a people because his element is the pure water we need for life.
Government expert with oxygen mask and bird
from Canaries help in mine rescue
The Indianapolis News (Indianapolis, Indiana)
Saturday 20th January 1912