Skip to content

[bot] Add instrumentation for AWSSDK.BedrockAgentRuntime (Amazon Bedrock Agents execution) #72

Description

@braintrust-bot

Summary

The AWSSDK.BedrockAgentRuntime NuGet package (v4.0.10.2, ~1.6M total downloads, updated 2026-06-22) is the official AWS SDK for executing Amazon Bedrock Agents in .NET. It is entirely distinct from the already-filed AWSSDK.BedrockRuntime (foundation model invocation): BedrockAgentRuntime targets the agent-execution, flow-execution, and retrieval-augmented generation surfaces of Bedrock, not raw model calls. None of its execution surfaces are instrumented in this SDK.

Execution surfaces missing instrumentation

  • Agent invocation: AmazonBedrockAgentRuntimeClient.InvokeAgentAsync — execute a configured Bedrock Agent with a prompt; returns streaming chunks with optional trace data
  • Inline agent invocation: InvokeInlineAgentAsync — execute an agent with inline configuration (no pre-configured agent required)
  • Flow execution: InvokeFlowAsync / StartFlowExecutionAsync — invoke a Bedrock Flow and receive streaming node outputs
  • Retrieval-augmented generation: RetrieveAndGenerateAsync / RetrieveAndGenerateStreamAsync — query a knowledge base and generate a grounded response using a foundation model
  • Knowledge base retrieval: RetrieveAsync — query a Bedrock Knowledge Base and return relevant passages

Braintrust docs status

  • Status: not_found — The Braintrust Bedrock integration page covers TypeScript, Go, and Java instrumentation but has no .NET/C# SDK-level instrumentation for either BedrockRuntime or BedrockAgentRuntime
  • No AWSSDK.BedrockAgentRuntime-specific instrumentation is documented or referenced in Braintrust docs

Upstream sources

Local repo files inspected

  • src/Braintrust.Sdk.OpenAI/ — instruments OpenAI SDK only
  • src/Braintrust.Sdk.Anthropic/ — instruments Anthropic SDK only
  • src/Braintrust.Sdk.AgentFramework/ — instruments Microsoft.Extensions.AI.IChatClient middleware only
  • src/Braintrust.Sdk.AzureOpenAI/ — instruments Azure.AI.OpenAI only
  • Grep for BedrockAgentRuntime, InvokeAgent, and AmazonBedrockAgentRuntimeClient across the entire repo returned zero results

Relationship to existing issue #40

Issue #40 covers AWSSDK.BedrockRuntime (ConverseAsync, InvokeModelAsync). This issue covers the separate AWSSDK.BedrockAgentRuntime package, which uses a completely different client class (AmazonBedrockAgentRuntimeClient) and targets agent orchestration execution rather than direct foundation model invocation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions