From 2729a514fedeb0836d50373b0b511b866de84079 Mon Sep 17 00:00:00 2001 From: Wen Guan Date: Wed, 25 Sep 2024 14:41:03 +0200 Subject: [PATCH] disable some labels because some loki can limit the number of labels --- pilot/util/lokirealtimelogger.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pilot/util/lokirealtimelogger.py b/pilot/util/lokirealtimelogger.py index 50b3a5cc..72933352 100644 --- a/pilot/util/lokirealtimelogger.py +++ b/pilot/util/lokirealtimelogger.py @@ -51,18 +51,22 @@ def format(self, record: logging.LogRecord) -> dict: formatted = { "timestamp": record.created, - "process": record.process, - "thread": record.thread, + # "process": record.process, + # "thread": record.thread, "function": record.funcName, "module": record.module, "name": record.name, "level": record.levelname, } + """ + # Not send all information, some loki services have limitations on number of labels. + record_keys = set(record.__dict__.keys()) for key in record_keys: if key not in formatted and key not in ['msg']: formatted[key] = getattr(record, key) + """ message = record.msg try: