title: how to write API query with filters in prometheus
body: <p>what I want: get the metrics from Prometheus with python</p>
  
  <p>sample code here:</p>
  
  <pre><code>import requests
  url='prometheus.cup.com'
  response=requests.get("{0}/api/v1/query_range?query=container_cpu_load_average_10s&amp;start=2018-11-05T00:59:00.781Z&amp;end=2018-11-05T01:00:00.781Z&amp;step=15s".format(url))
  </code></pre>
  
  <p>sample result is:</p>
  
  <pre><code>{u'beta_kubernetes_io_os': u'linux', u'name': u'k8s_POD_nginx-bf8f468d8-gbjvp_openwhisk01_01f85b0c-9f87-11e8-893e-6c92bf025c32_5', u'image': u'openshift/origin-pod:v3.9.0', u'namespace': u'openwhisk01', u'instance': u'openshift-app1.cup.com', u'job': u'kubernetes-cadvisor', u'pod_name': u'nginx-bf8f468d8-gbjvp', u'container_name': u'POD', u'__name__': u'container_cpu_load_average_10s', u'beta_kubernetes_io_arch': u'amd64', u'id': u'/kubepods.slice/kubepods-besteffort.slice/kubepods-besteffort-pod01f85b0c_9f87_11e8_893e_6c92bf025c32.slice/docker-d7422ab03a96a07395538e5fa5c9d971bb66855f94a45f4540f423cb1da3422f.scope', u'kubernetes_io_hostname': u'openshift-app1.cup.com'}
  </code></pre>
  
  <p>problem: i want to get result by some filters, like</p>
  
  <pre><code>query=container_cpu_load_average_10s{container_name=POD}, 
  (of course, this type is not right, just an example)
  </code></pre>
  
  <p>so what's the right method to write the API query with filters in python?</p>
  
  <p>thanks in advance</p>