Repository navigation
docs(observability): add Durable Execution Telemetry pages - #296
ParidelPooya wants to merge 7 commits into
Conversation
| `SUCCEEDED`, or `FAILED`. A suspended or retrying execution reports `RUNNING`. `endTime` | ||
| and `durationMs` appear only once the execution finishes. |
There was a problem hiding this comment.
suggestion: Not in on-change mode. TypeScript and Java also set endTime and durationMs on the RUNNING record sent at the end of each invocation. I'd fix the SDKs. Until then, this sentence needs the exception.
| Destinations with a time type store the value in that type. Aurora and Redshift use | ||
| `TIMESTAMPTZ` columns, OpenSearch maps the fields as `date`, and the Athena table that |
There was a problem hiding this comment.
nit: Only on Aurora PostgreSQL. With engine: "mysql", the exporter writes plain strings.
| Error names are not the same across languages. Each SDK reports its own type names, so | ||
| the same failure can be `StepError` in TypeScript, | ||
| `aws_durable_execution_sdk_python.exceptions.StepError` in Python, and | ||
| `StepFailedException` in Java. Query `error.name` per SDK, or query on `message` and the | ||
| `cause` chain. |
There was a problem hiding this comment.
blocker: I ran a failing step, with no retries and no catch, in TypeScript, Python, and Java. Java never reported StepFailedException. Python and Java name the execution error and the operation error differently. This wording matches what each SDK wrote:
| Error names are not the same across languages. Each SDK reports its own type names, so | |
| the same failure can be `StepError` in TypeScript, | |
| `aws_durable_execution_sdk_python.exceptions.StepError` in Python, and | |
| `StepFailedException` in Java. Query `error.name` per SDK, or query on `message` and the | |
| `cause` chain. | |
| Error names are not the same across SDKs. For a step that throws `PaymentError`, | |
| TypeScript reports `StepError` for both the execution and the operation, with | |
| `PaymentError` as the `cause`. Python reports | |
| `aws_durable_execution_sdk_python.exceptions.StepError` for the execution and the thrown | |
| type's qualified name, such as `orders.PaymentError`, for the operation. Java reports | |
| the thrown class's simple name, `PaymentError`, for the execution and its fully | |
| qualified name, such as `com.example.PaymentError`, for the operation. So query the | |
| execution `error.name` and `operations[].error.name` separately for each SDK, or query | |
| on `message`. |
| Destinations that cannot filter an array element by name store an `operationsByName` | ||
| map instead of the `operations` array. The exporters for CloudWatch Logs and DynamoDB use |
There was a problem hiding this comment.
blocker: Not true for Go. Its CloudWatch Logs, Lambda log, and DynamoDB exporters write the operations array, and its DynamoDB item stores the record as a recordJson string. Please say so in the Go tab.
There was a problem hiding this comment.
| this shape. Each key is an operation name. Each value aggregates every occurrence of | ||
| that name with `count`, `failedCount`, `minDurationMs`, `maxDurationMs`, | ||
| `totalDurationMs`, `maxAttempt`, and the latest `status`. A query can then reach an |
There was a problem hiding this comment.
suggestion: Each value also has the latest type and subType. result and error appear only when the name ran once.
| ```json | ||
| { | ||
| "source": ["aws.lambda"], | ||
| "detail-type": ["Lambda Durable Execution State Change"], |
There was a problem hiding this comment.
blocker: Lambda's detail type is Durable Execution Status Change (Monitoring durable functions), so this rule matches nothing.
| "detail-type": ["Lambda Durable Execution State Change"], | |
| "detail-type": ["Durable Execution Status Change"], |
| [exporter](exporter.md) writes. It is a local server that speaks the | ||
| [Model Context Protocol](https://modelcontextprotocol.io) (MCP) over stdio, so any | ||
| MCP-capable agent, such as Kiro, Claude Code, or Cursor, can use it. |
There was a problem hiding this comment.
blocker: The tools read the TypeScript, Python, and Java record shape only. Go writes startTimestamp, so since and until filters skip Go records. Go's Lambda log line has no level/message envelope, so list_executions on lambda-log-exporter returns none. Please say which SDKs the tools support.
| `--scope project` writes `.mcp.json` at the repository root. The default user scope | ||
| writes `~/.claude.json`. |
There was a problem hiding this comment.
nit: The default scope is local, not user (MCP installation scopes).
| `--scope project` writes `.mcp.json` at the repository root. The default user scope | |
| writes `~/.claude.json`. | |
| `--scope project` writes `.mcp.json` at the repository root. The default scope, | |
| `local`, stores the server in `~/.claude.json` for this project only. |
| Every result holds at most 1,000 rows. A smaller `limit` returns fewer rows. A result | ||
| with `truncated: true` means the store may hold more matching data, so narrow the | ||
| filters instead of assuming the result is complete. | ||
|
|
||
| CloudWatch Logs Insights queries always cover a time window. `list_executions` derives | ||
| the window from `since`. `query` covers the last 24 hours and `get_execution` the last 7 | ||
| days unless you pass `lookbackHours`. Each tool reports the window it searched in | ||
| `searchedLookbackHours`. So on a log destination, `found: false` from `get_execution` | ||
| means the record is not in that window. |
There was a problem hiding this comment.
suggestion: Three corrections:
- A Logs Insights
querywith its ownlimitor astatsgets no| limit 1000, so it can return more than 1,000 rows. querydoes not returnsearchedLookbackHours. Onlylist_executionsandget_executiondo.get_executionalso returnsfound: falsewhen the Logs Insights call fails, for example withAccessDenied.
| public Map<String, String> handleRequest(Map<String, String> event, DurableContext context) { | ||
| String order = context.step("fetch-order", String.class, ctx -> event.get("orderId")); | ||
| context.wait("cooldown", Duration.ofSeconds(5)); | ||
| return Map.of("orderId", order, "status", "processed"); |
There was a problem hiding this comment.
blocker: The other languages run a process step here, so their records have three operations and this one has two. This matches them, compiles against 3.0.0, and records all three:
| return Map.of("orderId", order, "status", "processed"); | |
| return context.step("process", Map.class, ctx -> Map.of("orderId", order, "status", "processed")); |
Summary
This PR adds a Durable Execution Telemetry section under SDK Reference → Observability. The section has three pages:
telemetry/index.md):operationsandoperationsByNameshapestelemetry/exporter.md):STOPPEDandTIMED_OUTexecutionstelemetry/mcp.md):It also adds the three pages to the navigation in
zensical.toml. It adds links to the new pages fromplugins.mdand from the OpenTelemetry page's "See also" list.The pages have tabs for TypeScript, Python, Java, and Go. The exporter is not available for C#, so the pages state that and have no C# examples. The OpenTelemetry page handles Go and C# the same way.
Examples
Each language has three examples under
examples/<lang>/sdk-reference/observability/telemetry/:basic-usage,multiple-exporters, andredact-content. All four languages use the same handler.I checked every example against the merged SDK code:
tsc --strictpasses.basic-usageandredact-contentran underLocalDurableTestRunner.basic-usagewrote exactly oneDurableExecutionTelemetryrecord through the default exporter.ruff formatandruff checkpass. All three examples ran underDurableFunctionTestRunner. The AWS clients were mocked formultiple-exporters.3.0.0-SNAPSHOT.basic-usageand the transforms inredact-contentran underLocalDurableTestRunner.go build,go vet, andgofmtpass, with the module built from the repository'smainbranch.basic-usageandredact-contentran underdurabletest.Checks
These pass locally:
mdformat --check docs/codespell docs/zensical build --clean, which reports "No issues found"Merge timing
This site deploys on every push to
main. The packages these pages tell readers to install are not all published yet:@aws/durable-execution-sdk-js-telemetry-exporter@aws/durable-execution-sdk-js-telemetry-mcpaws-durable-execution-sdk-python-telemetry-exporteraws-durable-execution-sdk-java-plugin-telemetry-exportergithub.com/aws/aws-durable-execution-sdk-go/telemetryPlease merge this PR after those releases go out.