Re: [prometheus-users] AttributeError: 'Counter' object has no attribute 'labels'

232 views
Skip to first unread message

Simon Pasquier

unread,
May 6, 2019, 3:50:16 AM5/6/19
to atash...@gmail.com, Prometheus Users
I guess you didn't pass label names to the Gauge constructor.

from prometheus_client import Gauge
g = Gauge('room_temperature_celsius', 'Room temperature', ['name'])
g.labels('kitchen').set(20)

On Fri, May 3, 2019 at 5:50 PM <atash...@gmail.com> wrote:
>
> Hi Guys,
>
> I am trying to set guage metric with python client of prometheus. But it gives me
>>
>> AttributeError: 'Counter' object has no attribute 'labels'
>
> Even i haven't found any example which set labels for guage metric. It will be great if someone can share one example or Any doc.
> Thanks
>
> --
> 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/bc7c81cb-b469-44f3-834c-9bb744d338e4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages