def METHOD_NAME(caplog, raw_metric, expected_name, expected_tags, expected_method):
    caplog.clear()
    caplog.set_level(logging.DEBUG)
    name, tags, method = metrics.build_metric(raw_metric, logger)
    expected_log = (
        'Found metric {} ({})'.format(name, raw_metric) if expected_name else 'Ignoring metric {}'.format(raw_metric)
    )
    assert name == expected_name
    assert tags == expected_tags
    assert method == expected_method
    assert expected_log in caplog.text