Skip to content

fix(aws-cloudwatchlogs): StartLiveTail event stream - #1715

Open
NitinKumar004 wants to merge 2 commits into
developmentfrom
fix/cloudwatchlogs-live-tail-1476
Open

NitinKumar004 wants to merge 2 commits into
developmentfrom
fix/cloudwatchlogs-live-tail-1476

Conversation

@NitinKumar004

@NitinKumar004 NitinKumar004 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Adds CloudWatch Logs StartLiveTail.

  • The provider keeps a registry of Live Tail sessions. PutLogEvents fans stored events out to them after the stream lock is released. The fan-out only appends to a per-session buffer and never blocks on a client.
  • Each session sends a sessionUpdate every second, including empty ones. An update carries at most 500 events, and when more matched it is sampled and sessionMetadata.sampled is set. A slow client gets up to 10 queued updates or 5000 events, and after that the oldest are dropped.
  • The request is validated per the API reference: 1 to 10 log group ARNs, no trailing *, logStreamNames and logStreamNamePrefixes mutually exclusive and only with one group, a 1024-character pattern parsed with the filterpattern package, and a limit of 15 concurrent sessions (LimitExceededException). An unknown group returns ResourceNotFoundException.
  • A session ends with SessionTimeoutException after 3 hours (liveTailSessionTimeout), measured on the options clock. Data protection masking applies, since events are masked at ingest.
  • Wire: the event stream is initial-response, then sessionStart, then sessionUpdate frames. Kinesis SubscribeToShard's frame writer moved to a shared server/wire/awseventstream package, and Kinesis now uses it too.
  • Dispatch uses X-Amz-Target, so the stream-logs. host from current SDKs works, and so does streaming-logs. from older SDKs and the AWS CLI.
  • Shutdown: a session ends when the client disconnects. serve also ends open streams when it shuts down, through a stream-shutdown base context (wire.StreamContext), so they no longer hold the graceful shutdown until its 10s timeout. statusWriter gets Unwrap so frames still flush with --log-requests.

Clients send StartLiveTail to a prefixed host: stream- from aws-sdk-go-v2 and streaming- from botocore. Against localhost, those names do not resolve. The usage note is in docs/coverage/nongoals/logging.md. It covers a wildcard-DNS host such as http://logs.localtest.me:4566 or an /etc/hosts entry for the CLI, inject_host_prefix=False for boto3, and smithyhttp.DisableEndpointHostPrefix in an API option for the Go SDK. Tests cover both prefixes and the Go SDK option.

Part of #1476

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