jupyter-server / jupyter-resource-usage

Jupyter Notebook Extension for monitoring your own Resource Usage
BSD 2-Clause "Simplified" License
497 stars 102 forks source link

ValueError: Duplicated timeseries in CollectorRegistry: {'total_memory_usage'} #151

Open aaktaev opened 2 years ago

aaktaev commented 2 years ago
  1. Run :
    jupyter notebook --ResourceUseDisplay.enable_prometheus_metrics=False --ResourceUseDisplay.track_cpu_percent=True --NotebookApp.quit_button=False --NotebookApp.default_url="/lab"
  2. See error
12:50:30 notebook.1 | [W 12:50:30.817 NotebookApp] Error loading server extension nbresuse
12:50:30 notebook.1 |     Traceback (most recent call last):
12:50:30 notebook.1 |       File "/usr/local/lib/python3.10/dist-packages/notebook/notebookapp.py", line 2028, in init_server_extensions
12:50:30 notebook.1 |         func(self)
12:50:30 notebook.1 |       File "/usr/local/lib/python3.10/dist-packages/nbresuse/__init__.py", line 49, in load_jupyter_server_extension
12:50:30 notebook.1 |         PrometheusHandler(PSUtilMetricsLoader(nbapp)), 1000
12:50:30 notebook.1 |       File "/usr/local/lib/python3.10/dist-packages/nbresuse/prometheus.py", line 25, in __init__
12:50:30 notebook.1 |         gauge = Gauge(phrase, "counter for " + phrase.replace("_", " "), [])
12:50:30 notebook.1 |       File "/usr/local/lib/python3.10/dist-packages/prometheus_client/metrics.py", line 365, in __init__
12:50:30 notebook.1 |         super().__init__(
12:50:30 notebook.1 |       File "/usr/local/lib/python3.10/dist-packages/prometheus_client/metrics.py", line 143, in __init__
12:50:30 notebook.1 |         registry.register(self)
12:50:30 notebook.1 |       File "/usr/local/lib/python3.10/dist-packages/prometheus_client/registry.py", line 43, in register
12:50:30 notebook.1 |         raise ValueError(
12:50:30 notebook.1 |     ValueError: Duplicated timeseries in CollectorRegistry: {'total_memory_usage'}

It runs OK, but I need to get rid of this error.

Expected behavior

Context

Config dir: /usr/etc/jupyter
    gmaps enabled
    - Validating gmaps...
      gmaps 0.9.0 OK
    jupyter_server_proxy enabled
    - Validating jupyter_server_proxy...
      jupyter_server_proxy  OK
    jupyter_resource_usage enabled
    - Validating jupyter_resource_usage...
      jupyter_resource_usage 0.6.1 OK
    jupyter_server_mathjax enabled
    - Validating jupyter_server_mathjax...
      jupyter_server_mathjax  OK
    jupyterlab-system-monitor enabled
    - Validating jupyterlab-system-monitor...
      jupyterlab-system-monitor 0.8.0 OK
    jupyterlab-topbar enabled
    - Validating jupyterlab-topbar...
      jupyterlab-topbar 0.6.1 OK
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.4.4 OK
    jupyterlab_git enabled
    - Validating jupyterlab_git...
      jupyterlab_git 0.37.1 OK
    jupyterlab_plotly enabled
    - Validating jupyterlab_plotly...
      jupyterlab_plotly  OK
    jupyterlab_pygments enabled
    - Validating jupyterlab_pygments...
      jupyterlab_pygments 0.2.2 OK
    jupyterlab_widgets enabled
    - Validating jupyterlab_widgets...
      jupyterlab_widgets 1.1.1 OK
    nbclassic enabled
    - Validating nbclassic...
      nbclassic 0.4.3 OK
    nbdime enabled
    - Validating nbdime...
      nbdime 3.1.1 OK
    notebook_shim enabled
    - Validating notebook_shim...
      notebook_shim  OK
welcome[bot] commented 2 years ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada: