Skip to content

Commit

Permalink
Merge pull request #77 from jtpio/drop-deprecated-endpoint
Browse files Browse the repository at this point in the history
Drop the deprecated /metrics endpoint 🔥 🔥 🔥
  • Loading branch information
jtpio authored Dec 17, 2020
2 parents c7d5970 + 9fbc67b commit 5aa97c1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ can set the parameter `--ResourceUseDisplay.mem_warning_threshold=0.1`.

### CPU Usage

`jupyter-resource-usage` can also track CPU usage and report a `cpu_percent` value as part of the `/metrics` response.
`jupyter-resource-usage` can also track CPU usage and report a `cpu_percent` value as part of the `/api/metrics/v1` response.

You can set the `cpu_limit` in several ways:

Expand Down
5 changes: 0 additions & 5 deletions jupyter_resource_usage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ def load_jupyter_server_extension(nbapp):
nbapp.web_app.settings["jupyter_resource_usage_display_config"] = resuseconfig
base_url = nbapp.web_app.settings["base_url"]

if not resuseconfig.disable_legacy_endpoint:
nbapp.web_app.add_handlers(
".*", [(url_path_join(base_url, "/metrics"), ApiHandler)]
)

nbapp.web_app.add_handlers(
".*", [(url_path_join(base_url, "/api/metrics/v1"), ApiHandler)]
)
Expand Down
10 changes: 0 additions & 10 deletions jupyter_resource_usage/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ class ResourceUseDisplay(Configurable):
Holds server-side configuration for jupyter-resource-usage
"""

disable_legacy_endpoint = Bool(
True,
help="""
Disable legacy /metrics endpoint
This prevents jupyter-resource-usage from shadowing the prometheus /metrics endpoint.
""",
config=True,
)

process_memory_metrics = List(
trait=PSUtilMetric(),
default_value=[{"name": "memory_info", "attribute": "rss"}],
Expand Down

0 comments on commit 5aa97c1

Please sign in to comment.