jtpio / jupyterlab-system-monitor

JupyterLab extension to display system metrics
BSD 3-Clause "New" or "Revised" License
299 stars 30 forks source link

memory and CPU not showing in Jupyter Lab 3.0 #56

Closed yosit closed 1 year ago

yosit commented 3 years ago

The bar does show on the top. I'm installing this with pip:

jupyterlab-topbar
jupyterlab-system-monitor

Running this in the docker file:

    jupyter labextension install jupyterlab-topbar-extension 
                             jupyterlab-system-monitor 
                             jupyterlab-topbar-text 
                             jupyterlab-theme-toggle

Launching it with this:

jupyter lab \
  --NotebookApp.ResourceUseDisplay.mem_limit=$(( 16 *1024*1024*1024 )) \
  --NotebookApp.ResourceUseDisplay.track_cpu_percent=True \
  --NotebookApp.ResourceUseDisplay.cpu_limit=$(( 16 )) \
  --NotebookApp.allow_origin='*' \
  --NotebookApp.base_url=/ \
  --NotebookApp.log_format='%(message)s' \
  --NotebookApp.log_level='INFO' \
  --NotebookApp.password='' \
  --NotebookApp.token='' \
  --ip=0.0.0.0 \
  --no-browser \
  "--notebook-dir=$HOME" \
  --port=8888

The toolbar shows with the "Hello" and theme switch but not the memory and CPU.

jtpio commented 3 years ago

Thanks @yosit for reporting.

Have you tried installing the extension with pip?

pip install jupyterlab-system-monitor

Instead of jupyter labextension install.

ladychili commented 3 years ago

Same here. I installed jupyterlab-system-monitor with pip. The top bar not showing metrics, and the terminal keeps returning those error

image

yosit commented 3 years ago

@jtpio from the instructions I understood I need to do both pip install and jupyter labextension install

I see similar logs like @ladychili

iicky commented 3 years ago

I'm also getting the same logs. I have only run pip install jupyterlab-system-monitor to install. Here's the versions I am currently running:

# pip freeze | grep jupyterlab
jupyterlab==3.0.9
jupyterlab-pygments==0.1.2
jupyterlab-server==2.3.0
jupyterlab-system-monitor==0.8.0
jupyterlab-topbar==0.6.1

Any idea where the endpoint /api/metrics/ went?

jtpio commented 3 years ago

from the instructions I understood I need to do both pip install and jupyter labextension install

@yosit with JupyterLab 3.0 the single pip install should be enough,

Any idea where the endpoint /api/metrics/ went?

This endpoint is exposed by jupyter-resource-usage: https://github.com/jupyter-server/jupyter-resource-usage, which should now be part of the dependencies:

https://github.com/jtpio/jupyterlab-system-monitor/blob/a05a27d4d5be23259a14272f455b621d705b7d89/setup.py#L71

yosit commented 3 years ago

@jtpio thanks. It now shows the memory - only the label and the memory consumed (without the total like in the readme) and without the spike chart. It's not showing the CPU.

this is from the log:

[I 2021-03-12 08:36:42.154 ServerApp] jupyter_resource_usage | extension was successfully linked.
[W 2021-03-12 08:36:42.159 ServerApp] Trait, ResourceUseDisplay, not found.
[I 2021-03-12 08:36:42.381 ServerApp] nbclassic | extension was successfully linked.
[I 2021-03-12 08:36:42.396 ServerApp] jupyter_resource_usage | extension was successfully loaded.
[I 2021-03-12 08:36:42.397 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.6/dist-packages/jupyterlab
jabbera commented 3 years ago

Edit: Never mind. Leaving for posterity. It's because I'm running in k8s.

I'm having this same issue. It looks like the metrics api is only returning memory. Any idea why that would be happening?

{"rss": 275681280, "limits": {"memory": {"rss": 0}}}

shoegazerstella commented 3 years ago

I am having the same issue on jupyterlab 3.0.

jupyterlab @ file:///home/conda/feedstock_root/build_artifacts/jupyterlab_1616195786210/work
jupyterlab-drawio==0.8.0
jupyterlab-git==0.30.1
jupyterlab-nvdashboard==0.6.0
jupyterlab-pygments @ file:///home/conda/feedstock_root/build_artifacts/jupyterlab_pygments_1601375948261/work
jupyterlab-server @ file:///home/conda/feedstock_root/build_artifacts/jupyterlab_server_1617134349851/work
jupyterlab-system-monitor==0.8.0
jupyterlab-topbar==0.6.1
jupyterlab-widgets @ file:///home/conda/feedstock_root/build_artifacts/jupyterlab_widgets_1609173350931/work

Here's what it shows on the top bar:

Schermata 2021-06-01 alle 12 54 01
jtpio commented 3 years ago

Linking to https://github.com/jupyter-server/jupyter-resource-usage/issues/91 and https://github.com/jupyter-server/jupyter-resource-usage/issues/86 which sound similar.

paravatha commented 3 years ago

@jabbera @jtpio I am using k8s and seeing the issue w.r.t CPU not showing. Memory stats works fine

tlvu commented 3 years ago

I also have the same problem. CPU not showing, only memory is showing.

scottwsides commented 2 years ago

I've got the same error. The mem use number shows... but no bars. I'm running jupyterlab=3.3.0 and pip installing jupyterlab-system-monitor. Any progress?

EnyMan commented 2 years ago

I had to set the limits for the bars to show. https://github.com/jtpio/jupyterlab-system-monitor#graphic-display

scottwsides commented 2 years ago

I set the limits in the startup for jupyterlab... but still no luck. Mem usage shows but no bars

jtpio commented 1 year ago

Closing as jupyterlab-system-monitor has now been integrated in jupyter-resource-usage: https://github.com/jupyter-server/jupyter-resource-usage/issues/191

Feel free to open a new issue on the jupyter-resource-usage repo if needed: https://github.com/jupyter-server/jupyter-resource-usage

Thanks!