Hi,

In the creation of the gauge, you need to only pass the label names (not
the values), and then pass the label values when you set the gauge:

g = Gauge('caliper_tps', "", ["client", "instance", "round"])
g.labels(client="0", instance="open1", round="0").set(0)

Cheers,
Julius

On Sat, Apr 11, 2020 at 7:31 AM Sungmin Jeun <[email protected]> wrote:

> Hi, I just create a gauge and assigned value with set() method.
> However error message says
>
>> AttributeError: 'Gauge' object has no attribute '_value'
>
>
> code is below
>
>> registry = CollectorRegistry()
>> g = Gauge('caliper_tps', "", {"client":"0","instance":"open1",
>> "round":"0"}, registry=registry)
>> g.set(0)
>
>
> How can i set value to guage metric?
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/80428846-4a9c-4899-9d95-8afb9d9683ac%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/80428846-4a9c-4899-9d95-8afb9d9683ac%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CA%2BT6Yoyyz12REqSLD3vDOhzRLOraWE87eaKEsnA4-ZdMR55Anw%40mail.gmail.com.

Reply via email to