Skip to content

Gauge: accessing valBits #958

Answered by beorn7
skwiffhub asked this question in Q&A
Jan 5, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

In that case, I would recommend to manage the Gauge value on your own and expose it via https://pkg.go.dev/github.com/prometheus/client_golang@v1.11.0/prometheus#NewGaugeFunc

Note that you run into all kind of concurrency problems. After retrieving the value from a Gauge, another goroutine might already update it before you set it again. Furthermore, future versions of client_golang might leverage core-local variables that are only gathered together upon scrape…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@skwiffhub
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by skwiffhub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants