Skip to content

Commit 2745264

Browse files
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-observability
1 parent bc384a8 commit 2745264

149 files changed

Lines changed: 1132 additions & 10046 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,4 +301,5 @@ plan/
301301
01-features/07-centralize-and-govern-your-ai-infrastructure/02-policy/test-results/
302302

303303
# Browser test report cards
304-
01-features/03-connect-your-agent-to-anything/02-browser/TEST_REPORT_CARD.md
304+
01-features/03-connect-your-agent-to-anything/02-browser/TEST_REPORT_CARD.md
305+
**/lambda_config.json
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

03-integrations/observability/arize/requirements.txt renamed to 03-integrations/3p-observability/arize/requirements.txt

File renamed without changes.

03-integrations/observability/arize/utils/travel_agent.py renamed to 03-integrations/3p-observability/arize/utils/travel_agent.py

File renamed without changes.

03-integrations/observability/braintrust/.env.example renamed to 03-integrations/3p-observability/braintrust/.env.example

File renamed without changes.

0 commit comments

Comments
 (0)