PATH: //proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/prometheus_client
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 __init__.py
↓
X
📁 __pycache__/
X
📄 asgi.py
↓
X
📁 bridge/
X
📄 context_managers.py
↓
X
📄 core.py
↓
X
📄 decorator.py
↓
X
📄 exposition.py
↓
X
📄 gc_collector.py
↓
X
📄 metrics.py
↓
X
📄 metrics_core.py
↓
X
📄 mmap_dict.py
↓
X
📄 multiprocess.py
↓
X
📁 openmetrics/
X
📄 parser.py
↓
X
📄 platform_collector.py
↓
X
📄 process_collector.py
↓
X
📄 registry.py
↓
X
📄 samples.py
↓
X
📁 twisted/
X
📄 utils.py
↓
X
📄 values.py
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: asgi.py
from urllib.parse import parse_qs from .exposition import _bake_output from .registry import REGISTRY def make_asgi_app(registry=REGISTRY): """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 = "Accept: " + ",".join([ value.decode("utf8") for (name, value) in scope.get('headers') if name.decode("utf8") == 'accept' ]) # Bake output status, header, output = _bake_output(registry, accept_header, params) # Return output payload = await receive() if payload.get("type") == "http.request": await send( { "type": "http.response.start", "status": int(status.split(' ')[0]), "headers": [ tuple(x.encode('utf8') for x in header) ] } ) await send({"type": "http.response.body", "body": output}) return prometheus_app
SIMPAN PERUBAHAN