Set label explicitly by-name
This commit is contained in:
parent
db48d7a8b0
commit
ae3a87fa11
@ -22,9 +22,9 @@ def setup_gauge():
|
|||||||
g = Gauge(f'sys_cpu_temp_celsius_degrees', 'CPU Temperature', ['node_name'])
|
g = Gauge(f'sys_cpu_temp_celsius_degrees', 'CPU Temperature', ['node_name'])
|
||||||
logging.info(f'Created Gauge: {g}')
|
logging.info(f'Created Gauge: {g}')
|
||||||
|
|
||||||
labels = [_get_node_name()]
|
node_name_label = _get_node_name()
|
||||||
logging.info(f'Retrieved labels {labels}')
|
logging.info(f'Retrieved node_name label {node_name_label}')
|
||||||
g.labels(labels)
|
g.labels(node_name=node_name_label)
|
||||||
|
|
||||||
logging.info('Setting function for Gauge')
|
logging.info('Setting function for Gauge')
|
||||||
g.set_function(_get_temp)
|
g.set_function(_get_temp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user