def METHOD_NAME(configs, project, bucket_path):
    """Loads metric config files and runs each metric."""
    queryer = BigQuerier(project, bucket_path)
    # authenticate as the given service account if our environment is providing one
    if 'GOOGLE_APPLICATION_CREDENTIALS' in os.environ:
        keyfile = os.environ['GOOGLE_APPLICATION_CREDENTIALS']
        check(['gcloud', 'auth', 'activate-service-account', f'--key-file={keyfile}'])
    # the 'bq show' command is called as a hack to dodge the config prompts that bq presents
    # the first time it is run. A newline is passed to stdin to skip the prompt for default project
    # when the service account in use has access to multiple projects.
    check(['bq', 'show'], stdin='\n')
    errs = []
    for path in configs or all_configs():
        try:
            with open(path) as config_raw:
                config = yaml.safe_load(config_raw)
            if not config:
                raise ValueError('invalid yaml: %s.' % path)
            config['metric'] = config['metric'].strip()
            validate_metric_name(config['metric'])
            queryer.run_metric(config)
        except (
                ValueError,
                KeyError,
                IOError,
                subprocess.CalledProcessError,
            ):
            print(traceback.format_exc(), file=sys.stderr)
            errs.append(path)
    if errs:
        print('Failed %d configs: %s' % (len(errs), ', '.join(errs)))
        sys.exit(1)