
    ^h*                         S r SSKJr  S rg)zLog functions for prometheus   )HTTP_REQUEST_DURATION_SECONDSc                    [         R                  " U R                  R                  U R                  R
                   S[        U 5      R                   3U R                  5       S9R                  U R                  R                  5       5        g)ac  
Tornado log handler for recording RED metrics.

We record the following metrics:
   Rate - the number of requests, per second, your services are serving.
   Errors - the number of failed requests per second.
   Duration - The amount of time each request takes expressed as a time interval.

We use a fully qualified name of the handler as a label,
rather than every url path to reduce cardinality.

This function should be either the value of or called from a function
that is the 'log_function' tornado setting. This makes it get called
at the end of every request, allowing us to record the metrics we need.
.)methodhandlerstatus_codeN)r   labelsrequestr   	__class__
__module__type__name__
get_statusobserverequest_time)r   s    a/home/james-whalen/.local/lib/python3.13/site-packages/jupyter_server/prometheus/log_functions.pyprometheus_log_methodr      sj      "((%%$$//0$w-2H2H1IJ&&( ggoo**,-    N)__doc__metricsr   r    r   r   <module>r      s    " 2.r   