diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/.gitignore b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/.gitignore new file mode 100644 index 000000000..004749a8f --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/.gitignore @@ -0,0 +1 @@ +publish/ diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Amazon.Lambda.DurableExecution.ConformanceTests.Otel.csproj b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Amazon.Lambda.DurableExecution.ConformanceTests.Otel.csproj new file mode 100644 index 000000000..172e2b574 --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Amazon.Lambda.DurableExecution.ConformanceTests.Otel.csproj @@ -0,0 +1,41 @@ + + + + + net10.0 + Exe + true + bootstrap + enable + enable + true + false + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Program.cs b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Program.cs new file mode 100644 index 000000000..a5c028826 --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Program.cs @@ -0,0 +1,62 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +using System.Text.Json; +using Amazon.Lambda.Core; +using Amazon.Lambda.DurableExecution.OpenTelemetry; +using Amazon.Lambda.RuntimeSupport; +using Amazon.Lambda.Serialization.SystemTextJson; +using OpenTelemetry; +using OpenTelemetry.Instrumentation.AWSLambda; +using OpenTelemetry.Trace; + +namespace Amazon.Lambda.DurableExecution.ConformanceTests.Otel; + +public static class Program +{ + // The collector layer is a Lambda extension, so spans must be handed to it before the environment freezes. + private static readonly TracerProvider Tracer = Sdk.CreateTracerProviderBuilder() + .AddAWSLambdaConfigurations() + .AddSource(OtelPlugin.ActivitySourceName) + .AddSource(Probes.SourceName) + .AddOtlpExporter() + .Build()!; + + private static readonly DurableExecutionOptions Options = new DurableExecutionOptions() + .AddOpenTelemetry( + Environment.GetEnvironmentVariable("OTEL_PLUGIN_MODE") == "execution" ? OtelView.Execution : OtelView.Invocation, + new OtelPluginOptions + { + FlushAsync = (timeout, _) => + { + Tracer.ForceFlush((int)timeout.TotalMilliseconds); + return Task.CompletedTask; + }, + FlushTimeout = TimeSpan.FromSeconds(5), + }); + + private static readonly Scenario Selected = Scenarios.Find( + Environment.GetEnvironmentVariable("CONFORMANCE_SCENARIO") + ?? throw new InvalidOperationException("CONFORMANCE_SCENARIO is not set")); + + public static async Task Main() + { + using var handlerWrapper = HandlerWrapper.GetHandlerWrapper( + Handler, new DefaultLambdaJsonSerializer()); + using var bootstrap = new LambdaBootstrap(handlerWrapper); + await bootstrap.RunAsync(); + } + + // The wrapper starts the server span the plugin's Invocation and Workflow spans hang from, and flushes after it. + public static Task Handler(DurableExecutionInvocationInput input, ILambdaContext context) + => AWSLambdaWrapper.TraceAsync(Tracer, RunAsync, input, context); + + private static Task RunAsync(DurableExecutionInvocationInput input, ILambdaContext context) + => DurableFunction.WrapAsync( + (payload, durable) => + { + Scenarios.RequireScenario(payload, Selected.PayloadScenario); + return Selected.Run(payload, durable); + }, + input, context, Options); +} diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/README.md b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/README.md new file mode 100644 index 000000000..42d29a0ec --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/README.md @@ -0,0 +1,47 @@ +# OpenTelemetry conformance handlers (.NET) + +Handlers and a SAM template for the `otel-invocation` and `otel-execution` suites of +[aws-durable-execution-conformance-tests](https://github.com/aws/aws-durable-execution-conformance-tests). +The requirements, validators and runner live there. This directory only holds what the SDK owns. + +One executable serves every case. `template.yaml` gives each function a `CONFORMANCE_SCENARIO` +(a class in `Scenarios/`) and an `OTEL_PLUGIN_MODE` (`invocation` or `execution`). +`template.yaml` is generated: edit the case list in `scripts/generate_template.py` and rerun it. + +Spans leave the function in-process. `Program.cs` builds an OpenTelemetry `TracerProvider` that listens to the +plugin's `ActivitySource` and sends OTLP to the collector Lambda layer. `AWSLambdaWrapper` (from +`OpenTelemetry.Instrumentation.AWSLambda`) starts the server span the plugin's Invocation span hangs from. It plays the +role the ADOT wrapper plays for the Java, JavaScript and Python handlers. + +## Run + +```bash +./scripts/build_examples.sh +durable-execution-conformance \ + --template template.yaml --language dotnet --region us-west-2 --name dotnet-xray-inv \ + --suite otel-invocation --otel-service-name durable-execution-conformance \ + --otel-exporter adot --otel-backend xray \ + --otel-layer-arn arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-collector-amd64-ver-0-156-0:4 \ + --parameter-overrides LambdaExecutionRoleArn= OtelServiceName=durable-execution-conformance OtelSuite=otel-invocation +``` + +`--language dotnet` needs the `dotnet` ADOT profile in the OTel conformance package. It uses the ADOT collector layer +and no exec wrapper. + +## Export path + +`collector-xray.yaml` configures the collector layer to send spans to X-Ray's OTLP endpoint with SigV4. That endpoint +keeps the span kind and resource service name the validators check; the layer's default `awsxray` exporter drops them. +It requires X-Ray Transaction Search in the account, with the indexing rule at 100% so every trace is queryable. + +## Coverage + +Both suites, against X-Ray in us-west-2: 25 passed, 2 not implemented. + +| Case | Status | +|---|---| +| 1 to 22, 25 to 27 | pass | +| 23 | not implemented: needs a with-retry helper for child contexts, which the .NET SDK does not have | +| 24 | not implemented: needs a public way to request an invocation retry; a workflow exception fails the execution | + +Child contexts set `SubType = "RunInChildContext"`, which other SDKs send by default and the requirements expect. diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Otel10To20.cs b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Otel10To20.cs new file mode 100644 index 000000000..59247a03c --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Otel10To20.cs @@ -0,0 +1,133 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +namespace Amazon.Lambda.DurableExecution.ConformanceTests.Otel; + +// The conformance driver completes or fails these callbacks, so the submitters do nothing. + +internal static class Otel10WaitForCallback +{ + public static readonly Scenario Scenario = new(nameof(Otel10WaitForCallback), "wait-for-callback", async (_, context) => + await context.WaitForCallbackAsync((_, _, _) => Task.CompletedTask, name: "otel-callback")); +} + +internal static class Otel12ChildContextFailure +{ + public static readonly Scenario Scenario = new(nameof(Otel12ChildContextFailure), "child-context-failure", async (_, context) => + { + await context.RunInChildContextAsync( + (_, _) => throw new InvalidOperationException("Intentional child-context failure"), + name: "otel-failed-child-context", + config: new ChildContextConfig { SubType = "RunInChildContext" }); + return null; + }); +} + +internal static class Otel13ParallelFailure +{ + public static readonly Scenario Scenario = new(nameof(Otel13ParallelFailure), "parallel-failure", async (_, context) => + { + var result = await context.ParallelAsync( + new[] + { + new DurableBranch("otel-failed-parallel-branch", (_, _) => + throw new InvalidOperationException("Intentional parallel branch failure")), + }, + name: "otel-failed-parallel", + config: new ParallelConfig { MaxConcurrency = 1 }); + result.ThrowIfError(); + return null; + }); +} + +internal static class Otel14MapFailure +{ + public static readonly Scenario Scenario = new(nameof(Otel14MapFailure), "map-failure", async (_, context) => + { + var result = await context.MapAsync( + new[] { 1 }, + (_, _, _, _, _) => throw new InvalidOperationException("Intentional map iteration failure"), + name: "otel-failed-map", + config: new MapConfig { MaxConcurrency = 1, ItemNamer = (_, index) => $"otel-failed-map-iteration-{index}" }); + result.ThrowIfError(); + return null; + }); +} + +internal static class Otel15WaitInterrupted +{ + public static readonly Scenario Scenario = new(nameof(Otel15WaitInterrupted), "wait-interrupted", async (_, context) => + { + await context.WaitAsync(TimeSpan.FromSeconds(30), name: "otel-interrupted-wait"); + return null; + }); +} + +internal static class Otel16WaitForConditionFailure +{ + public static readonly Scenario Scenario = new(nameof(Otel16WaitForConditionFailure), "wait-for-condition-failure", async (_, context) => + { + await context.WaitForConditionAsync( + (_, _, _) => throw new InvalidOperationException("Intentional condition check failure"), + new WaitForConditionConfig + { + InitialState = 0, + WaitStrategy = WaitStrategy.FromDelegate((_, _) => WaitDecision.ContinueAfter(TimeSpan.FromSeconds(1))), + }, + name: "otel-failed-condition"); + return null; + }); +} + +internal static class Otel17WaitForCallbackFailure +{ + public static readonly Scenario Scenario = new(nameof(Otel17WaitForCallbackFailure), "wait-for-callback-failure", async (_, context) => + { + await context.WaitForCallbackAsync((_, _, _) => Task.CompletedTask, name: "otel-failed-callback"); + return null; + }); +} + +internal static class Otel19ExecutionFailure +{ + public static readonly Scenario Scenario = new(nameof(Otel19ExecutionFailure), "execution-failure", + (_, _) => throw new InvalidOperationException("Intentional execution failure")); +} + +internal static class Otel20VirtualContext +{ + public static readonly Scenario Scenario = new(nameof(Otel20VirtualContext), "virtual-context", async (_, context) => + await context.RunInChildContextAsync( + (_, _) => Task.FromResult("virtual-complete"), + name: "otel-virtual-context", + config: new ChildContextConfig { NestingType = NestingType.Flat, SubType = "RunInChildContext" })); +} + +internal static class Otel11ChainedInvoke +{ + public static readonly Scenario Scenario = new(nameof(Otel11ChainedInvoke), "chained-invoke", async (payload, context) => + { + var result = await context.InvokeAsync( + Scenarios.InvokeTarget, payload, name: "otel-invoke"); + // The driver completes this callback after the invocation that created it ends, forcing a replay of the invoke. + await context.WaitForCallbackAsync( + (_, _, _) => Task.CompletedTask, name: "otel-invoke-replay-barrier"); + return result; + }); + + public static readonly Scenario Target = new("Otel11InvokeTarget", "chained-invoke", (payload, _) => + Task.FromResult(payload)); +} + +internal static class Otel18ChainedInvokeFailure +{ + public static readonly Scenario Scenario = new(nameof(Otel18ChainedInvokeFailure), "chained-invoke-failure", async (payload, context) => + { + await context.InvokeAsync( + Scenarios.InvokeTarget, payload, name: "otel-failed-invoke"); + return null; + }); + + public static readonly Scenario Target = new("Otel18InvokeTarget", "chained-invoke-failure", (_, _) => + throw new InvalidOperationException("Intentional chained-invoke target failure")); +} diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Otel1To4.cs b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Otel1To4.cs new file mode 100644 index 000000000..7285b4273 --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Otel1To4.cs @@ -0,0 +1,46 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +namespace Amazon.Lambda.DurableExecution.ConformanceTests.Otel; + +internal static class Otel1Success +{ + public static readonly Scenario Scenario = new(nameof(Otel1Success), "success", async (_, context) => + await context.StepAsync((_, _) => Task.FromResult("success"), name: "otel-success")); +} + +internal static class Otel2WaitResume +{ + public static readonly Scenario Scenario = new(nameof(Otel2WaitResume), "wait-resume", async (_, context) => + { + await context.WaitAsync(TimeSpan.FromSeconds(1), name: "otel-wait"); + return await context.StepAsync((_, _) => Task.FromResult("resumed"), name: "otel-after-resume"); + }); +} + +internal static class Otel3Retry +{ + public static readonly Scenario Scenario = new(nameof(Otel3Retry), "retry", async (_, context) => + await context.StepAsync( + (step, _) => step.AttemptNumber == 1 + ? throw new InvalidOperationException("Intentional first-attempt failure") + : Task.FromResult("retried"), + name: "otel-retry", + config: new StepConfig + { + RetryStrategy = RetryStrategy.FromDelegate((_, attempt) => + attempt >= 2 ? RetryDecision.DoNotRetry() : RetryDecision.RetryAfter(TimeSpan.FromSeconds(1))), + })); +} + +internal static class Otel4TerminalFailure +{ + public static readonly Scenario Scenario = new(nameof(Otel4TerminalFailure), "terminal-failure", async (_, context) => + { + await context.StepAsync( + (_, _) => throw new InvalidOperationException("Intentional terminal failure"), + name: "otel-terminal-failure", + config: new StepConfig { RetryStrategy = RetryStrategy.None }); + return null; + }); +} diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Otel21To27.cs b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Otel21To27.cs new file mode 100644 index 000000000..2203136bc --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Otel21To27.cs @@ -0,0 +1,131 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +using System.Diagnostics; +using System.Text.Json; + +namespace Amazon.Lambda.DurableExecution.ConformanceTests.Otel; + +internal static class Otel21CompletedStepReplay +{ + public static readonly Scenario Scenario = new(nameof(Otel21CompletedStepReplay), "completed-step-replay", async (_, context) => + { + var before = await context.StepAsync((_, _) => Task.FromResult("before"), name: "otel-before-wait"); + await context.WaitAsync(TimeSpan.FromSeconds(1), name: "otel-replay-wait"); + var after = await context.StepAsync((_, _) => Task.FromResult("after"), name: "otel-after-wait"); + return $"{before}-{after}"; + }); +} + +/// +/// Cases 22: user code creates an ordinary span at each probe point. The validator checks the span the plugin made +/// current there is its parent. +/// +internal static class Probes +{ + public const string SourceName = "aws-durable-execution-conformance"; + private static readonly ActivitySource Source = new(SourceName); + + public static void Probe(string label) + { + using var span = Source.StartActivity($"conformance.{label}"); + span?.SetTag("conformance.callback", label); + } +} + +internal static class Otel22UserFunctionContext +{ + public static readonly Scenario Scenario = new(nameof(Otel22UserFunctionContext), "user-function-context", async (_, context) => + { + Probes.Probe("handler"); + await context.StepAsync((_, _) => { Probes.Probe("step"); return Task.FromResult("step"); }, name: "otel-context-step"); + await context.RunInChildContextAsync(async (child, _) => + { + Probes.Probe("child"); + await child.StepAsync((_, _) => { Probes.Probe("child-step"); return Task.FromResult("child-step"); }, + name: "otel-context-child-step"); + Probes.Probe("child-restored"); + return "child"; + }, name: "otel-context-child", config: new ChildContextConfig { SubType = "RunInChildContext" }); + + await context.ParallelAsync( + new[] + { + new DurableBranch("otel-context-branch-a", (branch, _) => + { + Probes.Probe("parallel-a"); + return branch.StepAsync((_, _) => { Probes.Probe("parallel-step-a"); return Task.FromResult("a"); }, + name: "otel-context-branch-step-a"); + }), + new DurableBranch("otel-context-branch-b", (branch, _) => + { + Probes.Probe("parallel-b"); + return branch.StepAsync((_, _) => { Probes.Probe("parallel-step-b"); return Task.FromResult("b"); }, + name: "otel-context-branch-step-b"); + }), + }, + name: "otel-context-parallel", + config: new ParallelConfig { MaxConcurrency = 2 }); + + await context.MapAsync( + new[] { 0, 1 }, + (iteration, item, index, _, _) => + { + Probes.Probe($"map-{index}"); + return iteration.StepAsync((_, _) => { Probes.Probe($"map-step-{index}"); return Task.FromResult(item); }, + name: $"otel-context-map-step-{index}"); + }, + name: "otel-context-map", + config: new MapConfig { MaxConcurrency = 2, ItemNamer = (_, index) => $"otel-context-iteration-{index}" }); + + Probes.Probe("handler-restored"); + await context.WaitAsync(TimeSpan.FromSeconds(1), name: "otel-context-resume"); + Probes.Probe("handler-after-resume"); + return "context-complete"; + }); +} + +internal static class Otel25CaughtCallbackFailureReplay +{ + public static readonly Scenario Scenario = new(nameof(Otel25CaughtCallbackFailureReplay), "caught-callback-failure-replay", async (_, context) => + { + try + { + await context.WaitForCallbackAsync((_, _, _) => Task.CompletedTask, name: "otel-failed-callback"); + throw new InvalidOperationException("Expected the callback to fail"); + } + catch (CallbackFailedException) + { + } + + var observed = await context.StepAsync((_, _) => Task.FromResult("caught"), name: "otel-failed-callback-observed"); + var one = await context.WaitForCallbackAsync((_, _, _) => Task.CompletedTask, name: "otel-failed-callback-barrier-one"); + var two = await context.WaitForCallbackAsync((_, _, _) => Task.CompletedTask, name: "otel-failed-callback-barrier-two"); + return $"{observed}/{one}/{two}"; + }); +} + +internal static class Otel26ExternalCompletionReplay +{ + public static readonly Scenario Scenario = new(nameof(Otel26ExternalCompletionReplay), "external-callback-completion-replay", async (_, context) => + { + var callback = await context.CreateCallbackAsync(name: "otel-external-target"); + var target = await callback.GetResultAsync(); + var observed = await context.StepAsync((_, _) => Task.FromResult(target), name: "otel-external-target-observed"); + var one = await context.WaitForCallbackAsync((_, _, _) => Task.CompletedTask, name: "otel-external-barrier-one"); + var two = await context.WaitForCallbackAsync((_, _, _) => Task.CompletedTask, name: "otel-external-barrier-two"); + return $"{observed}/{one}/{two}"; + }); +} + +internal static class Otel27ChainedInvokeSuspend +{ + public static readonly Scenario Scenario = new(nameof(Otel27ChainedInvokeSuspend), "chained-invoke-suspend", async (payload, context) => + await context.InvokeAsync(Scenarios.InvokeTarget, payload, name: "otel-suspended-invoke")); + + public static readonly Scenario Target = new("Otel27InvokeTarget", "chained-invoke-suspend", async (payload, context) => + { + await context.WaitAsync(TimeSpan.FromSeconds(1), name: "otel-suspended-target-wait"); + return payload; + }); +} diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Otel5To9.cs b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Otel5To9.cs new file mode 100644 index 000000000..eb1181674 --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Otel5To9.cs @@ -0,0 +1,78 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +namespace Amazon.Lambda.DurableExecution.ConformanceTests.Otel; + +internal static class Otel5ChildContext +{ + public static readonly Scenario Scenario = new(nameof(Otel5ChildContext), "child-context", async (_, context) => + await context.RunInChildContextAsync( + (child, _) => child.StepAsync((_, _) => Task.FromResult("child-complete"), name: "otel-child-step"), + name: "otel-child-context", + // The .NET SDK sends no subtype by default; the shared requirements expect the one other SDKs send. + config: new ChildContextConfig { SubType = "RunInChildContext" })); +} + +internal static class Otel6Parallel +{ + public static readonly Scenario Scenario = new(nameof(Otel6Parallel), "parallel-hierarchy", async (_, context) => + { + var result = await context.ParallelAsync( + new[] + { + new DurableBranch("otel-parallel-branch-a", (branch, _) => + branch.StepAsync((_, _) => Task.FromResult("a"), name: "otel-parallel-step-a")), + new DurableBranch("otel-parallel-branch-b", (branch, _) => + branch.StepAsync((_, _) => Task.FromResult("b"), name: "otel-parallel-step-b")), + }, + name: "otel-parallel", + config: new ParallelConfig { MaxConcurrency = 1 }); + return result.All.Select(item => item.Result).ToList(); + }); +} + +internal static class Otel7Map +{ + public static readonly Scenario Scenario = new(nameof(Otel7Map), "map-hierarchy", async (_, context) => + { + var result = await context.MapAsync( + new[] { 1, 2 }, + (iteration, item, index, _, _) => + iteration.StepAsync((_, _) => Task.FromResult(item * 2), name: $"otel-map-step-{index}"), + name: "otel-map", + config: new MapConfig { MaxConcurrency = 1, ItemNamer = (_, index) => $"otel-map-iteration-{index}" }); + return result.All.Select(item => item.Result).ToList(); + }); +} + +internal static class Otel8HandledFailure +{ + public static readonly Scenario Scenario = new(nameof(Otel8HandledFailure), "handled-failure", async (_, context) => + { + try + { + await context.StepAsync( + (_, _) => throw new InvalidOperationException("Intentional handled failure"), + name: "otel-handled-failure", + config: new StepConfig { RetryStrategy = RetryStrategy.None }); + } + catch (StepException) + { + } + return await context.StepAsync((_, _) => Task.FromResult("recovered"), name: "otel-recovery-step"); + }); +} + +internal static class Otel9WaitForCondition +{ + public static readonly Scenario Scenario = new(nameof(Otel9WaitForCondition), "wait-for-condition", async (_, context) => + await context.WaitForConditionAsync( + (state, _, _) => Task.FromResult(state + 1), + new WaitForConditionConfig + { + InitialState = 0, + WaitStrategy = WaitStrategy.FromDelegate((state, _) => + state >= 2 ? WaitDecision.Stop() : WaitDecision.ContinueAfter(TimeSpan.FromSeconds(1))), + }, + name: "otel-condition")); +} diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Scenarios.cs b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Scenarios.cs new file mode 100644 index 000000000..c7c8d7e77 --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/Scenarios/Scenarios.cs @@ -0,0 +1,68 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +using System.Text.Json; + +namespace Amazon.Lambda.DurableExecution.ConformanceTests.Otel; + +/// +/// One conformance case. is the class name template.yaml puts in CONFORMANCE_SCENARIO; +/// is the scenario field the shared requirement sends. +/// +public sealed record Scenario(string Name, string PayloadScenario, Func> Run); + +public static class Scenarios +{ + private static readonly Dictionary All = new[] + { + Otel1Success.Scenario, + Otel2WaitResume.Scenario, + Otel3Retry.Scenario, + Otel4TerminalFailure.Scenario, + Otel5ChildContext.Scenario, + Otel6Parallel.Scenario, + Otel7Map.Scenario, + Otel8HandledFailure.Scenario, + Otel9WaitForCondition.Scenario, + Otel10WaitForCallback.Scenario, + Otel11ChainedInvoke.Scenario, + Otel11ChainedInvoke.Target, + Otel12ChildContextFailure.Scenario, + Otel13ParallelFailure.Scenario, + Otel14MapFailure.Scenario, + Otel15WaitInterrupted.Scenario, + Otel16WaitForConditionFailure.Scenario, + Otel17WaitForCallbackFailure.Scenario, + Otel18ChainedInvokeFailure.Scenario, + Otel18ChainedInvokeFailure.Target, + Otel19ExecutionFailure.Scenario, + Otel20VirtualContext.Scenario, + Otel21CompletedStepReplay.Scenario, + Otel22UserFunctionContext.Scenario, + Otel25CaughtCallbackFailureReplay.Scenario, + Otel26ExternalCompletionReplay.Scenario, + Otel27ChainedInvokeSuspend.Scenario, + Otel27ChainedInvokeSuspend.Target, + }.ToDictionary(scenario => scenario.Name); + + /// The function a chained-invoke case calls, set by template.yaml. + public static string InvokeTarget => Environment.GetEnvironmentVariable("OTEL_INVOKE_TARGET_FUNCTION_NAME") + ?? throw new InvalidOperationException("OTEL_INVOKE_TARGET_FUNCTION_NAME is not set"); + + public static Scenario Find(string name) + => All.TryGetValue(name, out var scenario) + ? scenario + : throw new InvalidOperationException($"Unknown conformance scenario '{name}'"); + + /// Rejects an event routed to the wrong function. + public static void RequireScenario(JsonElement payload, string expected) + { + var actual = payload.ValueKind == JsonValueKind.Object && payload.TryGetProperty("scenario", out var value) + ? value.GetString() + : null; + if (actual != expected) + { + throw new ArgumentException($"Expected scenario {expected}, received {actual}"); + } + } +} diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/collector-xray.yaml b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/collector-xray.yaml new file mode 100644 index 000000000..9b2641590 --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/collector-xray.yaml @@ -0,0 +1,27 @@ +# Collector layer configuration for the X-Ray backend. Sends spans to X-Ray's OTLP endpoint (Transaction Search), +# the same destination the ADOT language distros use, so spans carry their kind and service name. +receivers: + otlp: + protocols: + http: + endpoint: "localhost:4318" + +extensions: + sigv4auth: + region: ${env:AWS_REGION} + service: xray + +exporters: + otlphttp: + traces_endpoint: https://xray.${env:AWS_REGION}.amazonaws.com/v1/traces + auth: + authenticator: sigv4auth + sending_queue: + enabled: false + +service: + extensions: [sigv4auth] + pipelines: + traces: + receivers: [otlp] + exporters: [otlphttp] diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/scripts/build_examples.sh b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/scripts/build_examples.sh new file mode 100755 index 000000000..6abdac7b2 --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/scripts/build_examples.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Publish the handlers once into publish/ and write the Makefile SAM's makefile BuildMethod needs. +# Every function in template.yaml shares the one bundle, so each logical id gets a target that copies it. +# +# Usage: ./scripts/build_examples.sh + +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +PUBLISH_DIR="${ROOT}/publish" + +rm -rf "${PUBLISH_DIR}" +dotnet publish "${ROOT}/Amazon.Lambda.DurableExecution.ConformanceTests.Otel.csproj" \ + -c Release --self-contained false -o "${PUBLISH_DIR}" >&2 + +{ + # Logical ids are the two-space-indented keys under Resources whose type is a function. + for id in $(awk '/^Resources:/{r=1;next} r && /^ [A-Za-z0-9]+:$/{gsub(/[ :]/,"");print}' "${ROOT}/template.yaml"); do + printf '.PHONY: build-%s\nbuild-%s:\n\tcp -r . $(ARTIFACTS_DIR)/\n\trm -f $(ARTIFACTS_DIR)/Makefile\n\n' "${id}" "${id}" + done +} > "${PUBLISH_DIR}/Makefile" + +echo "Published to ${PUBLISH_DIR}" >&2 diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/scripts/generate_template.py b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/scripts/generate_template.py new file mode 100644 index 000000000..da0e7a813 --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/scripts/generate_template.py @@ -0,0 +1,203 @@ +#!/usr/bin/env python3 +"""Generate template.yaml for the OpenTelemetry conformance handlers. + +Every case is deployed once per view (otel-invocation, otel-execution), and the runner needs the +requirement id as a literal in TestingMetadata, so the template is 2x the case list. Edit CASES and +rerun this script instead of editing template.yaml by hand: + + python3 scripts/generate_template.py > template.yaml +""" + +from __future__ import annotations + +# (case number, scenario class, extra properties). "target" adds a chained-invoke target function +# whose scenario class is the value; "timeout" overrides the execution timeout in seconds. +CASES = [ + (1, "Otel1Success", {}), + (2, "Otel2WaitResume", {}), + (3, "Otel3Retry", {}), + (4, "Otel4TerminalFailure", {}), + (5, "Otel5ChildContext", {}), + (6, "Otel6Parallel", {}), + (7, "Otel7Map", {}), + (8, "Otel8HandledFailure", {}), + (9, "Otel9WaitForCondition", {}), + (10, "Otel10WaitForCallback", {}), + (11, "Otel11ChainedInvoke", {"target": "Otel11InvokeTarget"}), + (12, "Otel12ChildContextFailure", {}), + (13, "Otel13ParallelFailure", {}), + (14, "Otel14MapFailure", {}), + (15, "Otel15WaitInterrupted", {"timeout": 15}), + (16, "Otel16WaitForConditionFailure", {}), + (17, "Otel17WaitForCallbackFailure", {}), + (18, "Otel18ChainedInvokeFailure", {"target": "Otel18InvokeTarget"}), + (19, "Otel19ExecutionFailure", {}), + (20, "Otel20VirtualContext", {}), + (21, "Otel21CompletedStepReplay", {}), + (22, "Otel22UserFunctionContext", {}), + (25, "Otel25CaughtCallbackFailureReplay", {}), + (26, "Otel26ExternalCompletionReplay", {}), + (27, "Otel27ChainedInvokeSuspend", {"target": "Otel27InvokeTarget"}), +] + +# Requirements the .NET SDK cannot express, reported NOT_IMPLEMENTED (non-blocking). Declared on case 1's function. +NOT_IMPLEMENTED = { + 23: "Needs a with-retry helper for durable child contexts; the .NET SDK has none.", + 24: "Needs a public way for a workflow to request an invocation retry; in .NET a workflow exception fails the execution.", +} + +VIEWS = ( + ("otel-invocation", "Invocation", "invocation"), + ("otel-execution", "Execution", "execution"), +) + +HEADER = """\ +AWSTemplateFormatVersion: "2010-09-09" +Transform: AWS::Serverless-2016-10-31 +Description: .NET SDK examples for the durable execution OTel conformance suites. Generated by scripts/generate_template.py. + +Parameters: + LambdaExecutionRoleArn: + Type: String + Description: Pre-created execution role for the test functions + OtelSuite: + Type: String + Default: all + AllowedValues: + - all + - otel-invocation + - otel-execution + Description: OpenTelemetry view whose functions should be deployed + OtelLayerArn: + Type: String + Description: Collector Lambda layer that receives the spans over OTLP (ADOT collector layer for X-Ray) + OtelCollectorLayerArn: + Type: String + Default: "" + Description: Optional OpenTelemetry Collector Lambda extension layer + OtelCollectorBucket: + Type: String + Default: "" + Description: S3 bucket where the collector writes OTLP trace objects + OtelCollectorPrefix: + Type: String + Default: "" + Description: S3 key prefix where the collector writes OTLP trace objects + OtelExecWrapper: + Type: String + Default: "" + Description: Lambda execution wrapper. Empty for .NET, which has no auto-instrumentation layer + OtelServiceName: + Type: String + Default: durable-execution-conformance + Description: OpenTelemetry resource service name + OtelTracesExporter: + Type: String + Default: otlp + Description: OpenTelemetry traces exporter selected by the runner + OtelExporterEndpoint: + Type: String + Default: "" + Description: Non-secret OTLP endpoint. Empty sends to the collector layer on localhost + OtelExporterHeaders: + Type: String + Default: "" + NoEcho: true + Description: Secret OTLP exporter headers supplied by the runner + OtelSecretEnvironmentNames: + Type: String + Default: "" + Description: Comma-separated secret environment variable names + +Conditions: + HasOtelCollectorLayer: !Not [!Equals [!Ref OtelCollectorLayerArn, ""]] + HasOtelExecWrapper: !Not [!Equals [!Ref OtelExecWrapper, ""]] + HasOtelExporterEndpoint: !Not [!Equals [!Ref OtelExporterEndpoint, ""]] + HasOtelExporterHeaders: !Not [!Equals [!Ref OtelExporterHeaders, ""]] + DeployInvocationView: !Or + - !Equals [!Ref OtelSuite, all] + - !Equals [!Ref OtelSuite, otel-invocation] + DeployExecutionView: !Or + - !Equals [!Ref OtelSuite, all] + - !Equals [!Ref OtelSuite, otel-execution] + +# The same bootstrap serves every function. CONFORMANCE_SCENARIO selects the case and OTEL_PLUGIN_MODE the view. +# publish/Makefile (written by scripts/build_examples.sh) copies the one published bundle into each artifact. +Globals: + Function: + Runtime: dotnet10 + Architectures: + - x86_64 + Timeout: 60 + MemorySize: 512 + Tracing: Active + Layers: !If + - HasOtelCollectorLayer + - [!Ref OtelLayerArn, !Ref OtelCollectorLayerArn] + - [!Ref OtelLayerArn] + DurableConfig: + ExecutionTimeout: 300 + RetentionPeriodInDays: 1 + Environment: + Variables: + AWS_LAMBDA_EXEC_WRAPPER: !If [HasOtelExecWrapper, !Ref OtelExecWrapper, !Ref "AWS::NoValue"] + OTEL_SERVICE_NAME: !Ref OtelServiceName + OTEL_TRACES_EXPORTER: !Ref OtelTracesExporter + OTEL_EXPORTER_OTLP_ENDPOINT: !If [HasOtelExporterEndpoint, !Ref OtelExporterEndpoint, "http://localhost:4318"] + OTEL_EXPORTER_OTLP_HEADERS: !If [HasOtelExporterHeaders, !Ref OtelExporterHeaders, !Ref "AWS::NoValue"] + OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf + OTEL_PROPAGATORS: xray + OTEL_TRACES_SAMPLER: always_on + OTEL_S3_BUCKET: !Ref OtelCollectorBucket + OTEL_S3_PREFIX: !Ref OtelCollectorPrefix + OPENTELEMETRY_COLLECTOR_CONFIG_URI: !If + - HasOtelCollectorLayer + - /opt/collector-config/config-s3.yaml + - /var/task/collector-xray.yaml + +Resources: +""" + + +def function(logical_id, condition, name, scenario, mode, extra, requirement=None): + """One function. requirement is the TestingMetadata id; targets of chained invokes have none.""" + lines = [f" {logical_id}:", " Type: AWS::Serverless::Function", f" Condition: {condition}", + " Metadata:", " BuildMethod: makefile"] + if requirement: + lines += [" TestingMetadata:", " TestDescription:", f" - {requirement}"] + if requirement.endswith("-1"): + view_id = requirement[: -len("-1")] + lines.append(" NotImplemented:") + for case, reason in NOT_IMPLEMENTED.items(): + lines += [f" - id: {view_id}-{case}", f" reason: {reason}"] + lines += [" Properties:", " CodeUri: publish/", " Handler: bootstrap", + f' FunctionName: !Sub "${{AWS::StackName}}-{name}"', + " Role: !Ref LambdaExecutionRoleArn"] + if "timeout" in extra: + lines += [" DurableConfig:", f" ExecutionTimeout: {extra['timeout']}", " RetentionPeriodInDays: 1"] + lines += [" Environment:", " Variables:", + f" CONFORMANCE_SCENARIO: {scenario}", + f" OTEL_PLUGIN_MODE: {mode}"] + if "target_id" in extra: + lines.append(f' OTEL_INVOKE_TARGET_FUNCTION_NAME: !Sub "${{{extra["target_id"]}.Arn}}:$LATEST"') + return "\n".join(lines) + "\n" + + +def main() -> None: + out = [HEADER] + for view_id, view_label, mode in VIEWS: + condition = f"Deploy{view_label}View" + for case, scenario, extra in CASES: + extra = dict(extra) + target = extra.pop("target", None) + if target: + extra["target_id"] = f"{view_label}{target}" + out.append(function(f"{view_label}{scenario}", condition, f"{view_id}-{case}", scenario, mode, extra, + requirement=f"{view_id}-{case}")) + if target: + out.append(function(f"{view_label}{target}", condition, f"{view_id}-{case}-target", target, mode, {})) + print("\n".join(out), end="") + + +if __name__ == "__main__": + main() diff --git a/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/template.yaml b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/template.yaml new file mode 100644 index 000000000..4720960c1 --- /dev/null +++ b/Libraries/test/Amazon.Lambda.DurableExecution.ConformanceTests.Otel/template.yaml @@ -0,0 +1,1116 @@ +AWSTemplateFormatVersion: "2010-09-09" +Transform: AWS::Serverless-2016-10-31 +Description: .NET SDK examples for the durable execution OTel conformance suites. Generated by scripts/generate_template.py. + +Parameters: + LambdaExecutionRoleArn: + Type: String + Description: Pre-created execution role for the test functions + OtelSuite: + Type: String + Default: all + AllowedValues: + - all + - otel-invocation + - otel-execution + Description: OpenTelemetry view whose functions should be deployed + OtelLayerArn: + Type: String + Description: Collector Lambda layer that receives the spans over OTLP (ADOT collector layer for X-Ray) + OtelCollectorLayerArn: + Type: String + Default: "" + Description: Optional OpenTelemetry Collector Lambda extension layer + OtelCollectorBucket: + Type: String + Default: "" + Description: S3 bucket where the collector writes OTLP trace objects + OtelCollectorPrefix: + Type: String + Default: "" + Description: S3 key prefix where the collector writes OTLP trace objects + OtelExecWrapper: + Type: String + Default: "" + Description: Lambda execution wrapper. Empty for .NET, which has no auto-instrumentation layer + OtelServiceName: + Type: String + Default: durable-execution-conformance + Description: OpenTelemetry resource service name + OtelTracesExporter: + Type: String + Default: otlp + Description: OpenTelemetry traces exporter selected by the runner + OtelExporterEndpoint: + Type: String + Default: "" + Description: Non-secret OTLP endpoint. Empty sends to the collector layer on localhost + OtelExporterHeaders: + Type: String + Default: "" + NoEcho: true + Description: Secret OTLP exporter headers supplied by the runner + OtelSecretEnvironmentNames: + Type: String + Default: "" + Description: Comma-separated secret environment variable names + +Conditions: + HasOtelCollectorLayer: !Not [!Equals [!Ref OtelCollectorLayerArn, ""]] + HasOtelExecWrapper: !Not [!Equals [!Ref OtelExecWrapper, ""]] + HasOtelExporterEndpoint: !Not [!Equals [!Ref OtelExporterEndpoint, ""]] + HasOtelExporterHeaders: !Not [!Equals [!Ref OtelExporterHeaders, ""]] + DeployInvocationView: !Or + - !Equals [!Ref OtelSuite, all] + - !Equals [!Ref OtelSuite, otel-invocation] + DeployExecutionView: !Or + - !Equals [!Ref OtelSuite, all] + - !Equals [!Ref OtelSuite, otel-execution] + +# The same bootstrap serves every function. CONFORMANCE_SCENARIO selects the case and OTEL_PLUGIN_MODE the view. +# publish/Makefile (written by scripts/build_examples.sh) copies the one published bundle into each artifact. +Globals: + Function: + Runtime: dotnet10 + Architectures: + - x86_64 + Timeout: 60 + MemorySize: 512 + Tracing: Active + Layers: !If + - HasOtelCollectorLayer + - [!Ref OtelLayerArn, !Ref OtelCollectorLayerArn] + - [!Ref OtelLayerArn] + DurableConfig: + ExecutionTimeout: 300 + RetentionPeriodInDays: 1 + Environment: + Variables: + AWS_LAMBDA_EXEC_WRAPPER: !If [HasOtelExecWrapper, !Ref OtelExecWrapper, !Ref "AWS::NoValue"] + OTEL_SERVICE_NAME: !Ref OtelServiceName + OTEL_TRACES_EXPORTER: !Ref OtelTracesExporter + OTEL_EXPORTER_OTLP_ENDPOINT: !If [HasOtelExporterEndpoint, !Ref OtelExporterEndpoint, "http://localhost:4318"] + OTEL_EXPORTER_OTLP_HEADERS: !If [HasOtelExporterHeaders, !Ref OtelExporterHeaders, !Ref "AWS::NoValue"] + OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf + OTEL_PROPAGATORS: xray + OTEL_TRACES_SAMPLER: always_on + OTEL_S3_BUCKET: !Ref OtelCollectorBucket + OTEL_S3_PREFIX: !Ref OtelCollectorPrefix + OPENTELEMETRY_COLLECTOR_CONFIG_URI: !If + - HasOtelCollectorLayer + - /opt/collector-config/config-s3.yaml + - /var/task/collector-xray.yaml + +Resources: + + InvocationOtel1Success: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-1 + NotImplemented: + - id: otel-invocation-23 + reason: Needs a with-retry helper for durable child contexts; the .NET SDK has none. + - id: otel-invocation-24 + reason: Needs a public way for a workflow to request an invocation retry; in .NET a workflow exception fails the execution. + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-1" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel1Success + OTEL_PLUGIN_MODE: invocation + + InvocationOtel2WaitResume: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-2 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-2" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel2WaitResume + OTEL_PLUGIN_MODE: invocation + + InvocationOtel3Retry: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-3 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-3" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel3Retry + OTEL_PLUGIN_MODE: invocation + + InvocationOtel4TerminalFailure: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-4 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-4" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel4TerminalFailure + OTEL_PLUGIN_MODE: invocation + + InvocationOtel5ChildContext: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-5 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-5" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel5ChildContext + OTEL_PLUGIN_MODE: invocation + + InvocationOtel6Parallel: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-6 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-6" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel6Parallel + OTEL_PLUGIN_MODE: invocation + + InvocationOtel7Map: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-7 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-7" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel7Map + OTEL_PLUGIN_MODE: invocation + + InvocationOtel8HandledFailure: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-8 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-8" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel8HandledFailure + OTEL_PLUGIN_MODE: invocation + + InvocationOtel9WaitForCondition: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-9 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-9" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel9WaitForCondition + OTEL_PLUGIN_MODE: invocation + + InvocationOtel10WaitForCallback: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-10 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-10" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel10WaitForCallback + OTEL_PLUGIN_MODE: invocation + + InvocationOtel11ChainedInvoke: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-11 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-11" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel11ChainedInvoke + OTEL_PLUGIN_MODE: invocation + OTEL_INVOKE_TARGET_FUNCTION_NAME: !Sub "${InvocationOtel11InvokeTarget.Arn}:$LATEST" + + InvocationOtel11InvokeTarget: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-11-target" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel11InvokeTarget + OTEL_PLUGIN_MODE: invocation + + InvocationOtel12ChildContextFailure: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-12 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-12" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel12ChildContextFailure + OTEL_PLUGIN_MODE: invocation + + InvocationOtel13ParallelFailure: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-13 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-13" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel13ParallelFailure + OTEL_PLUGIN_MODE: invocation + + InvocationOtel14MapFailure: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-14 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-14" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel14MapFailure + OTEL_PLUGIN_MODE: invocation + + InvocationOtel15WaitInterrupted: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-15 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-15" + Role: !Ref LambdaExecutionRoleArn + DurableConfig: + ExecutionTimeout: 15 + RetentionPeriodInDays: 1 + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel15WaitInterrupted + OTEL_PLUGIN_MODE: invocation + + InvocationOtel16WaitForConditionFailure: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-16 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-16" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel16WaitForConditionFailure + OTEL_PLUGIN_MODE: invocation + + InvocationOtel17WaitForCallbackFailure: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-17 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-17" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel17WaitForCallbackFailure + OTEL_PLUGIN_MODE: invocation + + InvocationOtel18ChainedInvokeFailure: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-18 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-18" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel18ChainedInvokeFailure + OTEL_PLUGIN_MODE: invocation + OTEL_INVOKE_TARGET_FUNCTION_NAME: !Sub "${InvocationOtel18InvokeTarget.Arn}:$LATEST" + + InvocationOtel18InvokeTarget: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-18-target" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel18InvokeTarget + OTEL_PLUGIN_MODE: invocation + + InvocationOtel19ExecutionFailure: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-19 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-19" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel19ExecutionFailure + OTEL_PLUGIN_MODE: invocation + + InvocationOtel20VirtualContext: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-20 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-20" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel20VirtualContext + OTEL_PLUGIN_MODE: invocation + + InvocationOtel21CompletedStepReplay: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-21 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-21" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel21CompletedStepReplay + OTEL_PLUGIN_MODE: invocation + + InvocationOtel22UserFunctionContext: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-22 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-22" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel22UserFunctionContext + OTEL_PLUGIN_MODE: invocation + + InvocationOtel25CaughtCallbackFailureReplay: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-25 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-25" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel25CaughtCallbackFailureReplay + OTEL_PLUGIN_MODE: invocation + + InvocationOtel26ExternalCompletionReplay: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-26 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-26" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel26ExternalCompletionReplay + OTEL_PLUGIN_MODE: invocation + + InvocationOtel27ChainedInvokeSuspend: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-invocation-27 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-27" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel27ChainedInvokeSuspend + OTEL_PLUGIN_MODE: invocation + OTEL_INVOKE_TARGET_FUNCTION_NAME: !Sub "${InvocationOtel27InvokeTarget.Arn}:$LATEST" + + InvocationOtel27InvokeTarget: + Type: AWS::Serverless::Function + Condition: DeployInvocationView + Metadata: + BuildMethod: makefile + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-invocation-27-target" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel27InvokeTarget + OTEL_PLUGIN_MODE: invocation + + ExecutionOtel1Success: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-1 + NotImplemented: + - id: otel-execution-23 + reason: Needs a with-retry helper for durable child contexts; the .NET SDK has none. + - id: otel-execution-24 + reason: Needs a public way for a workflow to request an invocation retry; in .NET a workflow exception fails the execution. + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-1" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel1Success + OTEL_PLUGIN_MODE: execution + + ExecutionOtel2WaitResume: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-2 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-2" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel2WaitResume + OTEL_PLUGIN_MODE: execution + + ExecutionOtel3Retry: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-3 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-3" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel3Retry + OTEL_PLUGIN_MODE: execution + + ExecutionOtel4TerminalFailure: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-4 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-4" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel4TerminalFailure + OTEL_PLUGIN_MODE: execution + + ExecutionOtel5ChildContext: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-5 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-5" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel5ChildContext + OTEL_PLUGIN_MODE: execution + + ExecutionOtel6Parallel: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-6 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-6" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel6Parallel + OTEL_PLUGIN_MODE: execution + + ExecutionOtel7Map: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-7 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-7" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel7Map + OTEL_PLUGIN_MODE: execution + + ExecutionOtel8HandledFailure: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-8 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-8" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel8HandledFailure + OTEL_PLUGIN_MODE: execution + + ExecutionOtel9WaitForCondition: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-9 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-9" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel9WaitForCondition + OTEL_PLUGIN_MODE: execution + + ExecutionOtel10WaitForCallback: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-10 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-10" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel10WaitForCallback + OTEL_PLUGIN_MODE: execution + + ExecutionOtel11ChainedInvoke: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-11 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-11" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel11ChainedInvoke + OTEL_PLUGIN_MODE: execution + OTEL_INVOKE_TARGET_FUNCTION_NAME: !Sub "${ExecutionOtel11InvokeTarget.Arn}:$LATEST" + + ExecutionOtel11InvokeTarget: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-11-target" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel11InvokeTarget + OTEL_PLUGIN_MODE: execution + + ExecutionOtel12ChildContextFailure: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-12 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-12" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel12ChildContextFailure + OTEL_PLUGIN_MODE: execution + + ExecutionOtel13ParallelFailure: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-13 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-13" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel13ParallelFailure + OTEL_PLUGIN_MODE: execution + + ExecutionOtel14MapFailure: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-14 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-14" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel14MapFailure + OTEL_PLUGIN_MODE: execution + + ExecutionOtel15WaitInterrupted: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-15 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-15" + Role: !Ref LambdaExecutionRoleArn + DurableConfig: + ExecutionTimeout: 15 + RetentionPeriodInDays: 1 + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel15WaitInterrupted + OTEL_PLUGIN_MODE: execution + + ExecutionOtel16WaitForConditionFailure: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-16 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-16" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel16WaitForConditionFailure + OTEL_PLUGIN_MODE: execution + + ExecutionOtel17WaitForCallbackFailure: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-17 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-17" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel17WaitForCallbackFailure + OTEL_PLUGIN_MODE: execution + + ExecutionOtel18ChainedInvokeFailure: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-18 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-18" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel18ChainedInvokeFailure + OTEL_PLUGIN_MODE: execution + OTEL_INVOKE_TARGET_FUNCTION_NAME: !Sub "${ExecutionOtel18InvokeTarget.Arn}:$LATEST" + + ExecutionOtel18InvokeTarget: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-18-target" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel18InvokeTarget + OTEL_PLUGIN_MODE: execution + + ExecutionOtel19ExecutionFailure: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-19 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-19" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel19ExecutionFailure + OTEL_PLUGIN_MODE: execution + + ExecutionOtel20VirtualContext: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-20 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-20" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel20VirtualContext + OTEL_PLUGIN_MODE: execution + + ExecutionOtel21CompletedStepReplay: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-21 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-21" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel21CompletedStepReplay + OTEL_PLUGIN_MODE: execution + + ExecutionOtel22UserFunctionContext: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-22 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-22" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel22UserFunctionContext + OTEL_PLUGIN_MODE: execution + + ExecutionOtel25CaughtCallbackFailureReplay: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-25 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-25" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel25CaughtCallbackFailureReplay + OTEL_PLUGIN_MODE: execution + + ExecutionOtel26ExternalCompletionReplay: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-26 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-26" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel26ExternalCompletionReplay + OTEL_PLUGIN_MODE: execution + + ExecutionOtel27ChainedInvokeSuspend: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + TestingMetadata: + TestDescription: + - otel-execution-27 + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-27" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel27ChainedInvokeSuspend + OTEL_PLUGIN_MODE: execution + OTEL_INVOKE_TARGET_FUNCTION_NAME: !Sub "${ExecutionOtel27InvokeTarget.Arn}:$LATEST" + + ExecutionOtel27InvokeTarget: + Type: AWS::Serverless::Function + Condition: DeployExecutionView + Metadata: + BuildMethod: makefile + Properties: + CodeUri: publish/ + Handler: bootstrap + FunctionName: !Sub "${AWS::StackName}-otel-execution-27-target" + Role: !Ref LambdaExecutionRoleArn + Environment: + Variables: + CONFORMANCE_SCENARIO: Otel27InvokeTarget + OTEL_PLUGIN_MODE: execution