def METHOD_NAME(metric, value, kwargs, region_name: Optional[str] = None):
    # publish metric only if CloudWatch service is available
    if not config.service_port("cloudwatch"):
        return
    cw_client = connect_to(region_name=region_name).cloudwatch
    try:
        cw_client.put_metric_data(
            Namespace="AWS/Lambda",
            MetricData=[
                {
                    "MetricName": metric,
                    "Dimensions": dimension_lambda(kwargs),
                    "Timestamp": datetime.utcnow().replace(tzinfo=timezone.utc),
                    "Value": value,
                }
            ],
        )
    except Exception as e:
        LOG.info('Unable to put metric data for metric "%s" to CloudWatch: %s', metric, e)