Repository navigation
fix: export synthetic OpenTelemetry roots #767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
a724676
fix(otel): export fallback root before invocation return
5c79837
test(otel): cover fallback root recovery across environments
2cefa30
merge: preserve remote root recovery test ancestry
7c96744
fix(otel): consume sampling bridge before start processors
cf3541b
test(otel): verify root start processor sampling and identity
0284eda
fix(otel): consume parent context sampling intent once
61d1494
fix(ci): route review intake through read-only resolver
zhongkechen a27c3d1
Merge main for CodeBuild CI and isolated OTel test environment
zhongkechen c7fc005
Merge main after factory migration revert
6b3e260
Preserve pending conformance and E2E CI runs
efa70dc
ci: serialize revised OTel callers without replacing pending work
zhongkechen e779bc4
ci: run OTel conformance on validated CodeBuild Java 21
9e9bdbb
ci: run Build for OpenTelemetry plugin changes
652dfa5
fix: isolate durable sampling across agent class loaders
6edd3e4
test: return one checkpoint state per operation in unit mocks
zhongkechen 277c23f
test: show failure details in executor reuse assertions
6401d69
docs: align trace hierarchy with exported execution roots
zhongkechen cca1b68
fix: retain READY wait-for-condition progress across checkpoints
5c12325
fix: stop wait-for-condition polling for all terminal states
zhongkechen 856bc34
Merge main OpenTelemetry API compatibility fix
5cb66fd
Merge main exclusive OpenTelemetry view validation
6603e21
fix: replay terminal wait-for-condition outcomes safely
a70c6a3
Merge branch 'main' into fix/otel-synthetic-root-756
zhongkechen c631703
ci: pin OTel queue workflow to published squash commit
361c25b
fix: resume condition polling outside the checkpoint batcher
1e27f85
fix: yield READY checks to queued user operations
bc9787c
fix: match sampling context carriers to their sampler class copy
a08bdb4
fix: drain owned condition continuations before manager shutdown
9760d9b
fix: retain live operation parents for native span clocks
ef2c0fe
ci: use bounded layer lookup retries for existing 20 OTel cases
274807e
fix: defer custom sampling results to their owning sampler
22304e1
fix: isolate deferred sampling decisions by execution
fd53f8b
fix: isolate replacement sampler callbacks in both views
d220dd3
fix: retain visible replacement sampler root policy
960a394
fix(otel): resolve root sampling context before descendants
fdc1d6d
fix: preserve owned continuation failures and rejected admission
3b2cd21
fix: wake selected continuation waiters before legacy End callbacks
ec27233
fix: stop queued continuation admission before invocation End
2adc34c
fix: coordinate step retries outside the checkpoint batcher
4091401
fix: finish and flush synthetic roots after output preparation failures
eb449c4
fix: select continuation failures atomically with close
098c961
fix: prune completed polls before checkpoint batching
2e3edf1
fix: close READY admission before output preparation
f8e1c09
fix: close OTel user scopes on their owning threads
3a6ad16
test: stabilize percentage histories and retain concurrent replay
466fc1a
fix: stabilize fallback execution anchors
zhongkechen 0df995c
Merge main CI workflow reference repair (#786)
zhongkechen f256f4f
Merge main handler lifecycle with durable OTel anchors
zhongkechen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
67 changes: 67 additions & 0 deletions
67
otel-plugin/src/main/java/software/amazon/lambda/durable/otel/DurableExecutionRoot.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| package software.amazon.lambda.durable.otel; | ||
|
|
||
| import static software.amazon.lambda.durable.otel.SpanAttributes.DURABLE_EXECUTION_ARN; | ||
| import static software.amazon.lambda.durable.otel.SpanAttributes.DURABLE_EXECUTION_SYNTHETIC_ROOT; | ||
|
|
||
| import io.opentelemetry.api.trace.Span; | ||
| import io.opentelemetry.api.trace.SpanContext; | ||
| import io.opentelemetry.api.trace.SpanKind; | ||
| import io.opentelemetry.api.trace.Tracer; | ||
| import io.opentelemetry.context.Context; | ||
| import java.time.Instant; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| /** Creates the SDK-owned zero-duration identity anchor for a fallback execution trace. */ | ||
| final class DurableExecutionRoot { | ||
| private static final Logger logger = LoggerFactory.getLogger(DurableExecutionRoot.class); | ||
|
|
||
| private DurableExecutionRoot() {} | ||
|
|
||
| /** Ends the anchor before customer code without letting an isolated processor failure suppress its descendants. */ | ||
| static void end(Span root, Instant timestamp) { | ||
| if (root == null) return; | ||
| try { | ||
| root.end(timestamp); | ||
| } catch (Exception | LinkageError failure) { | ||
| logger.warn( | ||
| "Failed to end the execution root; continuing invocation telemetry and flushing at End", failure); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Starts the SDK-owned fallback ancestor before descendants so they inherit the provider's actual sampling | ||
| * metadata. The caller ends this identity anchor immediately at the checkpointed start timestamp. Recovery | ||
| * re-exports retain identity and timestamps; Workflow carries duration and outcome. Remote parents are never owned. | ||
| */ | ||
| static Span start( | ||
| Tracer tracer, | ||
| DeterministicIdGenerator idGenerator, | ||
| SpanContext ancestor, | ||
| String arn, | ||
| Instant start, | ||
| DurableSamplingDecision.Intent intent, | ||
| boolean useContextCarrier, | ||
| boolean useThreadCarrier) { | ||
| if (ancestor == null || ancestor.isRemote()) { | ||
| return null; | ||
| } | ||
| var builder = tracer.spanBuilder("DurableExecutionRoot") | ||
| .setSpanKind(SpanKind.INTERNAL) | ||
| .setParent(useContextCarrier ? DurableSamplingDecision.store(Context.root(), intent) : Context.root()) | ||
| .setAttribute(DURABLE_EXECUTION_ARN, arn) | ||
| .setAttribute(DURABLE_EXECUTION_SYNTHETIC_ROOT, true) | ||
| .setStartTimestamp(start); | ||
| Span root; | ||
| if (useThreadCarrier) { | ||
| try (var ignored = DurableSamplingDecision.openScope(intent)) { | ||
| root = idGenerator.startSpan(builder, ancestor.getTraceId(), ancestor.getSpanId()); | ||
| } | ||
| } else { | ||
| root = idGenerator.startSpan(builder, ancestor.getTraceId(), ancestor.getSpanId()); | ||
| } | ||
| return root; | ||
| } | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit — README missing the zero-duration note
Could we add that the anchor is zero-duration and that its descendants end after it? JS merged this (ParidelPooya point 5): some trace viewers and validators flag "child ends after parent" patterns, and callers hit it in practice. One sentence covers it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the explicit zero-duration note: descendants can end after the anchor, and its ended context remains a valid parent. The README also notes that viewers enforcing time containment may flag this shape.
Commit: 466fc1a2.