Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8927f7a
docs: simplify and update OpenTelemetry guide
zhongkechen Oct 28, 2026
ba690dd
docs: remove stale experimental OTel warning
zhongkechen Oct 28, 2026
05ed660
docs: explain OTel plugin discovery values
zhongkechen Oct 28, 2026
c3cc755
docs: refresh OTel status and export guidance
zhongkechen Nov 3, 2026
0a7966b
docs: split OTLP ancestor guidance for review
zhongkechen Nov 3, 2026
8a80579
docs: shorten OTel release and replay guidance
zhongkechen Nov 3, 2026
ab347b4
docs: retain the plugin selection comparison
zhongkechen Nov 3, 2026
e7ae89a
docs: explain X-Ray-only ancestors in OTLP (#306)
zhongkechen Nov 3, 2026
546679c
docs: include sampling guidance in combined PR
zhongkechen Nov 3, 2026
56c6e72
docs: use unified OTel factory initialization
zhongkechen Nov 4, 2026
d5fae53
docs: fix configured OTel factory examples
zhongkechen Nov 4, 2026
cfef0e4
docs: correct attempt attributes and the one-view contract
zhongkechen Nov 4, 2026
269b991
docs: clarify OTel permissions and exclusivity
zhongkechen Nov 4, 2026
977dffb
docs: wrap the OTel alias conflict error in a code block
zhongkechen Nov 4, 2026
3ec8f65
docs: simplify Java plugin version wording
zhongkechen Nov 6, 2026
3f871d3
docs(otel): restore span hierarchy diagrams
zhongkechen Nov 9, 2026
4ae0aa0
docs(otel): consolidate community layer setup
zhongkechen Nov 9, 2026
ee599e7
docs(otel): describe Python 2.1.0 behavior
zhongkechen Nov 9, 2026
3a88b7f
docs(otel): clarify sampling version scope
zhongkechen Nov 9, 2026
e1ec159
docs(otel): clarify span attribute availability
zhongkechen Nov 9, 2026
84e1786
docs(otel): document aliases by language
zhongkechen Nov 9, 2026
bfddbf8
docs(otel): shorten community layer guidance
zhongkechen Nov 9, 2026
5e52eae
docs(otel): remove unsupported W3C extractors
zhongkechen Nov 9, 2026
7f66007
docs(otel): move Java troubleshooting into tab
zhongkechen Nov 9, 2026
6ece9da
docs(otel): add concise collector guidance
zhongkechen Nov 9, 2026
26d7a52
docs(otel): restore copyable setup examples
zhongkechen Nov 10, 2026
17e898a
docs: merge main into OpenTelemetry guide
zhongkechen Nov 10, 2026
5bd995b
docs: retain SAM structure in telemetry examples
zhongkechen Nov 10, 2026
9c49c02
docs: clarify when custom providers are needed
zhongkechen Nov 10, 2026
7ea0c7d
docs: clarify CloudWatch OTLP prerequisite
zhongkechen Nov 10, 2026
e79890a
docs: show trace fields in log examples
Nov 10, 2026
e109152
docs: add Java log correlation example
Nov 10, 2026
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: 5 additions & 1 deletion docs/sdk-reference/languages/java/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,13 @@ Java can also load plugin providers from the application class path. Set
`DURABLE_EXECUTION_PLUGINS` to an ordered, comma-separated list of provider names:

```text
DURABLE_EXECUTION_PLUGINS=otel-invocation,com.example.audit
DURABLE_EXECUTION_PLUGINS=otel,com.example.audit
```

The `otel` provider selects the default
[OpenTelemetry execution view](../../observability/opentelemetry.md#execution-view)
and requires SDK/plugin 3.1.0 or later.

The SDK discovers `DurableExecutionPluginProvider` implementations with `ServiceLoader`
and selects the providers named in the environment variable. Each provider implements
`createPlugin(InvocationInfo)` to return a fresh plugin instance. Selected dynamically
Expand Down
16 changes: 12 additions & 4 deletions docs/sdk-reference/observability/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,11 @@ You can change where the SDK's logger sends its entries.

=== "TypeScript"

Any object that implements `DurableLogger` works. Pass it to `configureLogger`.
Pass an object that implements `DurableLogger` to `configureLogger`. To
include execution metadata and plugin fields, the logger must also implement
`configureDurableLoggingContext`. Store the supplied context and read
`getDurableLogData()` and `getLogEnrichment?.()` on each log call.
`createPowertoolsLogger` handles this for a Powertools logger:

```typescript
--8<-- "examples/typescript/sdk-reference/observability/custom-logger.ts"
Expand Down Expand Up @@ -811,14 +815,18 @@ You can change where the SDK's logger sends its entries.

## Powertools for AWS Lambda

[Powertools for AWS Lambda](https://docs.aws.amazon.com/powertools/) provides a
structured logger that works as a drop-in replacement for the SDK's default logger.
[Powertools for AWS Lambda](https://docs.aws.amazon.com/powertools/) provides structured
logging that you can use with the SDK.

=== "TypeScript"

The
[Powertools for AWS Lambda (TypeScript)](https://docs.aws.amazon.com/powertools/typescript/latest/features/logger/)
`Logger` satisfies the `DurableLogger` interface. Pass it via `configureLogger`.
`Logger` works with `createPowertoolsLogger`. Pass the wrapped logger via
`configureLogger` so each entry includes execution metadata and fields added
by plugins, such as OpenTelemetry trace IDs. See
[log correlation](opentelemetry.md#correlate-logs-and-verify-traces) for an example
with the OpenTelemetry plugin.

```typescript
--8<-- "examples/typescript/sdk-reference/observability/powertools-logger.ts"
Expand Down
1,192 changes: 537 additions & 655 deletions docs/sdk-reference/observability/opentelemetry.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import software.amazon.lambda.durable.DurableConfig;
import software.amazon.lambda.durable.DurableContext;
import software.amazon.lambda.durable.DurableHandler;
import software.amazon.lambda.durable.otel.ExecutionOtelPlugin;
import software.amazon.lambda.durable.otel.OtelPlugin;

public class ExecutionOtelExample extends DurableHandler<Map<String, String>, String> {
@Override
protected DurableConfig createConfiguration() {
return DurableConfig.builder().withPlugins(new ExecutionOtelPlugin()).build();
return DurableConfig.builder().withPlugins(OtelPlugin.factory()).build();
}

@Override
protected String handleRequest(Map<String, String> event, DurableContext context) {
public String handleRequest(Map<String, String> event, DurableContext context) {
String data = context.step("fetch-data", String.class, ctx -> event.get("id"));
context.wait("cooldown", Duration.ofSeconds(5));
return context.step("process", String.class, ctx -> "processed " + data);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import software.amazon.lambda.durable.DurableConfig;
import software.amazon.lambda.durable.DurableContext;
import software.amazon.lambda.durable.DurableHandler;
import software.amazon.lambda.durable.otel.InvocationOtelPlugin;
import software.amazon.lambda.durable.otel.OtelPlugin;

public class InvocationOtelExample extends DurableHandler<Object, String> {
@Override
protected DurableConfig createConfiguration() {
return DurableConfig.builder().withPlugins(new InvocationOtelPlugin()).build();
return DurableConfig.builder().withPlugins(OtelPlugin.factory(OtelPlugin.Mode.INVOCATION)).build();
}

@Override
protected String handleRequest(Object event, DurableContext context) {
public String handleRequest(Object event, DurableContext context) {
return context.step("process", String.class, ctx -> "done");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%msg traceId=%X{traceId:--} spanId=%X{spanId:--} otelTraceSampled=%X{otelTraceSampled:--}%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import java.util.Map;
import org.slf4j.LoggerFactory;
import software.amazon.lambda.durable.DurableConfig;
import software.amazon.lambda.durable.DurableContext;
import software.amazon.lambda.durable.DurableHandler;
import software.amazon.lambda.durable.otel.OtelPlugin;

public class LogCorrelationExample extends DurableHandler<Map<String, String>, String> {
static {
LoggerFactory.getLogger(LogCorrelationExample.class).info("Function initialized");
}

@Override
protected DurableConfig createConfiguration() {
return DurableConfig.builder().withPlugins(OtelPlugin.factory()).build();
}

@Override
public String handleRequest(Map<String, String> event, DurableContext context) {
context.getLogger().info("Processing request");
return context.step("process", String.class, stepContext -> {
stepContext.getLogger().info("Processing step");
return "done";
});
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from aws_durable_execution_sdk_python import DurableContext, durable_execution
from aws_durable_execution_sdk_python.config import Duration
from aws_durable_execution_sdk_python_otel import ExecutionOtelPlugin
from aws_durable_execution_sdk_python_otel import create_otel_plugin_factory


@durable_execution(plugins=[ExecutionOtelPlugin()])
@durable_execution(plugins=[create_otel_plugin_factory()])
def handler(event: dict, context: DurableContext) -> str:
data = context.step(lambda ctx: event["id"], name="fetch-data")
context.wait(Duration.from_seconds(5), name="cooldown")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from aws_durable_execution_sdk_python import DurableContext, durable_execution
from aws_durable_execution_sdk_python_otel import InvocationOtelPlugin
from aws_durable_execution_sdk_python_otel import create_otel_plugin_factory


@durable_execution(plugins=[InvocationOtelPlugin()])
@durable_execution(plugins=[create_otel_plugin_factory(mode="invocation")])
def handler(event: dict, context: DurableContext) -> str:
return context.step(lambda ctx: "done", name="process")
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import logging

from aws_durable_execution_sdk_python import DurableContext, durable_execution
from aws_durable_execution_sdk_python_otel import create_otel_plugin_factory


root_logger = logging.getLogger()
root_logger.setLevel(logging.INFO)
formatter = logging.Formatter(
"%(message)s traceId=%(traceId)s spanId=%(spanId)s "
"otelTraceSampled=%(otelTraceSampled)s",
defaults={"traceId": "-", "spanId": "-", "otelTraceSampled": "-"},
)
for log_handler in root_logger.handlers:
log_handler.setFormatter(formatter)

root_logger.info("Function initialized")


@durable_execution(plugins=[create_otel_plugin_factory()])
def handler(event: dict, context: DurableContext) -> str:
context.logger.info("Processing request")
return "done"
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { DurableContext, withDurableExecution } from "@aws/durable-execution-sdk-js";
import {
createPowertoolsLogger,
DurableContext,
withDurableExecution,
} from "@aws/durable-execution-sdk-js";
import { Logger } from "@aws-lambda-powertools/logger";

const powertoolsLogger = new Logger({ serviceName: "my-service" });

export const handler = withDurableExecution(async (event, context: DurableContext) => {
context.configureLogger({ customLogger: powertoolsLogger });
context.configureLogger({ customLogger: createPowertoolsLogger(powertoolsLogger) });
context.logger.info("Using Powertools logger");
});
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { DurableContext, withDurableExecution } from "@aws/durable-execution-sdk-js";
import { ExecutionOtelPlugin } from "@aws/durable-execution-sdk-js-otel";
import { createOtelPluginFactory } from "@aws/durable-execution-sdk-js-otel";

export const handler = withDurableExecution(
async (event: { id: string }, context: DurableContext) => {
const data = await context.step("fetch-data", async () => event.id);
await context.wait("cooldown", { seconds: 5 });
return await context.step("process", async () => `processed ${data}`);
},
{ plugins: [new ExecutionOtelPlugin()] },
{ plugins: [createOtelPluginFactory()] },
);
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { DurableContext, withDurableExecution } from "@aws/durable-execution-sdk-js";
import { InvocationOtelPlugin } from "@aws/durable-execution-sdk-js-otel";
import { createOtelPluginFactory } from "@aws/durable-execution-sdk-js-otel";

export const handler = withDurableExecution(
async (event, context: DurableContext) => {
return await context.step("process", async () => "done");
},
{ plugins: [new InvocationOtelPlugin()] },
{ plugins: [createOtelPluginFactory({ mode: "invocation" })] },
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Logger } from "@aws-lambda-powertools/logger";
import {
createPowertoolsLogger,
DurableContext,
withDurableExecution,
} from "@aws/durable-execution-sdk-js";
import { createOtelPluginFactory } from "@aws/durable-execution-sdk-js-otel";

const logger = createPowertoolsLogger(new Logger({ serviceName: "orders" }));

export const handler = withDurableExecution(
async (_event: unknown, context: DurableContext) => {
context.configureLogger({ customLogger: logger });
context.logger.info("Processing order");
return "processed";
},
{ plugins: [createOtelPluginFactory()] },
);
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { Logger } from '@aws-lambda-powertools/logger';
import { DurableContext, withDurableExecution } from "@aws/durable-execution-sdk-js";
import { Logger } from "@aws-lambda-powertools/logger";
import {
createPowertoolsLogger,
DurableContext,
withDurableExecution,
} from "@aws/durable-execution-sdk-js";

const powertoolsLogger = new Logger({ serviceName: 'my-service' });
const powertoolsLogger = new Logger({ serviceName: "my-service" });

export const handler = withDurableExecution(async (event, context: DurableContext) => {
context.configureLogger({ customLogger: powertoolsLogger });
context.logger.info('Running handler');
context.configureLogger({ customLogger: createPowertoolsLogger(powertoolsLogger) });
context.logger.info("Running handler");
});
Loading