def METHOD_NAME(self, namespace, metrics):  # type: ignore[no-untyped-def]
    """
    Internal method to publish all provided metrics to cloudwatch, please make sure that array size of metrics is <= 20.
    """
    metric_data = [m.get_metric_data() for m in metrics]
    try:
        if metric_data:
            self.cloudwatch_client.put_metric_data(Namespace=namespace, MetricData=metric_data)
    except Exception:
        LOG.exception(f"Failed to report {len(metric_data)} metrics")