opened
yosefy
username_0
g.labels says: 
object has no attribute 'labels'
  thanks
how to add labels with pushgateway example?
issue
created
gbbirkisson
username_1
Same problem with Counter
comment
created
gbbirkisson
username_1
Ok, the documentation needs updating. I got labels working like this:

from prometheus_client import Counter
c = Counter('my_requests_total', 'HTTP Failures', labelnames=('method', 'endpoint'))
c.labels('get', '/').inc()
comment
created
yosefy
username_0
yes but how do we set the value of the metrics then?
without adding labels dir(g) gives
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_reserved_labelnames', '_samples', '_type', '_value', 'collect', 'dec', 'inc', 'set', 'set_function', 'set_to_current_time', 'time', 'track_inprogress']

but after adding labelnames it becomes
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_kwargs', '_labelnames', '_lock', '_metrics', '_name', '_samples', '_type', '_wrappedClass', 'collect', 'labels', 'remove']

and doesnt have set method anymore
comment
created
brian-brazil
username_2
Usage questions are best asked on https://groups.google.com/forum/#!aboutgroup/prometheus-users
comment
closed
brian-brazil
username_2
issue