xBis7 commented on code in PR #63932:
URL: https://github.com/apache/airflow/pull/63932#discussion_r3119912154
##########
shared/observability/src/airflow_shared/observability/metrics/stats.py:
##########
@@ -22,18 +21,28 @@
import re
import socket
from collections.abc import Callable
-from typing import TYPE_CHECKING
+from contextlib import AbstractContextManager, ExitStack
+from typing import TYPE_CHECKING, Any, cast
from .base_stats_logger import NoStatsLogger
+from .metrics_registry import MetricsRegistry
if TYPE_CHECKING:
from .base_stats_logger import StatsLogger
+ from .protocols import DeltaType, Timer
log = logging.getLogger(__name__)
_VALID_STAT_NAME_CHARS_RE = re.compile(r"^[a-zA-Z0-9_.-]+$")
_INVALID_STAT_NAME_CHARS_RE = re.compile(r"[^a-zA-Z0-9_.-]")
+# Module-level singleton state.
+_factory: Callable[[], StatsLogger | NoStatsLogger] | None = None
+_backend: StatsLogger | NoStatsLogger | None = None
+_instance_pid: int | None = None
+_export_legacy_names: bool = True
+_registry: MetricsRegistry = MetricsRegistry()
+
Review Comment:
Yes, you are right. This is a valid point and I made the change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]