10000 [BUG] stream_async does not initialize the parent span in opentelemetry · Issue #118 · strands-agents/sdk-python · GitHub
[go: up one dir, main page]

Skip to content

[BUG] stream_async does not initialize the parent span in opentelemetry #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
jros2300 opened this issue May 26, 2025 · 2 comments
Closed
3 tasks done
Assignees
Labels
bug Something isn't working

Comments

@jros2300
Copy link

Checks

  • I have updated to the lastest minor and patch version of Strands
  • I have checked the documentation and this is not expected behavior
  • I have searched ./issues and there are no duplicates of my issue

Strands Version

0.1.4

Python Version

3.13.1

Operating System

macOS 15.5

Installation Method

pip

Steps to Reproduce

  1. Install Strands using pip
  2. Run an agent call using stream_async, and configure the opentelemetry (to the console or a collector)
  3. Review the spans. The Cycle spans does not have a parent "Strands Agent" span

Expected Behavior

Create a "Strands Agent" Span

Image

Actual Behavior

The parent span is not created

Image

Additional Context

No response

Possible Solution

Initialize the self.tracer in the stream_async method of the Agent class, as it is initialized in the call method.
I'd add this peace of code to the stream_async method:
self.trace_span = self.tracer.start_agent_span( prompt=prompt, model_id=model_id, tools=self.tool_names, system_prompt=self.system_prompt, custom_trace_attributes=self.trace_attributes, )

Related Issues

No response

@jros2300 jros2300 added the bug Something isn't working label May 26, 2025
@awsarron awsarron self-assigned this May 26, 2025
@awsarron awsarron mentioned this issue May 26, 2025
< 9B59 span class="text-normal no-wrap mr-1 ml-1" data-target="tracked-issues-progress.label">4 tasks
@awsarron
Copy link
Member

Hi @jros2300, thank you for reporting this issue.

I just published #119 that should resolve this in the next SDK version release.

@awsarron
Copy link
Member

The fix for this was released in v0.1.5 of the SDK. Thank you again for the report @jros2300!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
0