Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

throws an error and wont run #2

Open
evanrich opened this issue Apr 17, 2024 · 3 comments
Open

throws an error and wont run #2

evanrich opened this issue Apr 17, 2024 · 3 comments
Assignees

Comments

@evanrich
Copy link

Traceback (most recent call last):
  File "/usr/lib/python3.11/wsgiref/handlers.py", line 137, in run
    self.result = application(self.environ, self.start_response)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/sirius/homes/pysmart/lib/python3.11/site-packages/prometheus_client/exposition.py", line 128, in prometheus_app
    status, headers, output = _bake_output(registry, accept_header, accept_encoding_header, params, disable_compression)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/sirius/homes/pysmart/lib/python3.11/site-packages/prometheus_client/exposition.py", line 104, in _bake_output
    output = encoder(registry)
             ^^^^^^^^^^^^^^^^^
  File "/mnt/sirius/homes/pysmart/lib/python3.11/site-packages/prometheus_client/exposition.py", line 284, in generate_latest
    output.append(sample_line(s))
                  ^^^^^^^^^^^^^^
  File "/mnt/sirius/homes/pysmart/lib/python3.11/site-packages/prometheus_client/exposition.py", line 241, in sample_line
    ['{}="{}"'.format(
  File "/mnt/sirius/homes/pysmart/lib/python3.11/site-packages/prometheus_client/exposition.py", line 242, in <listcomp>
    k, v.replace('\\', r'\\').replace('\n', r'\n').replace('"', r'\"'))
       ^^^^^^^^^
AttributeError: ("'int' object has no attribute 'replace'", Metric(pysmart_test, PySMART metric test, gauge, , [Sample(name='pysmart_test', labels={'num': '0', 'hours': 3324, 'type': 'Short', 'status': 'Completed without error', 'LBA': 'N/A', 'device': 'nvme0', 'interface': 'nvme', 'raid_id': 'N/A', 'remain': 0}, value=1, timestamp=None, exemplar=None), Sample(name='pysmart_test', labels={'num': '1', 'hours': 3206, 'type': 'Short', 'status': 'Completed without error', 'LBA': 'N/A', 'device': 'nvme0', 'interface': 'nvme', 'raid_id': 'N/A', 'remain': 0}, value=1, timestamp=None, exemplar=None), Sample(name='pysmart_test', labels={'num': '2', 'ho
@ralequi ralequi self-assigned this Apr 17, 2024
@ralequi
Copy link
Member

ralequi commented Apr 17, 2024

Hi,

Which pysmart version are you using?

@evanrich
Copy link
Author

hey @ralequi I'm using whatever version is currently released, looks like 1.3.0. I tried multiple verisons of pysmart, the exporter (going back as far as v0.2.0) and the prometheus-client, going back to like 0.10.0, and couldn't get it to work.

My thoughts are that in the system I'm running this on (a venv on trueNAS scale), that maybe the nvme drives are throwing it off, or that it looks like your code was written for python 3.8, but truenas provides python 3.11 and that this was something between 3.8 and 3.11. I ended up finding another exporter (smart-exporter) that does something similar, but I can try and mess around with this next week or so. I'll be out of town for a week starting tonight but I can debug further to figure out if its a 3.8/3.11 or nvme issue.

From the errors, prometheus-client doens't seem to like something it's being fed, so it's either i think something in pysmart, or a 3.8/3.11 difference.

noryad-not-found pushed a commit that referenced this issue Nov 18, 2024
Solved Issues #2 and #4. The exporter is able to read nvme attributes correctly now.
@ralequi ralequi mentioned this issue Nov 18, 2024
@ralequi
Copy link
Member

ralequi commented Nov 20, 2024

Hi @evanrich , sorry for the huge delay,

We have made a refresh to the exporter and now it should works without issues.
Please, feel free to test and return some feedback when you are able.

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants