Made changes in monitoring docs as per the feedback on PR review

This commit is contained in:
Rajat Goyal
2020-08-19 00:04:01 +05:30
parent c830d964d5
commit dcd520179c
6 changed files with 20 additions and 12 deletions

2
.gitignore vendored
View File

@@ -27,4 +27,4 @@ htmlcov
.vscode/ .vscode/
.pytest_cache .pytest_cache
pip-wheel-metadata pip-wheel-metadata
docs/source/monitoring/metrics.md docs/source/monitoring/gen/

View File

@@ -48,7 +48,7 @@ help:
@echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)" @echo " coverage to run coverage check of the documentation (if enabled)"
@echo " spelling to run spell check on documentation" @echo " spelling to run spell check on documentation"
@echo " generate to generate documentation by inspecting the source code" @echo " metrics to generate documentation for metrics by inspecting the source code"
clean: clean:
rm -rf $(BUILDDIR)/* rm -rf $(BUILDDIR)/*
@@ -61,10 +61,10 @@ rest-api: source/_static/rest-api/index.html
source/_static/rest-api/index.html: rest-api.yml node_modules source/_static/rest-api/index.html: rest-api.yml node_modules
npm run rest-api npm run rest-api
generate: metrics:
python3 generator.py python3 generate-metrics.py
html: rest-api generate html: rest-api
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo @echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html." @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

View File

@@ -1,8 +1,13 @@
import os
from os.path import join
from pytablewriter import MarkdownTableWriter from pytablewriter import MarkdownTableWriter
from pytablewriter.style import Style from pytablewriter.style import Style
import jupyterhub.metrics import jupyterhub.metrics
HERE = os.path.abspath(os.path.dirname(__file__))
class Generator: class Generator:
@classmethod @classmethod
@@ -25,8 +30,12 @@ class Generator:
return table_rows return table_rows
def prometheus_metrics(self): def prometheus_metrics(self):
filename = "./source/monitoring/metrics.md" generated_directory = f"{HERE}/source/monitoring"
table_name = "List of Prometheus Metrics\n" if not os.path.exists(generated_directory):
os.makedirs(generated_directory)
filename = f"{generated_directory}/metrics.md"
table_name = "List of Prometheus Metrics"
headers = ["Type", "Name", "Description"] headers = ["Type", "Name", "Description"]
values = self._parse_metrics() values = self._parse_metrics()
writer = self.create_writer(table_name, headers, values) writer = self.create_writer(table_name, headers, values)

View File

@@ -5,6 +5,7 @@ alabaster_jupyterhub
# 0.1.0 released. # 0.1.0 released.
https://github.com/jupyterhub/autodoc-traits/archive/75885ee24636efbfebfceed1043459715049cd84.zip https://github.com/jupyterhub/autodoc-traits/archive/75885ee24636efbfebfceed1043459715049cd84.zip
pydata-sphinx-theme pydata-sphinx-theme
pytablewriter==0.56.1
recommonmark>=0.6 recommonmark>=0.6
sphinx-copybutton sphinx-copybutton
sphinx-jsonschema sphinx-jsonschema

View File

@@ -3,8 +3,9 @@ Monitoring
This section covers details on monitoring the state of your JupyterHub installation. This section covers details on monitoring the state of your JupyterHub installation.
Jupyterhub operational metrics are collected using Prometheus. For more details about Prometheus please refer to the [official documentation](https://prometheus.io/docs/introduction/overview).
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
overview gen/metrics
metrics

View File

@@ -1,3 +0,0 @@
# Monitoring Overview
Jupyterhub operational metrics are collected using Prometheus. Please refer to [this doc](https://github.com/jupyterhub/mybinder.org-deploy/blob/master/docs/source/components/metrics.md) for a primer on Prometheus.