code: async def get_metrics(self, *tags):
          
          log.debug("Retrieving metrics for %s",
                    ', '.join(tags) if tags else "all units")
  
          metrics_facade = client.MetricsDebugFacade.from_connection(
              self.connection())
  
          entities = [client.Entity(tag) for tag in tags]
          metrics_result = await metrics_facade.GetMetrics(entities)
  
          metrics = collections.defaultdict(list)
  
          for entity_metrics in metrics_result.results:
              error = entity_metrics.error
              if error:
                  if "is not a valid tag" in error:
                      raise ValueError(error.message)
                  else:
                      raise Exception(error.message)
  
              for metric in entity_metrics.metrics:
                  metrics[metric.unit].append(vars(metric))
  
          return metrics
docs: Retrieve metrics.
  
          :param str *tags: Tags of entities from which to retrieve metrics.
              No tags retrieves the metrics of all units in the model.
          :return: Dictionary of unit_name:metrics