diff --git a/logfire/_internal/utils.py b/logfire/_internal/utils.py index 1c019fbe2..d5cabc4bc 100644 --- a/logfire/_internal/utils.py +++ b/logfire/_internal/utils.py @@ -374,6 +374,8 @@ class SeededRandomIdGenerator(IdGenerator): def __post_init__(self) -> None: self.random = random.Random(self.seed) + if self.seed is None: + os.register_at_fork(after_in_child=self.random.seed) def generate_span_id(self) -> int: span_id = self.random.getrandbits(64)