How aws-samples/sample-amazon-cloudwatch-generative-ai-observability works
This repository is a set of deployable weather-agent samples, not a shared application: users can run the agent on EC2, ECS, EKS, or Bedrock AgentCore. Each agent uses Strands with a Bedrock model and National Weather Service HTTP tools; OpenTelemetry instrumentation sends telemetry to CloudWatch. The EC2 custom-span sample adds location extraction and application-level spans. Deployment templates and the EKS chart represent the host-specific infrastructure. Links between unsampled deployment resources and applications reflect README documentation; no shared runtime pipeline is implied.
Main entry points: app-customspan.py Custom Span Agent · app/app.py ECS Weather Agent · app/app.py EKS Weather Agent · app/app.py EC2 Weather Agent
Components 15
AgentCore Sample
- Runtime Invoker
bedrock-agentcore-observability/invoke.py - AgentCore Runtime
- Weather Agent
bedrock-agentcore-observability/agent.py
Container Samples
- ECS Weather Agent
ecs-genAI-observability/docker/app/app.py - ECS Infrastructure
ecs-genAI-observability/cloudformation/weather-agent-ecs.yaml - EKS Weather Agent
eks-genAI-observability/docker/app/app.py - EKS Helm Chart
eks-genAI-observability/chart
EC2 Samples
- EC2 Weather Agent
ec2-genAI-observability/app/app.py - Custom Span Agent
ec2-genAI-observability/app/app-customspan.py - EC2 Infrastructure
ec2-genAI-observability/cloudformation/weather-agent-ec2.yaml
Observability
- Amazon Bedrock
- Weather API
- ADOT Instrumentation
- CloudWatch
Other components
- User
Connections 27
- User → Runtime Invoker: submits prompt
bedrock-agentcore-observability/invoke.py - Runtime Invoker → AgentCore Runtime: invokes runtime
bedrock-agentcore-observability/invoke.py - AgentCore Runtime → Weather Agent: dispatches to
README.md - User → ECS Weather Agent: asks weather
ecs-genAI-observability/docker/app/app.py - User → EKS Weather Agent: asks weather
eks-genAI-observability/docker/app/app.py - User → EC2 Weather Agent: asks weather
ec2-genAI-observability/app/app.py - User → Custom Span Agent: asks weather
ec2-genAI-observability/app/app-customspan.py - Weather Agent → Amazon Bedrock: infers with
bedrock-agentcore-observability/agent.py - Weather Agent → Weather API: requests forecasts
bedrock-agentcore-observability/agent.py - ECS Weather Agent → Amazon Bedrock: infers with
ecs-genAI-observability/docker/app/app.py - ECS Weather Agent → Weather API: requests forecasts
ecs-genAI-observability/docker/app/app.py - EKS Weather Agent → Amazon Bedrock: infers with
eks-genAI-observability/docker/app/app.py - EKS Weather Agent → Weather API: requests forecasts
eks-genAI-observability/docker/app/app.py - EC2 Weather Agent → Amazon Bedrock: infers with
ec2-genAI-observability/app/app.py - EC2 Weather Agent → Weather API: requests forecasts
ec2-genAI-observability/app/app.py - Custom Span Agent → Amazon Bedrock: infers with
ec2-genAI-observability/app/app-customspan.py - Custom Span Agent → Weather API: requests forecasts
ec2-genAI-observability/app/app-customspan.py - Custom Span Agent → Custom Span Agent: creates spans
ec2-genAI-observability/app/app-customspan.py - ECS Infrastructure → ECS Weather Agent: deploys
README.md - EKS Helm Chart → EKS Weather Agent: deploys
README.md - EC2 Infrastructure → EC2 Weather Agent: deploys
README.md - Weather Agent → ADOT Instrumentation: emits telemetry
README.md - ECS Weather Agent → ADOT Instrumentation: emits telemetry
README.md - EKS Weather Agent → ADOT Instrumentation: emits telemetry
README.md - EC2 Weather Agent → ADOT Instrumentation: emits telemetry
README.md - Custom Span Agent → ADOT Instrumentation: emits telemetry
README.md - ADOT Instrumentation → CloudWatch: exports telemetry
README.md