8000 Prometheus_client can be used on OS windows and python version higher 3.5? · Issue #228 · prometheus/client_python · GitHub
[go: up one dir, main page]

Skip to content

Prometheus_client can be used on OS windows and python version higher 3.5? #228

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

Closed
drno-reg opened this issue Dec 20, 2017 · 3 comments
Closed

Comments

@drno-reg
Copy link
drno-reg commented Dec 20, 2017

Hello,

try to wrote prometheus_client
took simple code,

#!/usr/local/bin/python
# coding: utf-8

from prometheus_client import start_http_server, Summary
import random
import time

# Create a metric to track time spent and requests made.
REQUEST_TIME = Summary('request_processing_seconds', 'Time spent processing request')

# Decorate function with metric.
@REQUEST_TIME.time()
def process_request(t):
    """A dummy function that takes some time."""
    time.sleep(t)

if __name__ == '__main__':
    # Start up the server to expose the metrics.
    start_http_server(8000)
    # Generate some requests.
    while True:
        process_request(random.random())

tried to exceute on Windows Server 2008, with python 3.7 and returned error

Traceback (most recent call last):
  File "c:/Reposiroties/projects/um_open/templates/Test/Prometheus_Client.py", line 4, in <module>
    from prometheus_client import start_http_server, Summary
  File "C:\Software\Python37\lib\site-packages\prometheus_client\__init__.py", line 4, in <module>
    from . import exposition
  File "C:\Software\Python37\lib\site-packages\prometheus_client\exposition.py", line 31, in <module>
    PYTHON26_OR_OLDER = tuple(int(val) for val in sys.version.split()[0].split('.')) < (2, 7, 0)
  File "C:\Software\Python37\lib\site-packages\prometheus_client\exposition.py", line 31, in <genexpr>
    PYTHON26_OR_OLDER = tuple(int(val) for val in sys.version.split()[0].split('.')) < (2, 7, 0)
ValueError: invalid literal for int() with base 10: '0a2'

Prometheus_client can be used on OS windows and python version higher 3.5?

@brian-brazil
Copy link
Contributor

What exact version of Python are you using?

@drno-reg
Copy link
Author

Python 3.7.0a2

@brian-brazil
Copy link
Contributor

That's #227 then.

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
0