Amazon Bedrock Integration

Updated on Aug 14, 2026

Use this integration when your app is implemented in Python or TypeScript.

Setup

  1. Install SDK
bash
pip install progress-observability
  1. Instrument your app
python
Observability.instrument(
    app_name=os.getenv("OBSERVABILITY_APP_NAME"),
    api_key=os.getenv("OBSERVABILITY_API_KEY")
)
  1. Complete example
python
import os

from dotenv import load_dotenv

import boto3
from progress.observability import Observability

load_dotenv()

# LLM INSTRUMENTATION
Observability.instrument(
    app_name=os.getenv("OBSERVABILITY_APP_NAME"),
    api_key=os.getenv("OBSERVABILITY_API_KEY"),
)


def main() -> None:
    bedrock_model = os.getenv("BEDROCK_MODEL", "us.anthropic.claude-sonnet-4-5-20250929-v1:0")
    aws_region = os.getenv("AWS_REGION", "us-east-1")

    client = boto3.client("bedrock-runtime", region_name=aws_region)

    question = os.getenv("QUESTION", "What is the capital of Bulgaria?")

    response = client.converse(
        modelId=bedrock_model,
        messages=[{"role": "user", "content": [{"text": question}]}],
        system=[{"text": "You are a helpful assistant."}],
        inferenceConfig={"temperature": 0.0, "maxTokens": 64},
    )



try:
    main()
finally:
    Observability.shutdown()

To get a richer trace tree when building agents on top of this provider, use the @agent, @tool, @workflow, or @task decorators. See the Python SDK for details.

  1. Install SDK
bash
npm install @progress/observability
  1. Instrument your app
TS
import '@progress/observability/register/hooks';
import { Observability } from '@progress/observability';
await Observability.instrument({
 appName: process.env.OBSERVABILITY_APP_NAME,
 apiKey: process.env.OBSERVABILITY_API_KEY
});
  1. Complete example
TS
import '@progress/observability/register/hooks';
import 'dotenv/config';

import {
 BedrockRuntimeClient,
 ConverseCommand,
 type ConverseCommandInput,
} from '@aws-sdk/client-bedrock-runtime';
import { Observability } from '@progress/observability';

async function main() {
 await Observability.instrument({
  appName: 'Amazon Bedrock TypeScript',
  apiKey: process.env.OBSERVABILITY_API_KEY!,
 });

 try {
  const client = new BedrockRuntimeClient({
   region: process.env.AWS_REGION ?? 'us-east-1',
  });

  const input: ConverseCommandInput = {
   modelId: 'anthropic.claude-3-haiku-20240307-v1:0',
   messages: [
    {
     role: 'user',
     content: [{ text: "What's the weather like in Paris today?" }],
    },
   ],
   inferenceConfig: { maxTokens: 256 },
  };

  const response = await client.send(new ConverseCommand(input));
  const text = response.output?.message?.content?.find(b => b.text !== undefined)?.text ?? '';
 } finally {
  await Observability.shutdown();
 }
}

main().catch(e => { console.error(e); process.exitCode = 1; });

To get a richer trace tree when building agents on top of this provider, use the @agent, @tool, @workflow, or @task decorators. See the TypeScript SDK for details.

In this article
Setup
Not finding the help you need?
Contact Support