Description
JupyterLab 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.