def METHOD_NAME(
    pipeline_run: PipelineRun,
    logger=None,
    logging_tags: Dict = None,
) -> Dict:
    if not pipeline_run:
        return
    if logging_tags is None:
        logging_tags = dict()
    if logger:
        logger.info(
            f'Calculate metrics for pipeline run {pipeline_run.id} started.',
            **logging_tags,
        )
    try:
        __calculate_metrics(pipeline_run)
        if logger:
            logger.info(
                f'Calculate metrics for pipeline run {pipeline_run.id} completed.',
                **merge_dict(logging_tags, dict(metrics=pipeline_run.metrics)),
            )
    except Exception as e:
        if logger:
            logger.error(
                f'Failed to calculate metrics for pipeline run {pipeline_run.id}.',
                **logging_tags,
                error=e
            )