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

add JSON content type in response header #57

Open
shreddd opened this issue Jun 17, 2020 · 4 comments
Open

add JSON content type in response header #57

shreddd opened this issue Jun 17, 2020 · 4 comments

Comments

@shreddd
Copy link

shreddd commented Jun 17, 2020

For the JSON API (currently /metrics but /api/nbresuse moving forward), it might be useful to add a "application/json" content type response header (which may allow for slightly easier parsing in certain clients).

Also - is there a set of upcoming changes / plans for nbresuse wrt the prometheus vs. JSON endpoints; the support for the statusbar etc.?

Before we contribute additional changes, it might be good to know what the plan is, so that we can figure out how best to target changes. I'm piecing together activity from various issues, but it would be good to see what was finally agreed upon moving forward.

@jtpio
Copy link
Member

jtpio commented Jun 17, 2020

Thanks @shreddd.

Also - is there a set of upcoming changes / plans for nbresuse wrt the prometheus vs. JSON endpoints; the support for the statusbar etc.?

Here is a short summary. But let's open a new meta issue right after to keep that separate from adding the JSON content type to the response header.

One plan would be to:

  • Keep the /metrics endpoint for the 0.3.x releases to not break backward compatibility with the lab status bar and other extensions that rely on nbresuse.
  • Drop the /metrics endpoint in 0.4.x so it doesn't shadow the Prometheus endpoint anymore
  • Either in a 0.3.x release or in 0.4.x: add a new /api/nbresuse/v1 endpoint to retrieve the metrics as JSON (just like the current /metrics endpoint). However the format of the response is still to be defined
  • Another thing on the roadmap is to report kernel specific metrics: Report kernel metrics #31
  • Potentially add more metrics (Network I/O or other metrics supported by psutil).

Of course this is open to suggestions. We can discuss more in the separate issue.

@jtpio
Copy link
Member

jtpio commented Jun 17, 2020

Opened #58 to keep track of the nbresuse roadmap.

This issue is now pinned to improve visibility:

image

@jtpio
Copy link
Member

jtpio commented Jun 17, 2020

Marking this current issue as a "good first issue", as it would require adding the content type to the endpoint in: https://github.com/yuvipanda/nbresuse/blob/master/nbresuse/api.py

@shreddd
Copy link
Author

shreddd commented Jun 19, 2020

OK - thanks - super helpful. I may have one of our summer interns help with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants