Repository navigation
feat(reporting): opt-in reporting lake for execution history - #665
Open
mattdevdba wants to merge 1 commit into
Open
mattdevdba wants to merge 1 commit into
mattdevdba wants to merge 1 commit into
Conversation
Add an optional reporting lake, off by default behind reporting_enabled. When on, a Kinesis streaming destination on v2-executions feeds Firehose, a transform Lambda writes one JSON line per change to S3 (partitioned by record type and day), and a Glue table with partition projection plus Athena views turn the change log into documented tables: executions, stages, gates, approvals, steering, sensor runs, units and PRs, metrics, intent progress, a decision log and status history. Transcripts, agent sign-in bookkeeping, GSI keys and the prompt, starter email, credential and MCP fields on the execution header are left out. A resumable backfill Lambda copies existing rows into the lake, and Terraform applies the views through a Lambda invocation that reruns when a view file changes. The bucket honours deletion_protection. Refs aws-samples#664, aws-samples#417
mattdevdba
requested review from
JWThewes,
eipasteur,
jeromevdl,
leandrodamascena and
svozza
as code owners
October 30, 2026 20:27
This branch has not been 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.
Issue #, if available: #664 (RFC), towards #417
Description of changes:
Problem
DynamoDB keeps only the current state of each
v2-executionsrow, so the history behind team metrics (time in each status, gate wait, rewinds, attempts, throughput) is lost as soon as a row changes. #417 needs per-intent drill-down and metrics that can be recomputed when a definition changes. The EMF metrics in #570 are aggregated and have no history to recompute from.Solution
An optional reporting lake, off by default behind
reporting_enabled. This is PR 2 of the split proposed in #664: execution state only. The graph feed follows #621, and dashboards and permissions would be a separate proposal.v2-executions, with microsecond timestamps, feeds Firehose. A transform Lambda writes one JSON line per change to S3 underexecutions/record_type=<sort-key prefix>/dt=<yyyy-MM-dd>/. The destination is a separate resource, so the table definition doesn't change.OUTPUT#), agent sign-in bookkeeping, GSI keys, and on the execution header the prompt, starter email, credential binding and MCP server maps.SNAPSHOTchanges. The docs include the invoke loop.changestable with partition projection, so there's no crawler to run.executions,stages,gates,approvals,steering,sensor_runs,units,unit_prs,metrics,graph_reads,intent_progress,decision_log,execution_status_history,stage_state_history.terraform/modules/reporting/views/*.sqlthrough anaws_lambda_invocationof a small views Lambda, which reruns whenever a SQL file changes. This is my suggested answer to open question 4 in the RFC.reporting_alarm_actionsif set.deletion_protectionis off, because its history can't be rebuilt from the table.lambda/reporting: three entry points built separately.record-types.jsonis shared by the transform and the Glue partition projection.terraform/modules/reporting.terraform/reporting.tf: variables, the module withcount, and outputs.docs/using-the-platform/reporting.md(setup, data model, counting rules), plus short notes insetup.mdanddata-model.md.Testing
npx vitest run --project=reporting: 21 tests.v2-process-keys.jsbuilders, including the redactions.startKey.terraform/tests/reporting.tftest.hcl(mock providers), added to the Terraform workflow. It covers the streaming destination, shard and on-demand modes, deletion protection, the projection range (explicit and default), the record-type projection, and the views invocation input.terraform fmt -check -recursive,terraform validate -no-testswith the CI local-backend override,npm run lint,oxfmt --check,npm run dep:check(no new findings),secretlint,npm run sdk:check, anduv run zensical build.CREATE OR REPLACE VIEWhaven't been checked against a live account.Impact
None unless
reporting_enabledis set; no other code path changes. When it's set, the stack adds a Kinesis stream, a Firehose stream, three Lambdas, an S3 bucket, a Glue database and an Athena workgroup. The docs link to pricing for each.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.