We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e21dc2 commit 2cf122bCopy full SHA for 2cf122b
src/tnfr/metrics/telemetry.py
@@ -53,7 +53,7 @@
53
from __future__ import annotations
54
55
from dataclasses import dataclass, asdict
56
-from datetime import datetime
+from datetime import datetime, UTC
57
from pathlib import Path
58
from typing import Any, Iterable, Mapping, MutableMapping
59
import json
@@ -263,8 +263,9 @@ def _compute() -> None:
263
else:
264
_compute()
265
266
+ # Use timezone-aware UTC to avoid deprecation of datetime.utcnow()
267
event = TelemetryEvent(
- t_iso=datetime.utcnow().isoformat(timespec="seconds") + "Z",
268
+ t_iso=datetime.now(UTC).isoformat(timespec="seconds"),
269
t_epoch=time.time(),
270
step=step,
271
operator=operator,
0 commit comments