The study of the metabolites produced by an organism, including analysis of their chemical structures and pathways.