Commit 2745264
authored
Restructure obsy samples (#1654)
* restructure: move agentic-sales-analyst to agents-on-ecs; add agent-in-lambda sample
- Move observability-fullstack-examples/agentic-sales-analyst → agents-on-ecs/agentic-sales-analyst (git rename preserves history)
- Restructure agents-on-aws-lambda into two subfolders:
- 01-lambda-invokes-runtime/: existing Lambda→AgentCore runtime pattern
- 02-agent-in-lambda/: new pattern — Strands agent wrapped inside Lambda with ADOT observability
- New 02-agent-in-lambda sample includes:
- lambda_agent.py: Strands Agent handler
- requirements.txt: strands-agents + aws-opentelemetry-distro
- build.sh: SAM container build producing Lambda-compatible ZIP
- images/: console screenshots for X-Ray, ADOT layer, env vars, permissions
- README.md: step-by-step setup guide with console screenshots, env var table, IAM policy,
and explanation of the Lambda-suppresses-spans problem with requirements for the
Lambda-invokes-runtime pattern
- Add top-level agents-on-aws-lambda/README.md comparing both patterns
* fix 02-agent-in-lambda: use ADOT managed layer instead of bundling OTel via pip
- requirements.txt: remove aws-opentelemetry-distro; only strands-agents needed
- build.sh: remove opentelemetry-instrument copy step; ZIP contains only strands-agents
- lambda_agent.py: update docstring to reflect layer-based setup; clean up logging
- README.md: rewrite setup steps for managed layer approach:
- add ADOT layer ARN table for all major regions (account 901920570463)
- AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-instrument (layer path, not /var/task/)
- AGENT_OBSERVABILITY_ENABLED=true for Strands Gen AI spans
- Option A (manual ARN) and Option B (Application Signals console toggle)
- retain console screenshots, IAM policy, test CLI invocation, trace viewing steps
- retain Lambda-invokes-runtime span-suppression pattern explanation
* fix(02-agent-in-lambda): ADOT OTel version fix, add CW span exporter, and evaluation pipeline
- Add aws-opentelemetry-distro to requirements.txt so the bundled OTel
packages are compatible with the ADOT layer's startup code (fixes
ImportError: cannot import name 'LogData' from opentelemetry.sdk._logs)
- Add _CWJsonSpanExporter to lambda_agent.py: writes each OTel span as a
compact single-line JSON to stdout to the Lambda CloudWatch log group,
enabling AgentCore batch evaluation to read Gen AI sessions without a
separate /aws/spans sink
- Add deploy.py, invoke.py, evaluate.py, cleanup.py scripts
- evaluate.py: starts Builtin.GoalSuccessRate batch evaluation using the
Lambda log group as the cloudWatchLogs data source
- Gitignore lambda_config.json (runtime artifact)
Tested end-to-end: 5 Lambda invocations then evaluation COMPLETED
* style: fix ruff lint errors in 02-agent-in-lambda (unused imports, f-string without placeholders)
* remove: delete 03-integrations/observability/simple-dual-observability
* style: ruff format agents-on-aws-lambda Python files
* restructure: rename 03-integrations/observability → 3p-observability
* remove: delete 3p-observability/simple-dual-observability1 parent bc384a8 commit 2745264
149 files changed
Lines changed: 1132 additions & 10046 deletions
File tree
- 03-integrations
- 3p-observability
- arize
- utils
- braintrust
- utils
- datadog
- utils
- dynatrace
- honeycomb
- utils
- instana
- utils
- langfuse
- images
- utils
- openlit
- utils
- agents-hosted-outside-runtime
- agents-on-aws-lambda
- 01-lambda-invokes-runtime
- utils
- 02-agent-in-lambda
- images
- agents-on-ecs/agentic-sales-analyst
- client
- public
- src
- deployment
- common
- ecs
- observability/simple-dual-observability
- agent
- docs
- img
- scenarios
- scripts
- tests
- tools
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
| 305 | + | |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
0 commit comments