[bug] OpenInference spans exported to Dynatrace lack meaningful agent collaborator names in agentcollaborator spans when my Bedrock agent acts as a routing supervisor.
Describe the bug OpenInference spans exported to Dynatrace lack meaningful agent collaborator names in agentcollaborator spans when my Bedrock agent is configured as a supervisor with routing.
To Reproduce
Configure your Bedrock agent as a supervisor with routing enabled to direct queries to one or more collaborator agents based on context or criteria.
Expected behavior
When bedrock agent is configured as a supervisor, agentcollaborator spans have meaningful names that appear to be sourced from the agentCollaboratorName in the trace:
"trace": {
"orchestrationTrace": {
"observation": {
"agentCollaboratorInvocationOutput": {
"agentCollaboratorAliasArn": "arn:aws:somearn",
"agentCollaboratorName": "some_meaningful_name",
}
}
}
}
When routing is enabled, there is an additional level (routingClassifierTrace) in the json that appears to not be accounted for:
{ "trace": { "routingClassifierTrace": { "observation": { "agentCollaboratorInvocationOutput":
{
"agentCollaboratorAliasArn": "arn:aws:somearn",
"agentCollaboratorName": "some_meaningful_name"
}
}
}
}
}
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Version [e.g. 22]
Additional context Planning to submit a PR to account for both the trace;routingClassifierTrace and the trace;orchestrationTrace hierarchy
Hi @BillyMalone1979! I'm Dosu and I’m helping the openinference team.
Your analysis is correct: the current OpenInference Bedrock instrumentation extracts agent collaborator names from orchestrationTrace, but does not fully account for routingClassifierTrace, which wraps the same observation node one level deeper. This gap explains why agentcollaborator spans lack meaningful names when routing is enabled. The code structure suggests it could be generalized to support both hierarchies, and your plan to submit a PR to handle both is aligned with what's needed. There is also an open PR for JS Bedrock agent instrumentation that may touch related areas, but it does not address this specific routing trace issue yet (see PR).
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
HI @BillyMalone1979! Thanks for reaching out. We've got some immediate plans to clean up the bedrock instrumentations. The typescript one does have support for the routingClassiferTrace, but I assume you're using the python on. Will keep you posted on this. Thanks again and sorry for the inconvenience!