Any chemical compound involved in or a product of metabolism.