Skip to content

Commit b3f0d0e

Browse files
committed
fix(weave): keep traced_generator on calls_query_stream
Extracting _build_calls_query took the decorator with it, so the span named calls_query_stream wrapped a plain function returning a tuple while the actual generator -- a public API read path -- lost its span entirely. It went unnoticed because unpacking cq, settings works on any iterable, including the generator the decorator returned.
1 parent a815de0 commit b3f0d0e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

weave/trace_server/clickhouse_trace_server_batched.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1858,7 +1858,6 @@ def calls_usage(self, req: tsi.CallsUsageReq) -> tsi.CallsUsageRes:
18581858
unfinished_call_ids=sorted(unfinished_call_ids),
18591859
)
18601860

1861-
@traced_generator(name="clickhouse_trace_server_batched.calls_query_stream")
18621861
def _build_calls_query(
18631862
self, req: tsi.CallsQueryReq
18641863
) -> tuple[CallsQuery, dict[str, Any] | None]:
@@ -1966,6 +1965,7 @@ def _build_calls_query(
19661965

19671966
return cq, settings
19681967

1968+
@traced_generator(name="clickhouse_trace_server_batched.calls_query_stream")
19691969
def calls_query_stream(self, req: tsi.CallsQueryReq) -> Iterator[tsi.CallSchema]:
19701970
"""Returns a stream of calls that match the given query."""
19711971
cq, settings = self._build_calls_query(req)

0 commit comments

Comments
 (0)