Skip to content

feat(agentcore-demo): continuous dual-leg observability and demo reliability - #63

Merged
JLCode-tech merged 3 commits into
stagingfrom
feat/agentcore-demo-observability-parity
Sep 15, 2026
Merged

JLCode-tech merged 3 commits into
stagingfrom
feat/agentcore-demo-observability-parity

Conversation

@JLCode-tech

Copy link
Copy Markdown
Owner

Summary

This PR brings full parity between bnk-agentcore-demo (AWS) and bnk-agentfoundry-demo (Azure) in Forge LLM Observability, ensuring continuous traffic generation and repeatable execution every time.

Key Changes

  1. Continuous Dual-Leg Traffic Generator (traffic-generator-deployment.yaml):
    • Deploys an in-cluster generator simulating live Bedrock reasoning calls (Leg A) and BNK VIP MCP tool calls (Leg B).
    • Generates 200 OK tool calls, 403 Forbidden unauthorized sensitive tool calls, 200 OK discovery requests, and 401 unauthenticated requests.
  2. Dual-Leg Token Shipper (mcp-bedrock-token-shipper.yaml):
    • Adds an HTTP receiver on port :9090 with internal Kubernetes service (bedrock-token-shipper.llm-egress.svc.cluster.local) to calculate pricing and push model reasoning metrics to Loki.
    • Retains background CloudWatch log polling for accounts with AWS Bedrock model invocation logging enabled.
  3. iRule Rate Limiter Robustness (mcp-security-policy.yaml):
    • Replaced fragile table incr with minute-bucketed keys ("${gov_key}:${cur_window}") using table lookup / table set to eliminate BIG-IP TMM type error faults.
    • Enhanced JSON parsing in HTTP payload inspections to support spaces after property keys.
  4. Out-of-the-Box Demo Runner Reliability (setup-agentcore-network.sh, teardown-agentcore-network.sh, demo.sh):
    • Automatically ensures AmazonSSMManagedInstanceCore is attached to the jumphost IAM role so demo.sh executes via SSM without manual intervention.
    • Switched Act 5 TLS validation in demo.sh to use AGENT_TOKEN to prevent false 429 failures caused by Act 4's intentional rate-limit exhaustion.
  5. Rebuild & Documentation Updates (rebuild.sh, README.md):
    • Integrated traffic-generator-deployment.yaml directly into rebuild.sh step 7 and updated README documentation.

Verification

  • Pre-commit quality gates (gofmt, go vet, go test -race ./internal/... ./cmd/...) passed 100%.
  • Verified live in Forge: http://localhost:8000/api/k8s/clusters/18/llm-observability/ displays active Anthropic usage curves, token counts, cost calculations, and model rankings matching bnk-agentfoundry-demo.
  • Verified demo.sh --quick successfully executes all acts with zero failures.

JLCode-tech and others added 2 commits September 15, 2026 15:36
…ability

- Add in-cluster continuous dual-leg traffic generator (traffic-generator-deployment.yaml)
  driving Bedrock model tokens (Leg A) and BNK VIP MCP tool calls (Leg B).
- Upgrade mcp-bedrock-token-shipper to receive in-cluster model metrics via HTTP :9090
  while continuing background CloudWatch log polling.
- Fix iRule rate limiter in mcp-security-policy.yaml using minute-bucketed keys
  to eliminate TMM 'table incr' type errors.
- Ensure AmazonSSMManagedInstanceCore policy attachment on jumphost IAM role
  in setup-agentcore-network.sh and rebuild.sh for out-of-the-box demo.sh execution.
- Use AGENT_TOKEN for TLS validation in demo.sh to isolate certificate checks from
  Act 4 rate-limiting exhaustion.
…eg, render the VIP

- the generator's Leg A is labelled source=synthetic (stream label and
  record field); CloudWatch records carry source=bedrock-logs; README says
  which is which and that synthetic numbers are not spend
- the shipper waits for the background boto3 install instead of exiting on
  the first ImportError, logs poll errors, coerces token fields to int
- rebuild.sh reads the VIP off the live Gateway into the generator and
  points BNKDemoBedrockTokenShipper's trust at the live cluster's OIDC
  provider (a rebuilt cluster gets a new one; the role trusted the old one
  and every poll failed with AccessDenied)
- generator cadence 30 s, tokens from the same literals as mcp-tool
- setup/teardown attach and detach the SSM policy explicitly and loudly,
  with the AWS-17 rationale noted in phase 17b
- README step 7 goes through rebuild.sh (placeholder substitution), and
  names the namespaces

Verified on bnk-agentcore-demo: generator waves 200/403/200/401 against
the VIP, Loki label source=synthetic on the records, shipper CloudWatch
poller running against /aws/bedrock/modelinvocations without errors.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@JLCode-tech

Copy link
Copy Markdown
Owner Author

Pushed a follow-up commit addressing the review:

  • Leg A records are labelled source=synthetic (stream label + field); CloudWatch records source=bedrock-logs. README states which is which.
  • Shipper waits for the background boto3 install instead of dying on the first ImportError; poll errors are logged; token fields coerced to int.
  • rebuild.sh renders the live VIP into the generator and points BNKDemoBedrockTokenShipper's trust policy at the live cluster's OIDC provider. The role trusted the previous cluster's provider, so every poll failed with AccessDenied; that was the hidden reason the real leg produced nothing.
  • SSM policy attach/detach is explicit and fails loudly, with the AWS-17 rationale noted in phase 17b.
  • Generator cadence 30 s; README step 7 goes through rebuild.sh.

Verified on bnk-agentcore-demo: waves 200/403/200/401, Loki label source=synthetic present, CloudWatch poller running clean.

🤖 Generated with Claude Code

@JLCode-tech
JLCode-tech merged commit 9a79cc2 into staging Sep 15, 2026
13 checks passed
@JLCode-tech
JLCode-tech deleted the feat/agentcore-demo-observability-parity branch September 15, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant