Skip to content

Commit c123f09

Browse files
committed
fix(telemetry): make strands agent invoke_agent span as INTERNAL spanKind
1 parent 26862e4 commit c123f09

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/strands/telemetry/tracer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def start_agent_span(
588588
attributes.update({k: v for k, v in kwargs.items() if isinstance(v, (str, int, float, bool))})
589589

590590
span = self._start_span(
591-
f"invoke_agent {agent_name}", attributes=attributes, span_kind=trace_api.SpanKind.CLIENT
591+
f"invoke_agent {agent_name}", attributes=attributes, span_kind=trace_api.SpanKind.INTERNAL
592592
)
593593
self._add_event_messages(span, messages)
594594

tests/strands/telemetry/test_tracer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ def test_start_agent_span(mock_tracer):
670670

671671
mock_tracer.start_span.assert_called_once()
672672
assert mock_tracer.start_span.call_args[1]["name"] == "invoke_agent WeatherAgent"
673+
assert mock_tracer.start_span.call_args[1]["kind"] == SpanKind.INTERNAL
673674
mock_span.set_attribute.assert_any_call("gen_ai.system", "strands-agents")
674675
mock_span.set_attribute.assert_any_call("gen_ai.agent.name", "WeatherAgent")
675676
mock_span.set_attribute.assert_any_call("gen_ai.request.model", model_id)

0 commit comments

Comments
 (0)