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
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 @@ -10,7 +10,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 @@ -46,7 +45,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,7 +4,6 @@

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

/**
* Error detail carried on a record or operation: {@code {name, message, cause?}}, the shape shared by the Telemetry
Expand All @@ -15,7 +14,6 @@
* applied here, when the error is created, so it holds for the error and every cause. Applying it again leaves the
* value unchanged.
*/
@Experimental
public final class ErrorInfo {
/** Longest {@code name} or {@code message} written, in Unicode code points, before the {@code …} marker. */
static final int MAX_CHARS = 8_192;
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 @@ -7,7 +7,6 @@
import java.util.List;
import java.util.function.Function;
import java.util.function.Supplier;
import software.amazon.lambda.durable.annotations.Experimental;

/**
* Best-effort size limiter. When the record is over the limit it drops, in order:
Expand All @@ -29,7 +28,6 @@
* execution {@code error} and identity fields are never dropped, so a record can still be over a limit smaller than
* those fields.
*/
@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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import software.amazon.awssdk.services.cloudwatchlogs.model.CreateLogStreamRequest;
import software.amazon.awssdk.services.cloudwatchlogs.model.InputLogEvent;
import software.amazon.awssdk.services.cloudwatchlogs.model.PutLogEventsRequest;
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 @@ -21,7 +20,6 @@
* {@code operationsByName} map. Mirrors the JS {@code CloudWatchLogsExporter}. Requires {@code logs:CreateLogStream}
* and {@code logs:PutLogEvents} on the target log group.
*/
@Experimental
public final class CloudWatchLogsExporter implements TelemetryExporter {
private final String logGroupName;
private final String logStreamPrefix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
import software.amazon.awssdk.services.dynamodb.model.PutItemRequest;
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 @@ -21,7 +20,6 @@
* default sort key ({@code emittedAt}) every export adds a history item; with the sort key disabled each export
* overwrites the execution's item. Emits the {@code operationsByName} map. Requires {@code dynamodb:PutItem}.
*/
@Experimental
public final class DynamoDBExporter implements TelemetryExporter {
private final String tableName;
private final String partitionKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import software.amazon.awssdk.services.eventbridge.model.PutEventsRequestEntry;
import software.amazon.awssdk.services.eventbridge.model.PutEventsResponse;
import software.amazon.awssdk.services.eventbridge.model.PutEventsResultEntry;
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 @@ -18,7 +17,6 @@
* Exports workflow telemetry records to Amazon EventBridge, one PutEvents entry per record with the record status as
* {@code DetailType} and the record JSON as {@code Detail}. Requires {@code events:PutEvents}.
*/
@Experimental
public final class EventBridgeExporter implements TelemetryExporter {
/**
* Default event source. The {@code aws.} prefix is reserved for AWS service events and is rejected by PutEvents.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.Map;
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 @@ -21,11 +20,9 @@
* (default), or written as one pretty-printed JSON file per execution that later exports overwrite. Suitable for an EFS
* mount or {@code /tmp}. No truncation limit by default.
*/
@Experimental
public final class FileExporter implements TelemetryExporter {

/** File layout. */
@Experimental
public enum Mode {
/** Append every record to {@code {directory}/{YYYY-MM-DD}.ndjson}. */
NDJSON("ndjson"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import software.amazon.awssdk.services.firehose.FirehoseClient;
import software.amazon.awssdk.services.firehose.model.PutRecordRequest;
import software.amazon.awssdk.services.firehose.model.Record;
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 @@ -17,7 +16,6 @@
* Exports workflow telemetry records to Amazon Data Firehose, one PutRecord per record as a newline-terminated JSON
* line so concatenated deliveries stay parseable as NDJSON. Requires {@code firehose:PutRecord}.
*/
@Experimental
public final class FirehoseExporter implements TelemetryExporter {
private final String deliveryStreamName;
private final OperationsFormat operationsFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.Map;
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 @@ -21,11 +20,9 @@
* Exports workflow telemetry records to an HTTP endpoint as a JSON body, one request per record. A non-2xx response
* fails the export. No truncation limit by default; set one if the endpoint caps request size.
*/
@Experimental
public final class HttpExporter implements TelemetryExporter {

/** Request method. */
@Experimental
public enum Method {
POST,
PUT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.time.Instant;
import java.util.LinkedHashMap;
import java.util.Map;
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 Down Expand Up @@ -34,7 +33,6 @@
* application log level filtering is unchanged: with the JSON log format and an application log level of {@code WARN}
* or above, these lines are dropped, as raw record lines were before.
*/
@Experimental
public final class LambdaLogExporter implements TelemetryExporter {
/** UTF-8 size of the envelope around an empty {@code message}; the timestamp always has the same width. */
private static final int ENVELOPE_BYTES =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
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.DurableExecutionTelemetryRecord;
import software.amazon.lambda.durable.telemetry.Json;
import software.amazon.lambda.durable.telemetry.TelemetryExporter;
Expand All @@ -24,11 +23,9 @@
* record with identity fields as resource and log attributes and the full record JSON as the body. Compatible with any
* OTLP-capable backend; authentication is via headers.
*/
@Experimental
public final class OTelExporter implements TelemetryExporter {

/** OTLP transport encoding. */
@Experimental
public enum Protocol {
HTTP_JSON("http/json"),
HTTP_PROTOBUF("http/protobuf");
Expand Down
Loading
Loading