The map {@code process-items} runs one iteration per item with max concurrency 1. The item namer names each
+ * iteration {@code item- The handler uses the event as the item list. The runner sends {@code [1, 2]}. The handler constructs no record and
+ * calls no exporter method. The plugin builds and exports the record.
+ */
+public final class Telemetry4FullTreeMap extends DurableHandler This overload holds the settings every handler shares: one CloudWatch Logs exporter, emit on completion, and a
+ * sampling rate of 1. The operation detail and content differ per requirement. telemetry-1 to telemetry-3 use
+ * top-level detail. telemetry-4 uses full-tree detail. So both are parameters.
+ *
+ * @param logGroupName the log group the exporter writes to
+ * @param operationDetail which operations the record keeps
+ * @param content the content section for the requirement the handler covers
+ * @return the plugin settings with the shared fields fixed
+ */
+ static DurableExecutionTelemetryConfig telemetryConfig(
+ String logGroupName,
+ DurableExecutionTelemetryConfig.OperationDetail operationDetail,
+ ContentConfig content) {
return DurableExecutionTelemetryConfig.builder()
.addExporter(CloudWatchLogsExporter.builder()
.logGroupName(logGroupName)
.build())
.emitMode(DurableExecutionTelemetryConfig.EmitMode.ON_COMPLETE)
.samplingRate(1.0)
- .operationDetail(DurableExecutionTelemetryConfig.OperationDetail.TOP_LEVEL)
+ .operationDetail(operationDetail)
.content(content)
.build();
}
+ /**
+ * Builds the telemetry-4 settings: the shared exporter and modes, full-tree operation detail, input and output
+ * included, and no overrides.
+ *
+ * Full-tree detail keeps the map iteration contexts and the steps inside them. telemetry-4 requires all five
+ * operations in {@code operationsByName}, so no filter and no override may remove one.
+ *
+ * @param logGroupName the log group the exporter writes to
+ * @return the plugin settings the telemetry-4 handler uses
+ */
+ static DurableExecutionTelemetryConfig fullTreeMapTelemetryConfig(String logGroupName) {
+ return telemetryConfig(
+ logGroupName,
+ DurableExecutionTelemetryConfig.OperationDetail.FULL_TREE,
+ ContentConfig.builder().input(true).output(true).build());
+ }
+
/**
* Builds the telemetry-3 settings: the shared exporter and modes, no input, no output, and one result override on
* {@link #RESULT_SELECT_STEP_NAME} that applies {@link #selectUserId(Object)}.
diff --git a/conformance-tests-telemetry/src/test/java/software/amazon/lambda/durable/conformance/telemetry/TelemetryConformanceConfigTest.java b/conformance-tests-telemetry/src/test/java/software/amazon/lambda/durable/conformance/telemetry/TelemetryConformanceConfigTest.java
index 39198b194..7bd2be190 100644
--- a/conformance-tests-telemetry/src/test/java/software/amazon/lambda/durable/conformance/telemetry/TelemetryConformanceConfigTest.java
+++ b/conformance-tests-telemetry/src/test/java/software/amazon/lambda/durable/conformance/telemetry/TelemetryConformanceConfigTest.java
@@ -10,6 +10,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static software.amazon.lambda.durable.telemetry.DurableExecutionTelemetryConfig.EmitMode.ON_COMPLETE;
+import static software.amazon.lambda.durable.telemetry.DurableExecutionTelemetryConfig.OperationDetail.FULL_TREE;
import static software.amazon.lambda.durable.telemetry.DurableExecutionTelemetryConfig.OperationDetail.TOP_LEVEL;
import java.util.Map;
@@ -103,4 +104,32 @@ void resultSelectTelemetryConfigOverridesTheStepResultWithTheSelectingTransform(
assertNotNull(override.result());
assertEquals(Map.of("userId", "u-123"), override.result().apply(PARSED_FETCH_USER_RESULT));
}
+
+ @Test
+ void fullTreeMapTelemetryConfigKeepsTheSharedSettings() {
+ var config = TelemetryConformanceConfig.fullTreeMapTelemetryConfig(LOG_GROUP);
+ assertEquals(1, config.exporters().size());
+ assertInstanceOf(CloudWatchLogsExporter.class, config.exporters().get(0));
+ assertEquals(ON_COMPLETE, config.emitMode());
+ assertEquals(1.0, config.samplingRate());
+ }
+
+ @Test
+ void fullTreeMapTelemetryConfigUsesFullTreeDetailWithInputOutputAndNoOverrides() {
+ var config = TelemetryConformanceConfig.fullTreeMapTelemetryConfig(LOG_GROUP);
+ assertEquals(FULL_TREE, config.operationDetail());
+ assertTrue(config.content().includeInput());
+ assertTrue(config.content().includeOutput());
+ assertTrue(config.content().overrides().isEmpty());
+ }
+
+ @Test
+ void otherConfigsStillUseTopLevelDetail() {
+ assertEquals(
+ TOP_LEVEL,
+ TelemetryConformanceConfig.telemetryConfig(LOG_GROUP).operationDetail());
+ assertEquals(
+ TOP_LEVEL,
+ TelemetryConformanceConfig.resultSelectTelemetryConfig(LOG_GROUP).operationDetail());
+ }
}
diff --git a/conformance-tests-telemetry/template.yaml b/conformance-tests-telemetry/template.yaml
index aa0b7aab4..085efdfe7 100644
--- a/conformance-tests-telemetry/template.yaml
+++ b/conformance-tests-telemetry/template.yaml
@@ -65,3 +65,14 @@ Resources:
CodeUri: .
Handler: software.amazon.lambda.durable.conformance.telemetry.Telemetry3ResultSelect
Role: !Ref LambdaExecutionRoleArn
+
+ Telemetry4FullTreeMap:
+ Type: AWS::Serverless::Function
+ DependsOn: TelemetryLogGroup
+ TestingMetadata:
+ TestDescription:
+ - telemetry-4
+ Properties:
+ CodeUri: .
+ Handler: software.amazon.lambda.durable.conformance.telemetry.Telemetry4FullTreeMap
+ Role: !Ref LambdaExecutionRoleArn
, List