Repository navigation
Conversation
AgentCore creates /aws/bedrock-agentcore/runtimes/<id>-DEFAULT when a runtime is created, with no retention. Nothing in the repo set one, so the group kept everything forever. That includes the headless kernel's 'invoke session=... prompt=...' line, which records the first 80 characters of every user prompt, and, with agent_observability on, the otel-rt-logs event records that carry full prompt and answer text. Terraform cannot own the group because it exists as soon as the runtime does. Following platform_version.tf, a terraform_data with local-exec runs aws logs put-retention-policy for every runtime (interactive and sdk per platform version, plus mcp-tools). The trigger is (runtime id, days). The new variable runtime_log_retention_days defaults to 30, is validated against the CloudWatch Logs values, and 0 leaves the groups unmanaged. deploy-cli does the same with RUNTIME_LOG_RETENTION_DAYS. The kernel now logs only the prompt length. The user guide described span-level traces as "per model turn". observability.md already states there are no per-turn LLM spans, so the guide now says one span per invocation plus one per tool call. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 10, 2026
Contributor
|
Thanks! This change is included in #66 (published together with the related platform fixes). This repository is now updated by snapshot PRs only, so closing this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
/aws/bedrock-agentcore/runtimes/<runtime-id>-DEFAULTat the moment the runtime is created, with no retention, and nothing in the repo set one. On a live deployment every runtime's group showsretentionInDays: none. That includes groups of runtimes that were destroyed long ago.invoke session=%s prompt=%.80r(runtimes/agent-sdk-kernel/src/main.py), so the first 80 characters of every prompt land there.agent_observabilityon, the same group also receives theotel-rt-logsevent records with full prompt and answer text (docs/observability.md).logs:GetLogEventson the account can read all of it, indefinitely.docs/user-guide.mddescribes span-level traces as "per tool call, per model turn".docs/observability.mdcorrectly says there are no per-turn LLM spans.Change
terraform/modules/runtime/log_retention.tf.platform_version.tfpattern, aterraform_datawithlocal-execrunsaws logs put-retention-policyfor every runtime: interactive and sdk per platform version, plus mcp-tools.runtime_log_retention_days, default 30. It is validated against CloudWatch Logs' allowed values, and0leaves the groups as created. It is also added toterraform.tfvars.example.30-runtime.shsets the same policy, controlled byRUNTIME_LOG_RETENTION_DAYS, default 30.prompt_chars=<n>instead of the prompt text.observability.mdnotes the retention setting and that the group holds full prompt and answer text when trace delivery is on.There are no new IAM permissions. The AWS CLI is already a stated Terraform prerequisite, and
local-execalready depends on it.Not changed
aws/spans. Its retention is not set here. That group belongs to the account-level Transaction Search setup, which the repo asks operators to enable themselves.docs/observability.mdsays kernel stdout lines carrytrace_id=… span_id=…. The kernel's own format string does not include them, but OTel log correlation in the-otelimage may add them. I could not verify that without running the observability image, so that sentence is left as is.Test plan
terraform fmt -check -recursivepasses, andterraform validatepasses with the new resource and variable.bash -npasses on30-runtime.sh.put-retention-policycommand shape against a non-existent group. It gotResourceNotFoundException, which shows the arguments parse and reach the service, with no side effects on real groups.This came out of an inventory of DynamoDB and CloudWatch usage done for the #44 review. It is independent of #44.
🤖 Generated with Claude Code