def METHOD_NAME(instance, aggregator, datadog_agent, dd_run_check):
    # add some stats
    connection = psycopg2.connect(
        host=common.HOST,
        port=common.PORT,
        user=common.USER,
        password=common.PASS,
        database=common.DB,
        connect_timeout=1,
    )
    connection.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
    cur = connection.cursor()
    cur.execute('SELECT * FROM persons;')
    # run the check
    check = PgBouncer('pgbouncer', {}, [instance])
    check.check_id = 'test:123'
    dd_run_check(check)
    env_version = common.get_version_from_env()
    assert_metric_coverage(env_version, aggregator)
    version_metadata = {
        'version.raw': str(env_version),
        'version.scheme': 'semver',
        'version.major': str(env_version.major),
        'version.minor': str(env_version.minor),
        'version.patch': str(env_version.micro),
    }
    datadog_agent.assert_metadata('test:123', version_metadata)