AWS Strands Integration
Updated on Aug 14, 2026
Use this integration when your AWS Strands application is implemented in Python.
Setup
- Install SDK
bash
pip install progress-observability
- Instrument your app
python
Observability.instrument(
app_name=os.getenv("OBSERVABILITY_APP_NAME"),
api_key=os.getenv("OBSERVABILITY_API_KEY")
)
- Complete example
python
import os
from dotenv import load_dotenv
from strands import Agent, tool
from strands.models.openai import OpenAIModel
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")
)
model = OpenAIModel(
client_args={"api_key": os.getenv("OPENAI_API_KEY")},
model_id="gpt-4o-mini"
)
@tool
def get_weather(location: str) -> str:
"""Get the weather for a given location."""
return f"The weather in {location} is cloudy with a high of 15°C."
agent = Agent(
name="weather_agent_strands",
model=model,
tools=[get_weather],
system_prompt="You are a helpful AI assistant.",
callback_handler=None
)
result = agent("What's the weather in Paris?")
Observability.shutdown()
Avoiding duplicate spans
When using Observability.instrument() with AWS Strands and an OpenAI-compatible model, each model call may be captured twice — once by the Strands native tracing hooks (StrandsInstrumentor) and once by the lower-level OpenAI client patch (OpenAIInstrumentor). This doubles reported token usage and cost.
To fix it, block the redundant instrumentor:
python
from progress.observability.enums import ObservabilityInstruments
Observability.instrument(
app_name=os.getenv("OBSERVABILITY_APP_NAME"),
api_key=os.getenv("OBSERVABILITY_API_KEY"),
block_instruments={ObservabilityInstruments.OPENAI},
)