more logging.error and Exception handling for metrics, MetricData() needs to be completed