Skip to content

Commit 1c95d17

Browse files
chore(tracing): remove Span.finished setter and Span.finish_with_ancestors (#15212)
## Description Deprecated in 3.x, now removed in 4.0 ## Testing <!-- Describe your testing strategy or note what tests are included --> ## Risks <!-- Note any risks associated with this change, or "None" if no risks --> ## Additional Notes <!-- Any other information that would be helpful for reviewers --> Co-authored-by: Emmett Butler <723615+emmettbutler@users.noreply.github.com>
1 parent 47c2931 commit 1c95d17

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

ddtrace/_trace/span.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -269,19 +269,6 @@ def start(self, value: Union[int, float]) -> None:
269269
def finished(self) -> bool:
270270
return self.duration_ns is not None
271271

272-
@finished.setter
273-
def finished(self, value: bool) -> None:
274-
"""Finishes the span if set to a truthy value.
275-
276-
If the span is already finished and a truthy value is provided
277-
no action will occur.
278-
"""
279-
if value:
280-
if not self.finished:
281-
self.duration_ns = Time.time_ns() - self.start_ns
282-
else:
283-
self.duration_ns = None
284-
285272
@property
286273
def duration(self) -> Optional[float]:
287274
"""The span duration in seconds."""
@@ -776,15 +763,6 @@ def _finish_with_ancestors(self) -> None:
776763
span.finish()
777764
span = span._parent
778765

779-
@removals.remove(removal_version="4.0.0")
780-
def finish_with_ancestors(self) -> None:
781-
"""Finish this span along with all (accessible) ancestors of this span.
782-
783-
This method is useful if a sudden program shutdown is required and finishing
784-
the trace is desired.
785-
"""
786-
self._finish_with_ancestors()
787-
788766
def __enter__(self) -> "Span":
789767
return self
790768

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
upgrade:
3+
- |
4+
tracing: ``Span.finished`` setter was removed, please use ``Span.finish()`` method instead.
5+
- |
6+
tracing: ``Span.finish_with_ancestors`` was removed with no replacement.

0 commit comments

Comments
 (0)