You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6b311bb
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/advanced/configuration.md
+56-1Lines changed: 56 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,4 +38,59 @@ public class OrderProcessor extends DurableHandler<Order, OrderResult> {
38
38
|`withPollingStrategy()`| Backend polling strategy | Exponential backoff: 1s base, 2x rate, FULL jitter, 10s max |
39
39
|`withCheckpointDelay()`| How often the SDK checkpoints updates |`Duration.ofSeconds(0)` (as soon as possible) |
40
40
41
-
The `withExecutorService()` option configures the thread pool used for running user-defined operations. Internal SDK coordination (checkpoint batching, polling) runs on an SDK-managed thread pool.
41
+
The `withExecutorService()` option configures the thread pool used for running user-defined operations. Internal SDK coordination (checkpoint batching, polling) runs on an SDK-managed thread pool.
42
+
43
+
### Dynamic plugin loading
44
+
45
+
Dynamic plugin loading is an experimental, opt-in alternative to registering plugins in application code. Put provider JARs on the application class path, then set `DURABLE_EXECUTION_PLUGINS` to an ordered, comma-separated list of provider names:
When the variable is unset or blank, the SDK does not perform provider discovery. During `DurableConfig` construction, the SDK uses `ServiceLoader` and the thread context class loader to find `DurableExecutionPluginProvider` implementations. Only named providers create plugins.
52
+
53
+
Dynamically loaded plugins run first in the order listed in `DURABLE_EXECUTION_PLUGINS`. Plugins registered through `withPlugins(...)` follow in configuration order. Both sources are additive: if the same plugin type is selected dynamically and registered explicitly, both instances are registered and receive lifecycle hooks. Duplicate configured provider names, duplicate discovered provider names, missing providers, incompatible provider API versions, invalid plugin types, and provider construction failures stop configuration with an `IllegalStateException`.
54
+
55
+
To distribute a provider in a Lambda layer, package its JAR under `java/lib`:
Provider-specific settings can use namespaced environment variables. If an application shades provider JARs into one artifact, its build must preserve and merge `META-INF/services` entries.
Copy file name to clipboardExpand all lines: otel-plugin/README.md
+22-6Lines changed: 22 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ OpenTelemetry instrumentation plugin for the AWS Lambda Durable Execution SDK fo
11
11
-**Attempt Spans**: Each user function execution (step attempt, child context run) gets a span, including retries
12
12
-**Log Correlation**: Injects `trace_id`, `span_id`, and `traceSampled` into SLF4J MDC for end-to-end observability
13
13
-**ADOT Java Agent Integration**: `new InvocationOtelPlugin()` uses the ADOT Java agent's global provider with no handler-side OpenTelemetry initialization
14
+
-**Lambda Layer Discovery**: `DURABLE_EXECUTION_PLUGINS` loads either OTel plugin from a JAR under a layer's `java/lib` directory
14
15
15
16
## Installation
16
17
@@ -44,7 +45,7 @@ If you configure your own `SdkTracerProviderBuilder`, add the OpenTelemetry SDK
44
45
1. Add the ADOT Lambda Layer to your function
45
46
2. Enable X-Ray Active Tracing on the function
46
47
3. Configure environment variables
47
-
4.Register`InvocationOtelPlugin` in your handler's `DurableConfig`
48
+
4.Load`InvocationOtelPlugin` dynamically or register it in your handler's `DurableConfig`
Set `OTEL_JAVAAGENT_EXTENSIONS` to the deployed OTel plugin jar that contains this plugin's `META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider` entry.
91
+
Build the plugin layer ZIP with the OTel plugin JAR at `java/lib/aws-durable-execution-sdk-java-plugin-otel-<version>.jar`. Lambda adds JARs in this directory to the Java class path. Set `OTEL_JAVAAGENT_EXTENSIONS` to the deployed JAR so the ADOT Java agent also loads its `AutoConfigurationCustomizerProvider`, and set `DURABLE_EXECUTION_PLUGINS=otel-invocation` so the Durable Execution SDK loads its `InvocationOtelPluginProvider`.
89
92
90
93
### 2. AWS X-Ray Active Tracing
91
94
@@ -102,7 +105,20 @@ MyFunction:
102
105
Tracing: Active
103
106
```
104
107
105
-
### 3. In Your Lambda Handler
108
+
### 3. Plugin Registration
109
+
110
+
With the layer and `DURABLE_EXECUTION_PLUGINS=otel-invocation` configured above, no OTel plugin dependency or registration code is required in the function artifact. The function can use its existing `DurableConfig`.
111
+
112
+
The OTel plugin JAR exposes two dynamic provider names:
0 commit comments