fix(otel): cross sdk behaviour alignment (#756)
Issue #, if available:
Description of changes:
Addressing the following cross SDK behaviour differences found from https://github.com/aws/aws-durable-execution-conformance-tests/issues/23
- Invocation spans should use span.kind=INTERNAL.
- All invocations have span status UNSET when Execution not completed. If Execution is failed, the last Invocation span will have status ERROR. We need to fix this behaviour in Python SDK and Typescript SDK.
- Add durable.invocation.first and durable.invocation.status to Python and Javascript Otel plugins. Suspends = PENDING. Fails = RETRYING. Succeeded and failed for execution status.
PluginOperationStatusneeds to be implemented for all operations (durable.operation.status). Javascript is missing the field for certain onOperationEnd calls. Java Otel plugin doesn’t need to explicitly update spans withPluginOperationStatus.PENDINGin onInvocationEnd for operations that have not yet completed. We’re assuming that they would just bePluginOperationStatus.STARTED. Double check for Wait-for-condition.- In Python, STEP operation span and WAIT-FOR-CONDITION operation span exports an attribute to the span dubbed
durable.attempt.numberto denote the total number of attempts that happened. Should only be emitted after the operation is completed.- All attributes from operation spans are available in associated attempt spans. Attempt spans additionally have durable.attempt.number and durable.attempt.outcome attributes.
- For invocation view using ADOT layer (specifically Typescript), create the “invocation” span regardless and include durable.execution.arn.
- For Typescript, rename
durable.operation.attemptattribute todurable.attempt.numberin attempts span.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Co-authored-by: hsilan hsilan@amazon.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
AWS Durable Execution SDKs for JavaScript
Build resilient, long-running AWS Lambda functions with automatic state persistence, retry logic, and workflow orchestration. Lambda durable functions can run for up to one year while maintaining reliable progress through checkpoints and automatic failure recovery.
✨ Key Features
📦 Packages
This monorepo contains the following NPM packages:
🚀 Quick Start
Installation
Your First Durable Function
Invoking Your Durable Function
Durable functions require a qualified identifier for invocation. You must specify a version or alias. Unqualified ARNs or function names without a suffix are not supported to ensure deterministic replay behavior.
The following example uses asynchronous invocation (
--invocation-type Event), which queues the event and returns immediately, enabling executions that can run for up to one year:📚 Documentation
🧪 Testing
The testing SDK enables local development and unit testing without deploying to AWS, as well as cloud testing against deployed Lambda functions:
See the Testing SDK documentation for more details.
💬 Feedback & Support
🤝 Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
🔒 Security
See CONTRIBUTING for information about reporting security issues.
📄 License
This project is licensed under the Apache-2.0 License. See LICENSE for details.