title: How to create custom metrics in prometheus?
body: <p>I'm setting up a monitoring PoC for future requirements. The PoC is developed locally on my computer. To monitor metric i use Prometheus and Grafana.
  I want to count the number of files received and the time spend to process it. For that i need to create custom metrics.</p>
  
  <p>I'm using python 2.7.5. For now i have linked Prometheus and the target. I receive metrics but don't know how to create metrics that i want. </p>
  
  <pre class="lang-py prettyprint-override"><code>counter = prom.Counter('python_my_counter', 'This is my counter')
  gauge = prom.Gauge('python_my_gauge', 'This is my gauge')
  histogram = prom.Histogram('python_my_histogram', 'This is my histogram')
  summary = prom.Summary('python_my_summary', 'This is my summary')
  
  
  def thr():
      while True:
          counter.inc(random.random())
          gauge.set(random.random() * 15 - 5)
          histogram.observe(random.random() * 10)
          summary.observe(random.random() * 10)
          process_request(random.random() * 5)
  
          time.sleep(1)
  </code></pre>
  
  <p>I expect the sum of files received "count the number of files received" metric.
  The time spent processing a file (i.e 2s) and the sum of time spent processing a file (50s).</p>