JupyterLab regression
See original GitHub issueJupyterLab expects the memory usage information from NBResuse (i.e. what’s waiting for it at the <base_url>/metrics
endpoint) to have the JSON format specified by the following interface:
export interface IMetricRequestResult {
rss: number;
limits: {
memory?: {
rss: number;
warn?: number;
};
};
}
However, after the update to use Prometheus (0.3.4+), the JSON response emitted “by NBResuse” (i.e. at the <base_url>/metrics
endpoint) is now of the form as Prometheus’s HTTP API, see here. So JupyterLab can’t read it, so thinks NBResuse isn’t installed, and thus no longer displays memory usage information even when NBResuse is installed.
There seems to be a fairly clear mapping between the arguments passed to the constructors of the Prometheus Gauge
’s here in the NBResuse code and the response of the metadata portion of the Prometheus HTTP API, but I’m not sure about the format of the HTTP response encoding the actual values of the metrics. That knowledge seems to be embedded implicitly in the Javascript code for the NBExtension, but I still feel I need to look into it more closely to be sure.
Since this is a feature regression, I think it should be a priority to find some way to fix this as soon as possible, although it will probably require making a PR to JupyterLab. If that’s the case, then we should probably hold off on making any such PR before stabilizing the “API” for NBResuse.
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (14 by maintainers)
Top GitHub Comments
I added @jtpio to the repo on PyPI, and here too.
Right. Although
0.4.0
is considered a major release, so it’s a good time to start adding breaking changes.The plan is to drop it completely for the next major release: #75
The memory status code has already been removed from core lab: https://github.com/jupyterlab/jupyterlab/pull/9386
And for JupyterLab 3.0 users will still be able to get the memory usage status item with a single
pip install
, since the lab extension will be distributed with pip as well: https://github.com/jupyter-server/jupyter-resource-usage/pull/69So there is no dependencies between JupyterLab and nbresuse anymore, and the frontend extensions will use the new endpoint directly.