title: Expose package metrics to Prometheus with prometheus_client
body: <p>I have two files running the following code on their own:</p>
  <p><code>sandbox1.py</code></p>
  <pre><code>from prometheus_client import Counter
  import time
  while True:
      my_counter1 = Counter('my_counter1', 'My counter)
      my_counter1.inc()
      time.sleep(1)
  </code></pre>
  <p><code>sandbox2.py</code></p>
  <pre><code>from prometheus_client import Counter
  import time
  while True:
      my_counter2 = Counter('my_counter2', 'My counter)
      my_counter2.inc()
      time.sleep(2)
  </code></pre>
  <p>Is there a way of using prometheus_client to expose <code>my_counter1</code> and <code>my_counter2</code> to my Prometheus server?</p>
  <p>I've had a look at <a href="https://github.com/prometheus/client_python" rel="nofollow noreferrer">https://github.com/prometheus/client_python</a>, but I'm not too sure how how to call the metrics from <code>sandbox1.py</code> and <code>sandbox2.py</code> into the file that actually exposes the metrics to Prometheus. Do the metrics always have to be part of the same file?</p>