feat(otel): Add OpenTelemetry plugin module with deterministic tracing#426
Open
ayushiahjolia wants to merge 1 commit into
Open
feat(otel): Add OpenTelemetry plugin module with deterministic tracing#426ayushiahjolia wants to merge 1 commit into
ayushiahjolia wants to merge 1 commit into
Conversation
aa8f1b6 to
96492d2
Compare
96492d2 to
8eedd44
Compare
zhongkechen
reviewed
Jun 5, 2026
| - !Ref JavaVersion | ||
| - runtime | ||
| Handler: "software.amazon.lambda.durable.examples.general.OtelExample" | ||
| Role: !Ref RoleArn |
Contributor
There was a problem hiding this comment.
This function requires additional OpenTelemetry layers to work
| .setIdGenerator(idGenerator) | ||
| .addSpanProcessor(SimpleSpanProcessor.create(LoggingSpanExporter.create())) | ||
| .build(); | ||
| var otelPlugin = new OpenTelemetryDurablePlugin(tracerProvider, idGenerator); |
Contributor
There was a problem hiding this comment.
Do we allow users to choose their own id generator for our plugin?
| public void onOperationStart(OperationInfo info) { | ||
| if (!sampled || info.id() == null) return; | ||
|
|
||
| idGenerator.setNextSpanOperationId(info.id()); |
Contributor
There was a problem hiding this comment.
This wouldn't work in a multithreading env. See the similar issue in Python: aws/aws-durable-execution-sdk-python#422
| * @deprecated This is a preview API that is experimental and may be changed or removed in future releases. | ||
| */ | ||
| @Deprecated | ||
| public final class SamplingUtil { |
Contributor
There was a problem hiding this comment.
I think OpenTelemetry already provided a similar sampler TraceIdRatioBased
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.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue Link, if available
#333
Description
Add OpenTelemetry plugin module for durable execution tracing.
Changes
New
otel-pluginMaven module providing aDurableExecutionPluginimplementation that emits OTel spans for durable execution lifecycle events.What's covered in this PR -
forceFlushcalled before Lambda freezes to ensure spans are exportedNot covered in this PR -
Usage
Demo/Screenshots
Checklist
Testing
Unit Tests
Have unit tests been written for these changes? Yes
Integration Tests
Have integration tests been written for these changes? Yes
Examples
Has a new example been added for the change? (if applicable) Yes