Skip to content

feat(otel): Parent Workflow span onto shared execution trace - #647

Draft
ayushiahjolia wants to merge 1 commit into
mainfrom
feat/otel-backend-parented-topology
Draft

feat(otel): Parent Workflow span onto shared execution trace#647
ayushiahjolia wants to merge 1 commit into
mainfrom
feat/otel-backend-parented-topology

Conversation

@ayushiahjolia

Copy link
Copy Markdown
Contributor

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

#644

Description

Anchor every durable execution on one trace: the propagated remote server span is the execution ancestor when valid, else a deterministic synthetic root. Workflow and Invocation spans share the trace; sampling follows the header (explicit Sampled preserved, unset deferred to the configured sampler).

Also keep the local test runner's execution ARN stable across reinvocations to match the backend, and pin the OTel conformance workflow to the backend-parented topology assertions.

Demo/Screenshots

N/A

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Have unit tests been written for these changes? Updated.

Integration Tests

Have integration tests been written for these changes? Added/Updated

Examples

Has a new example been added for the change? (if applicable) N/A

@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 24, 2026 20:05 — with GitHub Actions Inactive
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 24, 2026 20:05 — with GitHub Actions Inactive
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@ayushiahjolia
ayushiahjolia force-pushed the feat/otel-backend-parented-topology branch from 5c0f1a8 to 95fb7cd Compare August 24, 2026 22:15
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 24, 2026 22:15 — with GitHub Actions Inactive
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 24, 2026 22:15 — with GitHub Actions Inactive
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@ayushiahjolia
ayushiahjolia force-pushed the feat/otel-backend-parented-topology branch from 95fb7cd to d97ef9c Compare August 24, 2026 23:02
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 24, 2026 23:03 — with GitHub Actions Inactive
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 24, 2026 23:03 — with GitHub Actions Inactive
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@ayushiahjolia
ayushiahjolia force-pushed the feat/otel-backend-parented-topology branch from d97ef9c to 6896e3d Compare August 25, 2026 18:08
@github-actions

This comment has been minimized.

@ayushiahjolia
ayushiahjolia force-pushed the feat/otel-backend-parented-topology branch from 338314b to d226218 Compare August 25, 2026 23:12
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 25, 2026 23:12 — with GitHub Actions Inactive
@github-actions

This comment has been minimized.

@ayushiahjolia
ayushiahjolia force-pushed the feat/otel-backend-parented-topology branch from d226218 to c0df70f Compare August 26, 2026 00:25
@ayushiahjolia
ayushiahjolia temporarily deployed to ai-pr-review-runtime August 26, 2026 00:25 — with GitHub Actions Inactive
@github-actions

This comment has been minimized.

@ayushiahjolia
ayushiahjolia force-pushed the feat/otel-backend-parented-topology branch from c0df70f to 0ff8de7 Compare August 26, 2026 06:06
@ayushiahjolia
ayushiahjolia requested a deployment to ai-pr-review-runtime August 26, 2026 06:06 — with GitHub Actions In progress
@ayushiahjolia
ayushiahjolia deployed to ai-pr-review-runtime August 26, 2026 06:06 — with GitHub Actions Active
Comment on lines +26 to +27
private static final ContextKey<SamplingResult> KEY =
ContextKey.named("software.amazon.lambda.durable.otel.durable-sampling-decision");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex AI review

P1: ContextKey uses reference identity, but the documented ADOT setup loads this JAR separately in the application and Java-agent extension classloaders. The application plugin stores the decision with one KEY, while the agent-loaded DurableSampler reads another, so it always delegates. For example, upstream Sampled=1 with always_off drops every span, contrary to the promised authoritative upstream decision. Bridge the decision across classloaders, analogous to DeterministicIdGenerator's thread-scoped system-property bridge, or use a bootstrap-shared carrier. Add a real dual-classloader test.

* @param sampling the upstream sampling decision
*/
public record ExtractedContext(String traceId, String parentSpanId) {}
public record ExtractedContext(String traceId, String parentSpanId, Sampling sampling) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex AI review

P2: The new public canonical constructor accepts a null sampling. This also occurs when Jackson reads legacy two-field serialized values. resolveSamplingResult then switches on null, throwing an exception that PluginRunner swallows and disabling telemetry for the invocation. Add a compact constructor that normalizes null to Sampling.UNDECIDED, and test legacy/missing-field deserialization.

@github-actions

Copy link
Copy Markdown
Contributor

Codex AI review

Two findings: the ADOT agent path can ignore authoritative sampling decisions, and null sampling values can disable telemetry.

Reviewed commit 0ff8de763afe3b1a7750a117a765322b1d602b01. Workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant