Repository navigation
sdk-v3.0.0,otel-v2.0.0,testing-v1.4.0,telemetry-exporter-v0.0.2 #843
yaythomas
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
With Durable Execution SDK 3.0 you can tag steps, callbacks and child contexts with your own subtypes,
BatchResultreports every result that returnedNone, and plugins are safe under Lambda Managed Instances concurrency.This coordinated major release includes SDK 3.0.0, OTel 2.0.0, Testing 1.4.0 and Telemetry Exporter 0.0.2 for Python 3.11 and later.
Upgrade Core 3 and OTel 2 together, including any Lambda layers that contain them. Core 3 rejects OTel 1.x registrations with
PluginLoadErrorat handler initialization. Testing 1.4.0 requires Core 3. Read the 2.x to 3.0 migration guide before you upgrade.plugins=[...]takes factory objects withcreate_plugin(info), and each invocation gets a new plugin instance (894c2b1e).sub_type(0783da2a).BatchResult.get_results()keeps a branch that returnedNone, andget_errors()keeps every failed item (e567ae4f).363db885).0783da2a).aws-durable-execution-sdk-python v3.0.0
Breaking Changes
The migration guide shows the code change for each item.
pluginstakes factory objects. A factory has a synchronouscreate_plugin(info: InvocationStartInfo)method that returns a newDurableInstrumentationPlugin. The SDK calls it once per invocation (894c2b1e).DurableInstrumentationPluginProvideris removed. An entry point in theaws_durable_execution.pluginsgroup must resolve to a factory object. A plugin instance, a bare callable or an uninstantiated factory class inpluginsraisesPluginLoadErrorat handler initialization (894c2b1e).on_invocation_startset stay in place. Later hooks and handler code see them (894c2b1e).str | None:Operation.sub_type,OperationUpdate.sub_type,ChildConfig.sub_typeandOperationInfo.sub_type. Replace.valuereads with the value, andiscomparisons with==(0783da2a).OperationUpdate.create_context_start,create_context_succeedandcreate_context_faillose theirsub_typeparameter. The operation identifier carries it.aws_durable_execution_sdk_python.pluginno longer importsOperationSubType. Import it fromaws_durable_execution_sdk_python.lambda_service(0783da2a).BatchResult.succeeded()andget_results()include a branch that returnedNone. Sosum(batch.get_results())can raiseTypeErrorwhere it used to work (e567ae4f).BatchResult.failed()andget_errors()return every failed item, one entry each. A failed child context whose checkpoint carries no error is recorded with theChildContextErrorthat replaying it raises, sothrow_if_error()raises for it. In 2.x the item was dropped andthrow_if_error()returned without raising (e567ae4f).Features
StepConfigandCallbackConfigtake a keyword-onlysub_type.ChildConfig.sub_typeaccepts any string.Noneand""select the default (0783da2a).Operation.from_dictraisedValueErroron a value outsideOperationSubType(0783da2a).A-Z,a-z,0-9,-and_raisesValidationErrorbefore any checkpoint is sent. Replay compares the subtype with the checkpoint. So changing a subtype breaks executions already in flight (0783da2a).on_operation_changeruns on its own thread and merges notifications that arrive while the plugin is still in the hook (363db885).Chores and maintenance
+bundledversion label instead of the install path. The reported value keeps the form<version>-bundled(7aec4442).OperationInfo.resultanderror,InvocationInfo.execution_inputandoperations,InvocationStartInfo.updated_operations, andInvocationEndInfo.errorandexecution_result(8bb88f56).aws-durable-execution-sdk-python-otel v2.0.0
Breaking Changes
The migration guide shows the new registrations.
InvocationOtelPluginFactoryorExecutionOtelPluginFactory.InvocationOtelPluginandExecutionOtelPluginare no longer valid entries inplugins(894c2b1e).>=3.0.0,<4. OTel 2 cannot use the Core 2 plugin contract.DURABLE_EXECUTION_PLUGINS=otel-invocationandotel-executionkeep their names but must resolve to OTel 2 (894c2b1e).Features
durable.operation.subtypespan attribute carries a custom subtype set on a step, callback or child context (0783da2a).Bug Fixes
894c2b1e).aws-durable-execution-sdk-python-testing v1.4.0
Breaking Changes
>=3.0.0. A project pinned to Core 2 cannot install it (0783da2a).Operation.sub_typeisstr | None. Code that reads.valueor compares withismust compare with==(0783da2a).Features
InvalidParameterValueExceptionfor it. The runner does not yet reject an invalid subtype, which the service rejects. So a subtype that passes locally can still fail in the cloud. Tracked in issue [Testing]: Local checkpoint server accepts a SubType the service rejects #836 (0783da2a).aws-durable-execution-sdk-python-telemetry-exporter v0.0.2
Breaking Changes
durable_execution_telemetry(config)returns a plugin factory. Pass its result directly toplugins. Do not wrap or cache a plugin it creates (894c2b1e).>=3.0.0,<4. Version 0.0.1 uses the Core 2 plugin contract and cannot run on Core 3 (894c2b1e).Bug Fixes
YYYY-MM-DDTHH:MM:SS.sssZwith exactly 3 fraction digits. Before, Python wrote 6 digits, or none when microseconds were 0, so text order did not match time order.emittedAtstrictly increases within one invocation. So two records built in the same millisecond no longer share an SQS FIFO deduplication ID or a default DynamoDB sort key (102dd62e).LambdaLogExporterprints each record inside the Lambda JSON log envelope{"timestamp","level","message"}.max_record_size_bytescaps the printed line (f870be53).2**53 - 1are written as strings.DynamoDBExporterwrites a number it cannot store as a string instead of failing the item (f870be53).nameandmessage, in that order. A name or message longer than 8,192 code points is cut and ends with…(f870be53).Decimalis written as0. Before,Decimal("-0E+20")was written as-0.0(b4a1d711).894c2b1e).Full Changelog: sdk-v2.1.0,otel-v1.1.0,testing-v1.3.0...sdk-v3.0.0,otel-v2.0.0,testing-v1.4.0,telemetry-exporter-v0.0.2
This discussion was created from the release sdk-v3.0.0,otel-v2.0.0,testing-v1.4.0,telemetry-exporter-v0.0.2.
All reactions