'prometheus_metrics.gauges[gauge].labels(product_name=product_name

help me out with the following error, I hardly managed to make hpilo-exporter work, mentioned hpilo-exporter

it gives me the below error prometheus_metrics.gauges[gauge].labels(product_name=product_name, AttributeError: module 'prometheus_metrics' has no attribute 'gauges'


----------------------------------------
Exception happened during processing of request from ('10.16.7.105', 52596)
Traceback (most recent call last):
  File "/usr/lib64/python3.6/socketserver.py", line 620, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib64/python3.6/socketserver.py", line 364, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib64/python3.6/socketserver.py", line 724, in __init__
    self.handle()
  File "/usr/lib64/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib64/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/root/hpilo-exporter-0.4.5/src/hpilo_exporter/exporter.py", line 112, in do_GET
    **prometheus_metrics.gauges[gauge].labels(product_name=product_name,
AttributeError: module 'prometheus_metrics' has no attribute 'gauges'**
----------------------------------------
curl: (52) Empty reply from server
(hpilo-venv) [root@promon ~]#

these are currently installed.

(hpilo-venv) [root@promon ~]# pip list
Package            Version Editable project location
------------------ ------- ------------------------------
cheroot            8.6.0
hpilo-exporter     0.4.5   /root/hpilo-exporter-0.4.5/src
jaraco.functools   3.4.0
more-itertools     8.12.0
pip                21.3.1
prometheus-client  0.13.1
prometheus-metrics 0.1.6.6
python-hpilo       4.4.3
setuptools         28.8.0
six                1.16.0
urllib3            1.26.8
web.py             0.62
wheel              0.29.0
(hpilo-venv) [root@promon ~]#

the hpilo-exporter is listening on port 9416


**(hpilo-venv) [root@promon ~]# hpilo-exporter --address=10.16.7.105 --port=9416 --endpoint="/metrics"  &**

(hpilo-venv) [root@promon ~]# netstat -lptn |grep 9416
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
**tcp        0      0 10.16.7.105:9416        0.0.0.0:*               LISTEN      1355/python**


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source