I have:
counter= Counter(metric, metric,
labelnames=['client'], labelvalues=[ data['client'] ])
print counter
print dir(counter)
counter.inc(diff)
<prometheus_client.core._LabelWrapper object at 0xcf8ed0>
['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', 'describe', 'labels', 'remove']
counter.inc(diff)
| AttributeError: '_LabelWrapper' object has no attribute 'inc'
I was expecting counter to have the inc method.
I was expecting counter to have the inc method.
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/e0a13efa-dee0-4b66-ab65-cf703cf853ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On 15 June 2017 at 17:05, Marc Pawlowsky <marc...@gmail.com> wrote:Can anybody tell me how to send a metric with labels using the python_clientI have:
counter= Counter(metric, metric,
labelnames=['client'], labelvalues=[ data['client'] ])
print counter
print dir(counter)
counter.inc(diff)<prometheus_client.core._LabelWrapper object at 0xcf8ed0>
['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', 'describe', 'labels', 'remove']counter.inc(diff)| AttributeError: '_LabelWrapper' object has no attribute 'inc'
See the examples at https://github.com/prometheus/client_python/#labelsYou need to specify labels, otherwise we don't know what to increment.Brian
I was expecting counter to have the inc method.
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/e0a13efa-dee0-4b66-ab65-cf703cf853ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.