Merge pull request #4036 from Hyaxia/metrics_terminal
Added metrics for currently running terminals and labeled by type kernelspull/4063/head
commit
dfcea5b3f7
@ -0,0 +1,4 @@
|
||||
"""
|
||||
A package containing all the functionality and
|
||||
configuration connected to the prometheus metrics
|
||||
"""
|
||||
@ -1,18 +1,5 @@
|
||||
"""
|
||||
Prometheus metrics exported by Jupyter Notebook Server
|
||||
from ..prometheus.metrics import HTTP_REQUEST_DURATION_SECONDS
|
||||
|
||||
Read https://prometheus.io/docs/practices/naming/ for naming
|
||||
conventions for metrics & labels.
|
||||
"""
|
||||
|
||||
from prometheus_client import Histogram
|
||||
|
||||
# This is a fairly standard name for HTTP duration latency reporting
|
||||
HTTP_REQUEST_DURATION_SECONDS = Histogram(
|
||||
'http_request_duration_seconds',
|
||||
'duration in seconds for all HTTP requests',
|
||||
['method', 'handler', 'status_code'],
|
||||
)
|
||||
|
||||
def prometheus_log_method(handler):
|
||||
"""
|
||||
@ -0,0 +1,27 @@
|
||||
"""
|
||||
Prometheus metrics exported by Jupyter Notebook Server
|
||||
|
||||
Read https://prometheus.io/docs/practices/naming/ for naming
|
||||
conventions for metrics & labels.
|
||||
"""
|
||||
|
||||
|
||||
from prometheus_client import Histogram, Gauge
|
||||
|
||||
|
||||
HTTP_REQUEST_DURATION_SECONDS = Histogram(
|
||||
'http_request_duration_seconds',
|
||||
'duration in seconds for all HTTP requests',
|
||||
['method', 'handler', 'status_code'],
|
||||
)
|
||||
|
||||
TERMINAL_CURRENTLY_RUNNING_TOTAL = Gauge(
|
||||
'terminal_currently_running_total',
|
||||
'counter for how many terminals are running',
|
||||
)
|
||||
|
||||
KERNEL_CURRENTLY_RUNNING_TOTAL = Gauge(
|
||||
'kernel_currently_running_total',
|
||||
'counter for how many kernels are running labeled by type',
|
||||
['type']
|
||||
)
|
||||
Loading…
Reference in new issue