title: Prometheus python exporter for json values
body: <p>I have a scenario where I am fetching and formatting json response then I want to use the Prometheus-python client to convert the <a href="https://jsfiddle.net/2em8bx1a/" rel="nofollow noreferrer">json data</a> which is obtained from <code>response</code> into Prometheus relevant metrics.</p>
  
  <p>Here is what I have tried :</p>
  
  <pre><code>import time
  from prometheus_client.core import GaugeMetricFamily, REGISTRY, CounterMetricFamily
  from prometheus_client import start_http_server
  import requests
  import json
  
  class CustomCollector(object):
      def __init__(self):
          pass
  
      def collect(self):
          response = requests.get('https://api.test.com/v1/data', auth= 
          ('abc@gg.com', 'xxrty'))
          d1=(response.json())
          for key in d1:
             g = GaugeMetricFamily("devicevalue", 'Help text', labels=['datalnddev'])
             g.add_metric([key['appname'], key['value'])
             yield g
  
  if __name__ == '__main__':
      start_http_server(8003)
      REGISTRY.register(CustomCollector())
      while True:
          time.sleep(1)
  </code></pre>
  
  <p>But this does not help to solve the issue, I am not sure how to proceed here any help would be great.
  expected <a href="https://jsfiddle.net/pLd04ryz/" rel="nofollow noreferrer">exporter metrics</a> output in prometheus.</p>