Metastable oxygen atoms and molecules have received increased interest because of their function in surface modification, bio-decontamination and many other industrial applications, in addition to the role in the upper atmospheric layer chemistry. We review work on production and detection of metastable oxygen and we describe our experiments, including the development of techniques for measurement of metastable molecular oxygen. We show that either metastable oxygen molecules or metastable oxygen atoms can be produced in large quantities in electrical discharges, carefully tailored to promote the required kinetics. Although the two species may coexist, colder discharge regimes favor production of molecules, while at higher temperature conditions atomic oxygen prevails. We found that microwave cavity discharges in He/O2 mixtures favor molecular production, but that an arc-seeded microwave torch in air shows preference of atomic production. Result on the specific yield of molecular oxygen in the microwave cavity discharge shows qualitative agreement with the models