
    `i                    X    d dl mZ d dlmZmZ d dlmZ ddlmZ ddl	m
Z
mZ edfddZdS )    )annotations)hdrsweb)Handler   )_bake_output)	CollectorREGISTRYFregistryr	   disable_compressionboolreturnr   c                     d fd}|S )zBCreate a aiohttp handler which serves the metrics from a registry.requestweb.Requestr   web.Responsec                   K    fd j                                         D             }d                     j                            t
          j        g                     }d}t          	|||d          \  }}}t          j	        t          |                    d          d                   ||          }s|                                 |S )	Nc                F    i | ]}|j                             |          S  )querygetall).0keyr   s     x/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/prometheus_client/aiohttp/exposition.py
<dictcomp>zDmake_aiohttp_handler.<locals>.prometheus_handler.<locals>.<dictcomp>   s+    QQQS#w}++C00QQQ    , T)r    r   )statusheadersbody)r   keysjoinr!   r   r   ACCEPTr   r   Responseintsplitenable_compression)
r   paramsaccept_headeraccept_encoding_headerr    r!   outputresponser   r   s
   `       r   prometheus_handlerz0make_aiohttp_handler.<locals>.prometheus_handler   s      QQQQGM<N<N<P<PQQQ!7!7R!H!HII!#"." $#
 #
 #
 <v||C((+,,
 
 

 # 	*'')))r   )r   r   r   r   r   )r   r   r/   s   `` r   make_aiohttp_handlerr0   
   s/          . r   N)r   r	   r   r   r   r   )
__future__r   aiohttpr   r   aiohttp.typedefsr   
expositionr   r   r	   r
   r0   r   r   r   <module>r5      s    " " " " " "         $ $ $ $ $ $ % % % % % % * * * * * * * * # %      r   