Skip to content

Commit

Permalink
Fixes the tracker interface to officially handle logging attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahbenizzy committed Aug 11, 2024
1 parent 235e2b2 commit fa2d028
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions burr/tracking/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,14 +426,14 @@ def pre_start_span(
self,
*,
action: str,
sequence_id: int,
action_sequence_id: int,
span: ActionSpan,
span_dependencies: list[str],
**future_kwargs: Any,
):
begin_span_model = BeginSpanModel(
start_time=datetime.datetime.now(),
action_sequence_id=sequence_id,
action_sequence_id=action_sequence_id,
span_id=span.uid,
parent_span_id=span.parent.uid if span.parent else None,
span_dependencies=span_dependencies,
Expand All @@ -445,14 +445,14 @@ def post_end_span(
self,
*,
action: str,
sequence_id: int,
action_sequence_id: int,
span: ActionSpan,
span_dependencies: list[str],
**future_kwargs: Any,
):
end_span_model = EndSpanModel(
end_time=datetime.datetime.now(),
action_sequence_id=sequence_id,
action_sequence_id=action_sequence_id,
span_id=span.uid,
)
self._append_write_line(end_span_model)
Expand Down
8 changes: 4 additions & 4 deletions burr/visibility/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _sync_hooks_enter(self, context: ActionSpan):
action=self.action,
span=context,
span_dependencies=self.span_dependencies,
sequence_id=self.action_sequence_id,
action_sequence_id=self.action_sequence_id,
app_id=self.app_id,
partition_key=self.partition_key,
)
Expand All @@ -144,7 +144,7 @@ async def _async_hooks_enter(self, context: ActionSpan):
action=self.action,
span=context,
span_dependencies=self.span_dependencies,
sequence_id=self.action_sequence_id,
action_sequence_id=self.action_sequence_id,
app_id=self.app_id,
partition_key=self.partition_key,
)
Expand All @@ -155,7 +155,7 @@ async def _async_hooks_exit(self, context: ActionSpan):
action=self.action,
span=context,
span_dependencies=self.span_dependencies,
sequence_id=self.action_sequence_id,
action_sequence_id=self.action_sequence_id,
app_id=self.app_id,
partition_key=self.partition_key,
)
Expand Down Expand Up @@ -187,7 +187,7 @@ def _sync_hooks_exit(self, context: ActionSpan):
action=self.action,
span=context,
span_dependencies=self.span_dependencies,
sequence_id=self.action_sequence_id,
action_sequence_id=self.action_sequence_id,
app_id=self.app_id,
partition_key=self.partition_key,
)
Expand Down
3 changes: 3 additions & 0 deletions tests/core/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -2482,6 +2482,9 @@ def test_application_builder_initialize_fork_app_id_happy_pth():


class NoOpTracker(SyncTrackingClient):
def do_log_attributes(self, **future_kwargs: Any):
pass

def __init__(self, unique_id: str):
self.unique_id = unique_id

Expand Down

0 comments on commit fa2d028

Please sign in to comment.