Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/strands/telemetry/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def start_model_invoke_span(
# Add additional kwargs as attributes
attributes.update({k: v for k, v in kwargs.items() if isinstance(v, (str, int, float, bool))})

span = self._start_span("Model invoke", parent_span, attributes, span_kind=trace_api.SpanKind.CLIENT)
span = self._start_span("chat", parent_span, attributes, span_kind=trace_api.SpanKind.CLIENT)
for message in messages:
self._add_event(
span,
Expand Down Expand Up @@ -371,7 +371,7 @@ def start_event_loop_cycle_span(
# Add additional kwargs as attributes
attributes.update({k: v for k, v in kwargs.items() if isinstance(v, (str, int, float, bool))})

span_name = f"Cycle {event_loop_cycle_id}"
span_name = "execute_event_loop_cycle"
span = self._start_span(span_name, parent_span, attributes)
for message in messages or []:
self._add_event(
Expand Down
4 changes: 2 additions & 2 deletions tests/strands/telemetry/test_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_start_model_invoke_span(mock_tracer):
span = tracer.start_model_invoke_span(messages=messages, agent_name="TestAgent", model_id=model_id)

mock_tracer.start_span.assert_called_once()
assert mock_tracer.start_span.call_args[1]["name"] == "Model invoke"
assert mock_tracer.start_span.call_args[1]["name"] == "chat"
assert mock_tracer.start_span.call_args[1]["kind"] == SpanKind.CLIENT
mock_span.set_attribute.assert_any_call("gen_ai.system", "strands-agents")
mock_span.set_attribute.assert_any_call("gen_ai.operation.name", "chat")
Expand Down Expand Up @@ -240,7 +240,7 @@ def test_start_event_loop_cycle_span(mock_tracer):
span = tracer.start_event_loop_cycle_span(event_loop_kwargs, messages=messages)

mock_tracer.start_span.assert_called_once()
assert mock_tracer.start_span.call_args[1]["name"] == "Cycle cycle-123"
assert mock_tracer.start_span.call_args[1]["name"] == "execute_event_loop_cycle"
mock_span.set_attribute.assert_any_call("event_loop.cycle_id", "cycle-123")
mock_span.add_event.assert_any_call(
"gen_ai.user.message", attributes={"content": json.dumps([{"text": "Hello"}])}
Expand Down
Loading