Set Gauge value directly
This commit is contained in:
parent
ae3a87fa11
commit
46549c16fd
@ -24,7 +24,8 @@ def setup_gauge():
|
||||
|
||||
node_name_label = _get_node_name()
|
||||
logging.info(f'Retrieved node_name label {node_name_label}')
|
||||
g.labels(node_name=node_name_label)
|
||||
# Why call `.set()` here? Because, without it, I get "gauge metric is missing label values"
|
||||
g.labels(node_name=node_name_label).set(_get_temp())
|
||||
|
||||
logging.info('Setting function for Gauge')
|
||||
g.set_function(_get_temp)
|
||||
|
Loading…
x
Reference in New Issue
Block a user