Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import java.time.Instant;
import java.util.Map;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* Information provided at the end of a Lambda invocation.
Expand All @@ -18,9 +17,9 @@
* @param executionStartTime the stable start timestamp of the durable execution
* @param operations a snapshot of operations known when the invocation ended, keyed by operation ID
* @param invocationStatus the invocation outcome
* @param executionError non-null if the execution failed; this component is experimental
* @param executionInput the deserialized execution input; this component is experimental
* @param executionResult the value returned by a successful handler; this component is experimental
* @param executionError non-null if the execution failed
* @param executionInput the deserialized execution input
* @param executionResult the value returned by a successful handler
*/
public record InvocationEndInfo(
String requestId,
Expand All @@ -29,9 +28,9 @@ public record InvocationEndInfo(
Instant executionStartTime,
Map<String, OperationChangeItemInfo> operations,
InvocationStatus invocationStatus,
@Experimental Throwable executionError,
@Experimental Object executionInput,
@Experimental Object executionResult) {
Throwable executionError,
Object executionInput,
Object executionResult) {

/** Creates invocation-end information without execution payloads or operation state. */
public InvocationEndInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import java.time.Instant;
import java.util.Map;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* Invocation-level information available to plugin hooks.
Expand All @@ -20,10 +19,8 @@
* @param executionStartTime the start timestamp of the durable execution, taken from the initial EXECUTION operation in
* the first event delivered by the backend. Never null and stable across all invocations of the same execution.
* @param executionInput the deserialized execution input passed to the user handler, or null when unavailable
* @param operations checkpointed operations delivered at invocation start, keyed by operation ID; this component is
* experimental
* @param updatedOperations operations changed externally since the previous invocation, keyed by operation ID; this
* component is experimental
* @param operations checkpointed operations delivered at invocation start, keyed by operation ID
* @param updatedOperations operations changed externally since the previous invocation, keyed by operation ID
* @param xRayTraceId immutable invocation-local X-Ray header; null means unavailable and permits legacy carrier
* fallback, while an empty string means an available runtime supplied no header
*/
Expand All @@ -32,9 +29,9 @@ public record InvocationInfo(
String durableExecutionArn,
boolean isFirstInvocation,
Instant executionStartTime,
@Experimental Object executionInput,
@Experimental Map<String, OperationChangeItemInfo> operations,
@Experimental Map<String, OperationChangeItemInfo> updatedOperations,
Object executionInput,
Map<String, OperationChangeItemInfo> operations,
Map<String, OperationChangeItemInfo> updatedOperations,
String xRayTraceId) {

public InvocationInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import java.time.Instant;
import software.amazon.awssdk.services.lambda.model.OperationStatus;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* Operation-level information for an {@link OperationChangeInfo} and invocation operation snapshot.
Expand All @@ -19,8 +18,8 @@
* @param status operation status
* @param attempt attempt number for retriable operations, null for others
* @param isReplay true if this operation was present in state delivered at invocation start
* @param error non-null if the operation failed; this component is experimental
* @param result checkpointed serialized result, or null if unavailable; this component is experimental
* @param error non-null if the operation failed
* @param result checkpointed serialized result, or null if unavailable
*/
public record OperationChangeItemInfo(
String id,
Expand All @@ -33,8 +32,8 @@ public record OperationChangeItemInfo(
OperationStatus status,
Integer attempt,
boolean isReplay,
@Experimental Throwable error,
@Experimental String result) {
Throwable error,
String result) {

/** Returns a representation that omits the operation result payload. */
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package software.amazon.lambda.durable.plugin;

import java.time.Instant;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* Extended operation information for operation end events.
Expand All @@ -18,9 +17,8 @@
* @param status the operation's terminal status (e.g., SUCCEEDED, FAILED, TIMED_OUT) — may be null for virtual ops
* @param attempt the total number of attempts for retriable operations (STEP, WAIT_FOR_CONDITION) — null for others
* @param isReplay true if this operation already existed in the execution state (completed in a prior invocation)
* @param error non-null if the operation failed; this component is experimental
* @param result the serialized result of the operation, or null if the operation failed or has no result; this
* component is experimental
* @param error non-null if the operation failed
* @param result the serialized result of the operation, or null if the operation failed or has no result
*/
public record OperationEndInfo(
String id,
Expand All @@ -33,8 +31,8 @@ public record OperationEndInfo(
String status,
Integer attempt,
boolean isReplay,
@Experimental Throwable error,
@Experimental String result) {
Throwable error,
String result) {

/**
* Creates operation-end information without a result.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package software.amazon.lambda.durable.plugin;

import java.time.Instant;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* Information provided when a user function finishes executing.
Expand All @@ -20,7 +19,7 @@
* @param isReplay true if this operation was present in the checkpointed state delivered at invocation start
* @param attempt 1-based attempt number for steps/waitForCondition, null for context operations
* @param outcome the user function outcome
* @param error non-null if the user function failed or exited incompletely; this component is experimental
* @param error non-null if the user function failed or exited incompletely
*/
public record UserFunctionEndInfo(
String id,
Expand All @@ -33,4 +32,4 @@ public record UserFunctionEndInfo(
boolean isReplay,
Integer attempt,
UserFunctionOutcome outcome,
@Experimental Throwable error) {}
Throwable error) {}
6 changes: 1 addition & 5 deletions telemetry-exporter/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Durable Execution Telemetry Exporter (preview)
# Durable Execution Telemetry Exporter

Instrumentation plugin for the AWS Lambda Durable Execution Java SDK that emits a curated,
per-execution **Durable Execution Telemetry record** to one or more pluggable exporters. It ports the
JavaScript `durableExecutionTelemetry()` contract (canonical record schema `1.0`) to the Java plugin hook
surface.

> **Preview API.** Every public type is annotated
> `@software.amazon.lambda.durable.annotations.Experimental` to signal it is experimental and may
> change or be removed in a future release without a major-version bump.

## Usage

```java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
package software.amazon.lambda.durable.telemetry;

import software.amazon.lambda.durable.annotations.Experimental;

/**
* Parses the durable execution ARN into its component fields, mirroring the JS {@code parseExecutionArn}.
*
* <p>Format:
* {@code arn:<partition>:lambda:<region>:<accountId>:function:<functionName>:<qualifier>/durable-execution/<executionName>/<invocationId>}.
*/
@Experimental
public final class ArnParser {
private final String functionName;
private final String qualifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* Controls what data is included in emitted records (input/output transforms, operation overrides, error inclusion).
Expand All @@ -24,7 +23,6 @@
* the cached input snapshot or any later emission — and a non-fatal transform failure omits the field and is logged.
* VM/thread-termination errors propagate.
*/
@Experimental
public final class ContentConfig {
private final boolean includeInput;
private final Function<Object, Object> inputTransform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.services.lambda.model.ErrorObject;
import software.amazon.lambda.durable.annotations.Experimental;
import software.amazon.lambda.durable.exception.DurableOperationException;
import software.amazon.lambda.durable.exception.UnrecoverableDurableExecutionException;
import software.amazon.lambda.durable.plugin.DurableExecutionPluginFactory;
Expand Down Expand Up @@ -42,7 +41,6 @@
* {@link TelemetrySettings}, the exporters, and the {@link ExportScheduler} that serializes exports across every
* execution the environment hosts.
*/
@Experimental
public final class DurableExecutionTelemetry {

private static final Logger logger = LoggerFactory.getLogger(DurableExecutionTelemetry.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@

import java.util.ArrayList;
import java.util.List;
import software.amazon.lambda.durable.annotations.Experimental;

/** Configuration for the Durable Execution Telemetry plugin. Mirrors the JS {@code DurableExecutionTelemetryConfig}. */
@Experimental
public final class DurableExecutionTelemetryConfig {

/** When records are emitted. */
@Experimental
public enum EmitMode {
ON_COMPLETE,
ON_CHANGE,
ON_FAILURE
}

/** Which operations to include in each record's operations array. */
@Experimental
public enum OperationDetail {
TOP_LEVEL,
FULL_TREE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* The curated execution record emitted to destinations.
Expand All @@ -16,7 +15,6 @@
* identical (camelCase names, absent fields omitted). Exactly one of {@code operations} (array) or the
* {@code operationsByName} rendering is emitted, depending on the exporter's {@code render}.
*/
@Experimental
public final class DurableExecutionTelemetryRecord {
String recordType = "DurableExecutionTelemetry";
String schemaVersion = "1.0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.lambda.durable.annotations.Experimental;

/** Error detail carried on a record or operation, mirroring the JS {@code {name, message}} shape. */
@Experimental
public final class ErrorInfo {
private final String name;
private final String message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.lambda.durable.annotations.Experimental;
import software.amazon.lambda.durable.telemetry.internal.FatalErrors;

/** Minimal JSON helper for emitting telemetry records and measuring their serialized size. */
@Experimental
public final class Json {
// Register JavaTimeModule and emit ISO-8601 (not numeric timestamps) so SDK-default payload types such as
// java.time.Instant/Duration in an included input/output/result serialize instead of throwing and silently
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package software.amazon.lambda.durable.telemetry;

import java.util.function.Function;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* Per-operation override controlling inclusion and result transformation, matched by {@code operationName}.
Expand All @@ -15,7 +14,6 @@
* argument is safe, and a transform that throws omits the field (the failure is logged) rather than leaking the raw
* value or failing the execution. An {@code exclude} override drops the operation entirely.
*/
@Experimental
public final class OperationOverride {
private final String operationName;
private final boolean exclude;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@

import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* A single operation within an execution (step, wait, invoke, callback, or context).
*
* <p>Mirrors the JS {@code OperationRecord} interface field-for-field so the emitted wire JSON is identical. A
* {@code null} field is treated as <em>absent</em> and omitted from the wire map (distinct from an explicit JSON null).
*/
@Experimental
public final class OperationRecord {
private String id;
private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* A per-operation-name summary emitted (as an {@code operationsByName} map) by point-access exporters (CloudWatch
Expand All @@ -14,7 +13,6 @@
* {@code type}, {@code subType}, {@code status} reflect the most recently seen occurrence; {@code result}/{@code error}
* are included only when the name occurs exactly once.
*/
@Experimental
public final class OperationSummary {
String type;
String subType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* Builds a name-keyed index of operation summaries from the canonical operations array.
Expand All @@ -15,7 +14,6 @@
* {@code error} (no single representative value). Scalar fields ({@code type}, {@code subType}, {@code status}) reflect
* the most recently seen occurrence. Unnamed operations are skipped.
*/
@Experimental
public final class OperationsIndex {

private OperationsIndex() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
package software.amazon.lambda.durable.telemetry;

import software.amazon.lambda.durable.annotations.Experimental;

/** Exports workflow telemetry records to a destination. */
@Experimental
public interface TelemetryExporter {

/** Emits one record to the destination. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.Comparator;
import java.util.List;
import java.util.function.Function;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* Best-effort size limiter, porting the JS {@code truncateRecord} drop order:
Expand All @@ -23,7 +22,6 @@
* record is never mutated. {@code render} maps the record to the exact shape the exporter serializes so the size check
* measures what is actually emitted.
*/
@Experimental
public final class Truncation {

private Truncation() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import software.amazon.awssdk.services.rdsdata.model.ExecuteStatementRequest;
import software.amazon.awssdk.services.rdsdata.model.Field;
import software.amazon.awssdk.services.rdsdata.model.SqlParameter;
import software.amazon.lambda.durable.annotations.Experimental;
import software.amazon.lambda.durable.telemetry.DurableExecutionTelemetryRecord;
import software.amazon.lambda.durable.telemetry.Json;
import software.amazon.lambda.durable.telemetry.TelemetryExporter;
Expand All @@ -20,11 +19,9 @@
* per execution keyed by execution ARN. Requires the Data API enabled on the cluster, {@code rds-data:ExecuteStatement}
* and {@code secretsmanager:GetSecretValue}.
*/
@Experimental
public final class AuroraExporter implements TelemetryExporter {

/** Database engine; selects the upsert dialect. */
@Experimental
public enum Engine {
POSTGRESQL("postgresql"),
MYSQL("mysql");
Expand Down
Loading
Loading