The common case for application that used Doctrine2 is get metadata from class. This very simple, you only need inject manager (document or entity) in your service, and than simply use:
$this->documentManager->getMetadataFactory()->getMetadataForClass($class);