Skip to content

feat(request-trace): native S3 sink for request-trace records - #11806

Merged
nv-anants merged 4 commits into
ai-dynamo:mainfrom
YiqiuLiu:feat/s3-request-trace-sink
Jul 30, 2026
Merged

feat(request-trace): native S3 sink for request-trace records#11806
nv-anants merged 4 commits into
ai-dynamo:mainfrom
YiqiuLiu:feat/s3-request-trace-sink

Conversation

@YiqiuLiu

@YiqiuLiu YiqiuLiu commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a native S3 RequestTraceSink that writes existing dynamo.request.trace.v1 records directly to a bucket -- parallel to the OTLP sink, no schema change, no partitioning. Smallest reviewable unit for the S3 destination work in #11768.

  • New RequestTraceSinkKind::S3 variant with S3RequestTraceSink (lib/llm/src/request_trace/s3_sink.rs), gated behind the new request-trace-s3 cargo feature so the AWS SDK is opt-in.
  • Records are batched in-process as gzipped JSONL and each finished batch is uploaded via a single PutObject. Object keys use a simple time-based layout for this PR ({prefix}/{yyyy}/{mm}/{dd}/{host}-{HHMMSS}-{seq}.jsonl.gz).
  • Credentials come from the AWS SDK default provider chain -- env vars, IMDS, IRSA, Pod Identity, shared profiles. How the frontend pod is credentialed is a deployment concern and is not part of this PR.
  • New env vars: DYN_REQUEST_TRACE_S3_{BUCKET,REGION,PREFIX}; opt in via DYN_REQUEST_TRACE_SINKS=...,s3.

Scope split (per #11768)

This is PR 1 of 3:

  1. This PR -- functional S3 sink, same schema, no layout changes.
  2. Format/layout -- Hive-style model=/date=/hour= keys, tunable roll thresholds, Prometheus metrics.
  3. Deploy docs -- how to provide AWS credentials to the frontend pod (IRSA / Pod Identity / static). No operator or CRD code, per feat(request-trace): native S3 sink for request-trace records #11768 explicit non-goals.

Supersedes #10903, which was pinned to the pre-ai-dynamo/dynamo#11180 audit module.

Test plan

  • cargo fmt --check -p dynamo-llm
  • cargo-deny -L error --all-features check licenses bans (bans ok, licenses ok)
  • cargo metadata --locked --format-version 1
  • cargo doc --no-deps -- 0 warnings from new files
  • cargo test --locked --doc
  • cargo clippy --no-deps --all-targets -- -D warnings (default features)
  • cargo clippy --no-deps --all-targets --features request-trace-s3 -- -D warnings
  • cargo machete -- no unused deps
  • cargo test -p dynamo-llm --lib --features request-trace-s3 request_trace -- 66/66 pass, including 4 new s3_sink tests
  • MinIO integration test -- deferred; will add as a follow-up commit if reviewers want it in this PR

Non-goals (deferred to PRs 2/3 per #11768)

  • Rich object-key partitioning (model/day/hour).
  • Sampling.
  • New record schema fields.
  • Any operator/CRD/IAM changes.

Open in Devin Review

Summary by CodeRabbit

  • New Features
    • Added optional S3-backed request tracing.
    • Request traces are uploaded as compressed, batched JSONL files with organized time-based paths.
    • Added configuration for S3 bucket, region, and object prefix.
    • Added safeguards for buffering, shutdown, and upload failures.
  • Documentation
    • Documented the new S3 request-tracing configuration settings.

@YiqiuLiu
YiqiuLiu requested review from a team as code owners July 16, 2026 22:18
@copy-pr-bot

copy-pr-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@YiqiuLiu
YiqiuLiu temporarily deployed to external_collaborator July 16, 2026 22:18 — with GitHub Actions Inactive
@YiqiuLiu
YiqiuLiu temporarily deployed to external_collaborator July 16, 2026 22:18 — with GitHub Actions Inactive
@github-actions github-actions Bot added the feat label Jul 16, 2026
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot added the external-contribution Pull request is from an external contributor label Jul 16, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread lib/llm/src/request_trace/s3_sink.rs Outdated
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds an optional S3 request-trace sink with environment-based configuration, feature-gated AWS dependencies, asynchronous JSONL batching, gzip compression, S3 uploads, shutdown handling, and key-formatting tests.

Changes

S3 request-trace sink

Layer / File(s) Summary
S3 feature and configuration contracts
lib/llm/Cargo.toml, lib/llm/src/request_trace/config.rs, lib/runtime/src/config/environment_names.rs
Adds the optional S3 feature and AWS dependencies, S3 policy fields, environment variables, and s3 sink parsing.
S3 sink worker and object uploads
lib/llm/src/request_trace/s3_sink.rs
Adds bounded asynchronous delivery, JSONL batching, gzip compression, shutdown draining, UTC-partitioned S3 keys, uploads, and unit tests.
Feature-gated sink construction
lib/llm/src/request_trace/mod.rs, lib/llm/src/request_trace/sink.rs
Loads the S3 sink module conditionally and constructs the sink when the feature is enabled, otherwise returning an error.

Estimated code review effort: 4 (Complex) | ~45 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed, but it misses the required template sections for reviewer start and related issues. Add the required Overview, Details, Where should the reviewer start?, and Related Issues sections, including either a linked issue or the no-issue confirmation.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and clearly describes the main change: adding a native S3 request-trace sink.

Comment @coderabbitai help to get the list of available commands.

Comment thread lib/llm/src/request_trace/s3_sink.rs Outdated
Comment thread lib/llm/src/request_trace/s3_sink.rs Outdated
@YiqiuLiu
YiqiuLiu force-pushed the feat/s3-request-trace-sink branch from 9f67d5e to 94335ab Compare July 16, 2026 23:20
@YiqiuLiu
YiqiuLiu temporarily deployed to external_collaborator July 16, 2026 23:20 — with GitHub Actions Inactive
@datadog-official

datadog-official Bot commented Jul 16, 2026

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 39.89% (-9.13%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: fedc2da | Docs | Datadog PR Page | Give us feedback!

@YiqiuLiu
YiqiuLiu force-pushed the feat/s3-request-trace-sink branch from 94335ab to 03d2e23 Compare July 17, 2026 06:20
@YiqiuLiu
YiqiuLiu temporarily deployed to external_collaborator July 17, 2026 06:20 — with GitHub Actions Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/llm/src/request_trace/s3_sink.rs`:
- Around line 6-9: Update the module documentation describing S3 object keys to
match the implemented format `{host}-{HHMMSS}-{run_id}-{seq}.jsonl.gz`, while
preserving the existing prefix and date-partition layout.
- Around line 155-168: In the shutdown branch of the request-trace worker, close
the receiver before draining pending records, then consume records with recv()
until it returns None instead of using try_recv(). Preserve the existing
serialization warning and final upload_ready_batch behavior, ensuring emits
racing with shutdown cannot enqueue records after draining begins.

In `@lib/runtime/src/config/environment_names.rs`:
- Around line 549-559: Update the documentation for DYN_REQUEST_TRACE_SINKS to
include s3 in its supported sink values and mapping description, while
preserving the existing documented values and behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2b3ab66d-b65a-4749-8383-7aae911a3709

📥 Commits

Reviewing files that changed from the base of the PR and between 92ec76b and 03d2e23.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • lib/llm/Cargo.toml
  • lib/llm/src/request_trace/config.rs
  • lib/llm/src/request_trace/mod.rs
  • lib/llm/src/request_trace/s3_sink.rs
  • lib/llm/src/request_trace/sink.rs
  • lib/runtime/src/config/environment_names.rs

Comment thread lib/llm/src/request_trace/s3_sink.rs Outdated
Comment thread lib/llm/src/request_trace/s3_sink.rs
Comment thread lib/runtime/src/config/environment_names.rs
Comment thread lib/llm/Cargo.toml
Comment thread lib/llm/src/request_trace/s3_sink.rs
Comment thread lib/llm/src/request_trace/s3_sink.rs
Comment thread lib/llm/src/request_trace/s3_sink.rs Outdated
Comment thread lib/llm/src/request_trace/s3_sink.rs Outdated
Comment thread lib/runtime/src/config/environment_names.rs
@tmonty12

Copy link
Copy Markdown
Contributor

/ok to test f5738a0

@YiqiuLiu
YiqiuLiu force-pushed the feat/s3-request-trace-sink branch from f5738a0 to fe3d847 Compare July 21, 2026 20:58
@YiqiuLiu
YiqiuLiu requested a review from a team as a code owner July 21, 2026 20:58
@YiqiuLiu
YiqiuLiu temporarily deployed to external_collaborator July 21, 2026 20:58 — with GitHub Actions Inactive
@nnshah1

nnshah1 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

/ok to test c3a50dc

@YiqiuLiu
YiqiuLiu force-pushed the feat/s3-request-trace-sink branch from c3a50dc to 2daa3f1 Compare July 28, 2026 17:43
@YiqiuLiu
YiqiuLiu temporarily deployed to external_collaborator July 28, 2026 17:43 — with GitHub Actions Inactive
@dagil-nvidia

Copy link
Copy Markdown
Collaborator

/ok to test 2daa3f1

@dagil-nvidia
dagil-nvidia temporarily deployed to external_collaborator July 29, 2026 16:42 — with GitHub Actions Inactive
@dagil-nvidia

Copy link
Copy Markdown
Collaborator

/ok to test 380f0c0

@nv-anants
nv-anants temporarily deployed to external_collaborator July 29, 2026 18:15 — with GitHub Actions Inactive
@nv-anants

Copy link
Copy Markdown
Member

/ok to test ef0241e

Adds an S3 destination for `dynamo.request.trace.v1` records as a
new `RequestTraceSink` implementation, parallel to the existing
OTLP sink. Same record shape as every other sink -- new destination,
no schema change.

Records are batched in-process as gzipped JSONL and each finished
batch is uploaded via a single `PutObject`. Object keys use a simple
time-based layout for this PR (`{prefix}/{yyyy}/{mm}/{dd}/{host}-
{HHMMSS}-{seq}.jsonl.gz`); richer partitioning (model/day/hour Hive
style), tunable roll thresholds, and Prometheus metrics ship in a
follow-up.

Credentials come from the AWS SDK default provider chain -- env vars,
IMDS, IRSA, Pod Identity, and shared profiles are all handled by the
SDK. How the frontend pod is credentialed is a deployment concern
documented in a separate PR, not this sink's.

The `request-trace-s3` cargo feature is off by default so the AWS
SDK dependency is opt-in. When the feature is off, selecting
`DYN_REQUEST_TRACE_SINKS=...,s3` fails startup with a clear error.

Refs: ai-dynamo#11768 (supersedes ai-dynamo#10903).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Yiqiu Liu <yiqiuliu@amazon.com>
@YiqiuLiu
YiqiuLiu force-pushed the feat/s3-request-trace-sink branch from ef0241e to 9b417aa Compare July 29, 2026 18:46
@YiqiuLiu
YiqiuLiu temporarily deployed to external_collaborator July 29, 2026 18:46 — with GitHub Actions Inactive
@nv-anants

Copy link
Copy Markdown
Member

/ok to test 9b417aa

@nv-anants
nv-anants temporarily deployed to external_collaborator July 29, 2026 20:27 — with GitHub Actions Inactive
@nv-anants

Copy link
Copy Markdown
Member

/ok to test 34c5379

@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test 34c5379

@YiqiuLiu
YiqiuLiu temporarily deployed to external_collaborator July 30, 2026 04:39 — with GitHub Actions Inactive
@nealvaidya

Copy link
Copy Markdown
Contributor

/ok to test d4a7a9f

@nv-anants
nv-anants temporarily deployed to external_collaborator July 30, 2026 16:27 — with GitHub Actions Inactive
@nv-anants

Copy link
Copy Markdown
Member

/ok to test fedc2da

@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test fedc2da

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

container documentation Improvements or additions to documentation external-contribution Pull request is from an external contributor feat size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants