Repository navigation
Conversation
Add opt-in write audit logging to ingest_dataframe and IngestionManagerPandas so each ingested record can be traced to the AWS request ID of the PutRecord or BatchWriteRecord attempt that carried it. - New sagemaker.mlops.feature_store.write_audit module: registers handlers for documented botocore events (provide-client-params, before-send, needs-retry) on the featurestore-runtime client cached by sagemaker-core, and logs one JSON line per record per HTTP attempt (record identifier, event time, request ID, status, per-entry outcome, timestamps) on the sagemaker.mlops.feature_store.write_audit logger. No other feature values are logged. - ingest_dataframe(enable_write_audit=...) derives the record identifier and event time names from the Feature Group; SAGEMAKER_FEATURE_STORE_WRITE_AUDIT enables it without code changes. Off by default. - IngestionManagerPandas(write_audit_config=...) sets up auditing in the single-process path and in each worker process. - Existing ingestion failure logs now include the request ID when available. - Telemetry: IngestionManagerPandas.run reports whether write audit is configured. - Docs, unit tests and an integration test.
grraman
had a problem deploying
to
manual-approval
November 10, 2026 21:59 — with
GitHub Actions
Error
grraman
had a problem deploying
to
manual-approval
November 10, 2026 22:00 — with
GitHub Actions
Error
grraman
had a problem deploying
to
manual-approval
November 10, 2026 22:00 — with
GitHub Actions
Error
…dit tests Address the CodeQL HTTP Response Splitting alert on the loopback fake Feature Store server. The x-amzn-RequestId header now holds only a server-generated UUID; the mapping to each request's first record is kept server-side for the tests to check.
grraman
requested a deployment
to
manual-approval
November 10, 2026 22:52 — with
GitHub Actions
Waiting
grraman
requested a deployment
to
manual-approval
November 10, 2026 22:52 — with
GitHub Actions
Waiting
grraman
requested a deployment
to
manual-approval
November 10, 2026 22:52 — with
GitHub Actions
Waiting
This branch is waiting to be deployed
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.
feature: per-record request ID logging for Feature Store ingestion
Issue
Customers who ingest with
ingest_dataframe/IngestionManagerPandascan't tell which AWS request wrote a given record. When a record shows up in the online store but not the offline store, Feature Store support needs the PutRecord or BatchWriteRecord request ID to investigate. Today the SDK throws the response away (FeatureGroup.put_recordreturnsNone,BatchWriteRecordResponsedropsResponseMetadata), and the ingestion error logs only show the exception text.Description of changes
This adds opt-in write audit logging, off by default. When it's on, each record of each PutRecord or BatchWriteRecord HTTP attempt gets one JSON line on the
sagemaker.mlops.feature_store.write_auditlogger at INFO level. Each line holds the record identifier, event time, AWS request ID, HTTP status, the per-entry outcome and client-side timestamps. Retried attempts each get their own line with their own request ID.ingest_dataframe(..., enable_write_audit=None)None, theSAGEMAKER_FEATURE_STORE_WRITE_AUDITenvironment variable decides.IngestionManagerPandas(write_audit_config=None)WriteAuditConfigsagemaker.mlops.feature_store.write_audit.pysagemaker-featurestore-runtimeclient that sagemaker-core caches, using only the documented botocore eventsprovide-client-params,before-sendandneeds-retry. The handlers always returnNoneand never raise._ingest_rowand the BatchWriteRecord failure path add the request ID when the error carries one. This is on for everyone.IngestionManagerPandas.runreportsx-hasWriteAuditConfig.docs/ml_ops/index.rst.Only the record identifier and event time are logged, no other feature values. The docs note that record identifiers can be sensitive.
BatchWriteRecord
ErrorsandUnprocessedEntriesare matched back to entries by their full record content. If a reported failure matches no entry, entries that would otherwise beacceptedare logged asunknown, so a failed record is never reported as accepted.Usage:
Known limits, all documented:
timeoutaren't audited.Backwards compatibility
All changes are additive. New arguments are added at the end of
ingest_dataframeandIngestionManagerPandas, and the existing signature test asserts the full parameter order. With the feature off there are no extra clients, no handler registration and no import-time side effects. The only change on default paths is the request ID suffix on existing error log lines.Testing done
test_write_audit.py,test_ingestion_manager_pandas.pyandtest_feature_utils.py. All 458 Feature Store unit tests pass. The new tests include end-to-end runs of the realIngestionManagerPandasand botocore against a loopback fake endpoint, covering PutRecord, BatchWriteRecord with a retried 500, partialErrors/UnprocessedEntries, and threaded and multi-process ingestion. They check that every record maps to the request that carried it.AWS_MAX_ATTEMPTS=1 AWS_RETRY_MODE=legacy AWS_PROFILE=nope.test_write_audit.pypassed 5 runs in a row.write_audit.pyhas 100% line coverage.tests/integ/test_feature_store_write_audit.pycollects but has not been run against AWS. It needs CI.fork. Multi-process ingestion already fails under spawn because thePoolinitializer is a nested function. That's a separate fix.Merge Checklist
docs/ml_ops/index.rst)By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.