async def METHOD_NAME(instrument, connection, elasticapm_client):
    elasticapm_client.begin_transaction("test")
    await connection.execute("SELECT pg_sleep(0.1);")
    elasticapm_client.end_transaction("test", "OK")
    transaction = elasticapm_client.events[constants.TRANSACTION][0]
    spans = elasticapm_client.spans_for_transaction(transaction)
    assert len(spans) == 1
    span = spans[0]
    assert 100 < span["duration"] < 110
    assert transaction["id"] == span["transaction_id"]
    assert span["type"] == "db"
    assert span["subtype"] == "postgresql"
    assert span["action"] == "query"
    assert span["sync"] == False
    assert span["name"] == "SELECT FROM"