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

disable instrumentation and notification for readonly commands #824

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

creamsoup
Copy link

motivation:
view, json, status, analyze_logs commands errored out (prometheus port already used) when I have Prometheus manager.py running.

suggested fix:
readonly commands ignores notification and instrumentation config values

$ python manager.py json
Traceback (most recent call last):
  File "/home/creamsoup/git/Swar-Chia-Plot-Manager/manager.py", line 39, in <module>
    json_output()
  File "/home/creamsoup/git/Swar-Chia-Plot-Manager/plotmanager/library/utilities/commands.py", line 109, in json_output
    jobs, running_work = get_running_plots(jobs=jobs, running_work=running_work,
  File "/home/creamsoup/git/Swar-Chia-Plot-Manager/plotmanager/library/utilities/processes.py", line 254, in get_running_plots
    set_plots_running(total_running_plots=assumed_job.total_running, job_name=assumed_job.name,
  File "/home/creamsoup/git/Swar-Chia-Plot-Manager/plotmanager/library/utilities/instrumentation.py", line 24, in set_plots_running
    _get_metrics(instrumentation_settings=instrumentation_settings)
  File "/home/creamsoup/git/Swar-Chia-Plot-Manager/plotmanager/library/utilities/instrumentation.py", line 19, in _get_metrics
    start_http_server(port)
  File "/home/creamsoup/git/Swar-Chia-Plot-Manager/venv/lib/python3.9/site-packages/prometheus_client/exposition.py", line 149, in start_wsgi_server
    httpd = make_server(addr, port, app, ThreadingWSGIServer, handler_class=_SilentHandler)
  File "/usr/lib/python3.9/wsgiref/simple_server.py", line 154, in make_server
    server = server_class((host, port), handler_class)
  File "/usr/lib/python3.9/socketserver.py", line 452, in __init__
    self.server_bind()
  File "/usr/lib/python3.9/wsgiref/simple_server.py", line 50, in server_bind
    HTTPServer.server_bind(self)
  File "/usr/lib/python3.9/http/server.py", line 138, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.9/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use

@creamsoup creamsoup changed the base branch from main to development May 26, 2021 07:25
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

Successfully merging this pull request may close these issues.

None yet

3 participants