OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python311
/
lib
/
python3.11
/
site-packages
/
prometheus_client
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/05/2025 09:34:01 AM
rwxr-xr-x
📄
__init__.py
1.77 KB
05/08/2024 06:42:03 PM
rw-r--r--
📁
__pycache__
-
05/08/2024 06:42:03 PM
rwxr-xr-x
📄
asgi.py
1.57 KB
05/08/2024 06:42:03 PM
rw-r--r--
📁
bridge
-
05/08/2024 06:42:03 PM
rwxr-xr-x
📄
context_managers.py
2.29 KB
05/08/2024 06:42:03 PM
rw-r--r--
📄
core.py
860 bytes
05/08/2024 06:42:03 PM
rw-r--r--
📄
decorator.py
15.43 KB
05/08/2024 06:42:03 PM
rw-r--r--
📄
exposition.py
25.02 KB
05/08/2024 06:42:03 PM
rw-r--r--
📄
gc_collector.py
1.48 KB
05/08/2024 06:42:03 PM
rw-r--r--
📄
metrics.py
27.34 KB
05/08/2024 06:42:03 PM
rw-r--r--
📄
metrics_core.py
15.18 KB
05/08/2024 06:42:03 PM
rw-r--r--
📄
mmap_dict.py
5.27 KB
05/08/2024 06:42:03 PM
rw-r--r--
📄
multiprocess.py
7.36 KB
05/08/2024 06:42:03 PM
rw-r--r--
📁
openmetrics
-
05/08/2024 06:42:03 PM
rwxr-xr-x
📄
parser.py
7.26 KB
05/08/2024 06:42:03 PM
rw-r--r--
📄
platform_collector.py
1.83 KB
05/08/2024 06:42:03 PM
rw-r--r--
📄
process_collector.py
3.77 KB
05/08/2024 06:42:03 PM
rw-r--r--
📄
py.typed
0 bytes
05/08/2024 06:42:03 PM
rw-r--r--
📄
registry.py
6.05 KB
05/08/2024 06:42:03 PM
rw-r--r--
📄
samples.py
1.59 KB
05/08/2024 06:42:03 PM
rw-r--r--
📁
twisted
-
05/08/2024 06:42:03 PM
rwxr-xr-x
📄
utils.py
594 bytes
05/08/2024 06:42:03 PM
rw-r--r--
📄
values.py
4.88 KB
05/08/2024 06:42:03 PM
rw-r--r--
Editing: asgi.py
Close
from typing import Callable from urllib.parse import parse_qs from .exposition import _bake_output from .registry import CollectorRegistry, REGISTRY def make_asgi_app(registry: CollectorRegistry = REGISTRY, disable_compression: bool = False) -> Callable: """Create a ASGI app which serves the metrics from a registry.""" async def prometheus_app(scope, receive, send): assert scope.get("type") == "http" # Prepare parameters params = parse_qs(scope.get('query_string', b'')) accept_header = ",".join([ value.decode("utf8") for (name, value) in scope.get('headers') if name.decode("utf8").lower() == 'accept' ]) accept_encoding_header = ",".join([ value.decode("utf8") for (name, value) in scope.get('headers') if name.decode("utf8").lower() == 'accept-encoding' ]) # Bake output status, headers, output = _bake_output(registry, accept_header, accept_encoding_header, params, disable_compression) formatted_headers = [] for header in headers: formatted_headers.append(tuple(x.encode('utf8') for x in header)) # Return output payload = await receive() if payload.get("type") == "http.request": await send( { "type": "http.response.start", "status": int(status.split(' ')[0]), "headers": formatted_headers, } ) await send({"type": "http.response.body", "body": output}) return prometheus_app