Skip to content

feat(bedrock): trace Amazon Bedrock Agents InvokeAgent, zero-code - #727

Merged
nik13 merged 5 commits into
devfrom
feat/ts-bedrock-agents-1119
Nov 19, 2026
Merged

nik13 merged 5 commits into
devfrom
feat/ts-bedrock-agents-1119

Conversation

@nik13

@nik13 nik13 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

What

@traceai/bedrock now traces Amazon Bedrock Agents (@aws-sdk/client-bedrock-agent-runtime), and @traceai/auto activates it zero-code when that SDK is installed.

  • InvokeAgentCommand / InvokeInlineAgentCommand produce one AGENT span (invoke_agent <agentId>/<aliasId>, or invoke_agent inline) with gen_ai.operation.name, gen_ai.agent.id and session.id, covering the streamed completion. It ends when the stream is consumed, errors or is abandoned (no leaked spans).
  • With enableTrace, trace events become child spans: model invocations as LLM spans (model, messages, usage), action groups and the code interpreter as TOOL spans execute_tool <name>, knowledge-base lookups as RETRIEVER spans, collaborators as AGENT spans, and failure traces as ERROR spans.
  • Prompts, answers, tool arguments and document text follow the hide settings. Tool arguments are recorded only in the masked input.value.
  • Errors get ERROR status with error.type and are rethrown unchanged.
  • bedrock-types.ts is type-only now, so an app that installs only the agent-runtime SDK can load the package. Both SDKs are optional peers.
  • Lockfile: only the new devDependency (@aws-sdk/client-bedrock-agent-runtime@3.1127.0, matching the locked client-bedrock-runtime) and its two importer entries; no other resolution changes.

Tests

Offline, with recorded event streams through an injected request handler: plain invoke, enableTrace with model/action-group/knowledge-base events, early stream exit, errors, hidden content (every span attribute checked for raw tool arguments), and zero-code activation through @traceai/auto.

@nik13
nik13 merged commit 1520c21 into dev Nov 19, 2026
139 checks passed
@nik13
nik13 deleted the feat/ts-bedrock-agents-1119 branch November 19, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant