Prometheus should check that the iterator is valid before using it
Prometheus should check that the iterator is valid before using it

When searching for a specific metric family name, the returned iterator could
be invalid (if the searched metric family name is lexically bigger than all
metircs family names).

We should check that the return iterator is valid before trying to check
that it points to the right metric family name.

Fixes #387

Signed-off-by: Amnon Heiman <ed5fc74c4692051ad0b19749fd7cea6ec2d74b9e@scylladb.com>
Message-Id: <20180114152021.29800-1-ed5fc74c4692051ad0b19749fd7cea6ec2d74b9e@scylladb.com>

dreamsxin/seastar,syuu1228/seastar,scylladb/seastar,scylladb/seastar,cloudius-systems/seastar,avikivity/seastar,cloudius-systems/seastar,dreamsxin/seastar,dreamsxin/seastar,syuu1228/seastar,syuu1228/seastar,avikivity/seastar,scylladb/seastar,cloudius-systems/seastar,avikivity/seastar