Unittests for prometheus gauge metrics

Here is my metrics code:

from prometheus_client import Gauge

probe = Gauge('probe_success', '1 - probe success, 0 - probe failure'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
          ['probe_type', 'target', 'timeout', 'service', 'namespace', 'reason'])

If request to the address is successful the value in the end is 1, if some error occurs the value is 0.

def probe_success(probe_type, target, timeout, service, namespace, reason, value):
    probe.labels(probe_type, target, timeout, service, namespace, reason).set(value)

And this is how my metrics look like:

  probe_success{namespace="test",probe_type="http",reason="MissingSchema",service="servicename",target="ddress-test1",timeout="5"} 0.0
probe_success{namespace="test",probe_type="http",reason="ConnectionError",service="servicename",target="http://address-test2",timeout="10"} 0.0
probe_success{namespace="test-2",probe_type="http",reason="",service="servicename",target="https://www.google.com",timeout="5"} 1.0

So how could I test these metrics. I read about REGISTRY.get_sample_value but I didn't see how can I use it on gauge set method. In general I don't have idea how to build appropriate test cases. If anyone has suggestions I will be pleased to read them.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum