What we learn from a star's metal content.
Astronomers consider any chemical element heavier than hydrogen a metal.
Stars produce all elements heavier than hydrogen in their cores as a result of the process of fusion by which they produce energy to shine. So all the chemical elements produced in stars are considered metals. Most often astronomers use measurements of absorption lines in a stellar spectrum to measure the amount of iron present. Absorption lines due to hydrogen are analyzed in a similar manner to obtain the amount of hydrogen. The ratio of the amount of iron to the amount of hydrogen in the object is divided by the ratio of the amount of iron to the amount of hydrogen in our Sun to obtain a metallicity relative to the Sun.