You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 102dd62
Browse filesBrowse the repository at this point in the historyBrowse files
fix(telemetry): write fixed-width UTC record timestamps (#821)
* fix(telemetry): write fixed-width UTC timestamps
Record timestamps now use YYYY-MM-DDTHH:MM:SS.sssZ. The fraction always
has 3 digits. The plugin converts each time to UTC and truncates it to
milliseconds. JavaScript's Date.prototype.toISOString() writes the same
format.
Before, isoformat() wrote 6 fraction digits. It wrote no fraction when
microseconds were 0. Stores compare these values as text. Text order
equals time order only when every value has the same width. So mixed
widths sorted records out of time order.
* fix(telemetry): keep emittedAt unique per invocation
emittedAt has millisecond precision. In on-change mode, one invocation
can build two records in the same millisecond, for example RUNNING and
then the terminal record. The SQS FIFO deduplication id is
executionArn:emittedAt. The default DynamoDB sort key is emittedAt. So
SQS dropped the second message, and DynamoDB overwrote the first item.
So emittedAt now strictly increases within one plugin instance. The
instance serves one invocation. The instance keeps the last emittedAt in
epoch milliseconds. Each record takes the current time, truncated to
milliseconds, when it is later than the last value. Otherwise it takes
the last value plus 1. The JavaScript plugin uses the same rule.
Record building runs outside _lock by design, because it runs customer
transforms. Snapshot admission runs under _lock, and builds on
different threads can be admitted concurrently. So the value is chosen
during admission and carried on the snapshot to the build.
Copy file name to clipboardExpand all lines: packages/aws-durable-execution-sdk-python-telemetry-exporter/src/aws_durable_execution_sdk_python_telemetry_exporter/exporters/otel_exporter.py
Copy file name to clipboardExpand all lines: packages/aws-durable-execution-sdk-python-telemetry-exporter/src/aws_durable_execution_sdk_python_telemetry_exporter/plugin.py
Copy file name to clipboardExpand all lines: packages/aws-durable-execution-sdk-python-telemetry-exporter/src/aws_durable_execution_sdk_python_telemetry_exporter/truncation.py
0 commit comments