Skip to content

Python: [Bug]: HTTP call to MCP loses tracing parent #3623

@wdrone

Description

@wdrone

Description

When attempting to do distributed tracing with a ChatAgent and remote MCP server, the Httpx async client loses the appropriate parent span when transmitting to the MCP server. This causes the POST to have a higher-level parent span than the agent framework Execute Tool span. Note the POST to the "ping" tool in the following example trace.

Example Trace

Image

Code Sample

Simple working example

https://github.com/wdrone/agent_framework_distributed_tracing

Error Messages / Stack Traces

Package Versions

agent-framework 1.0.0b260123

Python Version

3.13

Additional Context

No response

Metadata

Metadata

Labels

bugSomething isn't workingobservabilityIssues related to observability or telemetrypython

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions