If resource_id nt provided, set it as project_id.
For some reason ceilometer add an extra query.