Repository navigation
fix(telemetry): store Athena times as timestamp, normalize MCP bounds - #1070
Merged
Merged
Conversation
Athena compared the time columns as text, so a filter left out records from the same second. The Glue table and the Athena DDL now declare the time columns as timestamp, and the schema prompt tells queries to use TIMESTAMP literals. The MCP list_executions tool rewrites since and until to the stored UTC format, and uses a TIMESTAMP literal on Athena. The exporter README states the timestamp format.
ParidelPooya
temporarily deployed
to
ai-pr-review-runtime
October 23, 2026 19:48 — with
GitHub Actions
Inactive
ParidelPooya
temporarily deployed
to
ai-pr-review-runtime
October 23, 2026 19:49 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
Date.parse rolls an impossible date forward, so 2026-02-30 queried March 2. The day, hour, minute and second are now checked first. A bound with sub-millisecond digits is rounded up for since and down for until, so the bound selects the same records as before the rewrite.
ParidelPooya
temporarily deployed
to
ai-pr-review-runtime
October 23, 2026 20:32 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
Typed time columns compare instants, and an existing Aurora or Redshift table can hold values finer than a millisecond. Rounding a bound there changed which rows it selected. Bounds now keep the caller's digits for Athena, Aurora, Redshift and OpenSearch, and get the stored millisecond width only where the comparison is on text (DynamoDB, Logs Insights).
ParidelPooya
temporarily deployed
to
ai-pr-review-runtime
October 23, 2026 20:44 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
DynamoDB and CloudWatch Logs still compare timestamps as text, so records from the Python exporter 0.0.1 preview, which wrote microsecond timestamps, can be ordered incorrectly within one second.
ParidelPooya
temporarily deployed
to
ai-pr-review-runtime
October 23, 2026 20:56 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
Two assertions omitted the precision argument, so they passed undefined.
ParidelPooya
temporarily deployed
to
ai-pr-review-runtime
October 23, 2026 21:02 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
The bound pattern accepted 2026-10-23T18:42.5Z and read the fraction as seconds. ISO-8601 reads it as a fractional minute, 18:42:30. A fraction now needs explicit seconds.
ParidelPooya
temporarily deployed
to
ai-pr-review-runtime
October 23, 2026 22:18 — with
GitHub Actions
Inactive
ParidelPooya
temporarily deployed
to
ai-pr-review-runtime
October 23, 2026 22:21 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
Resolves the CHANGELOG conflict with #1071 by keeping both Fixed entries. The MCP entry now describes the final bound rules.
ParidelPooya
temporarily deployed
to
ai-pr-review-runtime
October 23, 2026 22:34 — with
GitHub Actions
Inactive
Codex AI reviewThe prior P2 finding remains at Suppressed repeats
Reviewed commit |
hln33
approved these changes
Oct 23, 2026
2 tasks done
This branch was previously 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.
Summary
A deployed test ran the same workflow on the JS, Python, and Java exporters, writing to S3 and Aurora. It found two problems with how record timestamps are compared.
emittedat,starttime,endtime, and the operationstarttime/endtimeasstring. So Athena compares them as text. Measured on the deployed records:endtime >= '2026-10-23T18:42:46Z'returned none of the 7 records that ended in that second, because.sorts beforeZ. The same filter on atimestampcolumn returned all 7.list_executionsinterpolatedsinceanduntilas given. On destinations that compare text (DynamoDB, CloudWatch Logs Insights), a bound without a fraction, or with an offset such as-07:00, returned the wrong records. With an offset the error is hours.Changes:
cdk/stack.ts) and the telemetry-core DDL (athena.ts) declare those columns astimestamp. The S3 objects do not change; the OpenX JSON SerDe parses the ISO strings into the typed columns.schema.ts): the columns are listed astimestamp (UTC). A new dialect rule says to compare them withTIMESTAMPliterals or timestamp expressions, never strings.list_executions: a newnormalizeTimestampvalidates each bound, including the calendar (it rejects2026-02-30, whichDate.parsewould roll forward to March 2). A bound with no offset is read as UTC. Each dialect then writes its own literal:timestamp, Aurora and Redshifttimestamptz, OpenSearchdate) compare instants. The bound keeps every digit the caller gave, because an existing table can hold values finer than a millisecond. Athena gets aTIMESTAMP '…'literal; the others get a quoted UTC string.Z. A finer bound is rounded so it selects the same records:sinceup to the next millisecond,untildown.stringcolumns until it is recreated or altered.JS already writes every record timestamp with
toISOString(), so the record format does not change here. Python and Java change to the same fixed-width format in sibling PRs:Testing
buildCreateTableDdloutput, then dropped it.buildListExecutionsSqlnow builds forsince: "2026-10-23T11:42:46-07:00"returned the 3 executions in that window, from all three SDKs.date_diff('millisecond', starttime, endtime)equalsdurationms.starttime/endtimeread as timestamps.TYPE_MISMATCH, as the prompt says.timeBounds.test.ts(21 tests): the normalized forms, rejection of invalid dates and injection attempts, text order equal to time order after normalization, and the literal per destination. Updated the twoinjection.test.tsexpectations.biome cion the repo: clean.