Then split the file into two files, one containing the metrics themselves, the other containing any function that have something to do with prometheus. Finally, Added new metrics into the prometheus.metrics file that represent the number of running terminals and added the functionality for that metric to be recorded in the terminal.api_handlers file.pull/4036/head
parent
d772277c0b
commit
03e5dc00e1
@ -1,18 +1,5 @@
|
||||
"""
|
||||
Prometheus metrics exported by Jupyter Notebook Server
|
||||
from notebook.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,21 @@
|
||||
"""
|
||||
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',
|
||||
)
|
||||
Loading…
Reference in new issue