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

Exporters/Prometheus: Unable to record metrics #480

Closed
PikBot opened this issue Feb 4, 2019 · 2 comments
Closed

Exporters/Prometheus: Unable to record metrics #480

PikBot opened this issue Feb 4, 2019 · 2 comments
Assignees

Comments

@PikBot
Copy link

PikBot commented Feb 4, 2019

On running the following code, I get the following error:

Exception happened during processing of request from ('127.0.0.1', 50691)
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socketserver.py", line 625, in process_request_thread
    self.finish_request(request, client_address)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socketserver.py", line 354, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socketserver.py", line 681, in __init__
    self.handle()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/server.py", line 422, in handle
    self.handle_one_request()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/server.py", line 410, in handle_one_request
    method()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/prometheus_client/exposition.py", line 146, in do_GET
    output = encoder(registry)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/prometheus_client/openmetrics/exposition.py", line 26, in generate_latest
    for k, v in sorted(s.labels.items())]))
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/prometheus_client/openmetrics/exposition.py", line 26, in <listcomp>
    for k, v in sorted(s.labels.items())]))
AttributeError: 'NoneType' object has no attribute 'replace'

I have tried running the example for Prometheus exporter as well (that doesn't seem to work for me either).
Not sure whether it is related to this?
Any suggestions on as to what could be wrong, would be helpful!
@odeke-em

@songy23
Copy link
Contributor

songy23 commented Feb 5, 2019

Seems Prometheus doesn't allow label values to be None. Sending a PR to fix soon.

@PikBot
Copy link
Author

PikBot commented Feb 6, 2019

Thank you @songy23 !

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

No branches or pull requests

2 participants