aws-durable-execution-sdk-python-telemetry-exporter 0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aws_durable_execution_sdk_python_telemetry_exporter/LICENSE +175 -0
- aws_durable_execution_sdk_python_telemetry_exporter/NOTICE +1 -0
- aws_durable_execution_sdk_python_telemetry_exporter/__about__.py +4 -0
- aws_durable_execution_sdk_python_telemetry_exporter/__init__.py +90 -0
- aws_durable_execution_sdk_python_telemetry_exporter/_export_scheduler.py +178 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/__init__.py +86 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/_common.py +109 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/aurora_exporter.py +152 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/cloudwatch_logs_exporter.py +96 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/dynamodb_exporter.py +75 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/eventbridge_exporter.py +82 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/file_exporter.py +88 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/firehose_exporter.py +63 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/http_exporter.py +82 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/lambda_log_exporter.py +41 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/opensearch_exporter.py +109 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/otel_exporter.py +151 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/redshift_exporter.py +155 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/s3_exporter.py +105 -0
- aws_durable_execution_sdk_python_telemetry_exporter/exporters/sqs_exporter.py +96 -0
- aws_durable_execution_sdk_python_telemetry_exporter/operations_index.py +132 -0
- aws_durable_execution_sdk_python_telemetry_exporter/plugin.py +452 -0
- aws_durable_execution_sdk_python_telemetry_exporter/py.typed +0 -0
- aws_durable_execution_sdk_python_telemetry_exporter/truncation.py +107 -0
- aws_durable_execution_sdk_python_telemetry_exporter/types.py +127 -0
- aws_durable_execution_sdk_python_telemetry_exporter-0.0.1.dist-info/METADATA +256 -0
- aws_durable_execution_sdk_python_telemetry_exporter-0.0.1.dist-info/RECORD +28 -0
- aws_durable_execution_sdk_python_telemetry_exporter-0.0.1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026-present Amazon.com, Inc. or its affiliates.
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
"""Configuration types for the Durable Execution Telemetry plugin.
|
|
5
|
+
|
|
6
|
+
Mirrors the JS ``DurableExecutionTelemetryConfig`` / ``ContentConfig`` /
|
|
7
|
+
``OperationOverride``
|
|
8
|
+
(``aws-durable-execution-sdk-js-telemetry-exporter/src/types.ts``). Python uses
|
|
9
|
+
snake_case config field names; the *emitted wire record* keeps the JS camelCase
|
|
10
|
+
field names (see ``plugin.py``) so records read identically across SDKs.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from dataclasses import dataclass, field
|
|
16
|
+
from enum import StrEnum
|
|
17
|
+
from typing import Any, Callable, Literal, Protocol
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class EmitMode(StrEnum):
|
|
21
|
+
"""When the plugin emits a record. The values match the JS plugin's modes."""
|
|
22
|
+
|
|
23
|
+
# emit once at terminal SUCCEEDED/FAILED (default)
|
|
24
|
+
ON_COMPLETE = "on-complete"
|
|
25
|
+
# emit once only at terminal FAILED
|
|
26
|
+
ON_FAILURE = "on-failure"
|
|
27
|
+
# emit on every operation change and at end (nondeterministic count)
|
|
28
|
+
ON_CHANGE = "on-change"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class OperationDetail(StrEnum):
|
|
32
|
+
"""How much of the operation tree a record carries. Values match the JS plugin."""
|
|
33
|
+
|
|
34
|
+
# drop any operation with a parentId (default)
|
|
35
|
+
TOP_LEVEL = "top-level"
|
|
36
|
+
# include children of contexts too
|
|
37
|
+
FULL_TREE = "full-tree"
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# Accepted string inputs, kept in lockstep with the enum values above. Config
|
|
41
|
+
# fields are typed as these ``Literal`` unions (never bare ``str``) so a typoed
|
|
42
|
+
# mode fails a static type check, while
|
|
43
|
+
# ``DurableExecutionTelemetryConfig.__post_init__`` normalizes any accepted value to the matching enum member and raises
|
|
44
|
+
# ``ValueError`` for an invalid dynamic string.
|
|
45
|
+
EmitModeInput = Literal["on-complete", "on-failure", "on-change"]
|
|
46
|
+
OperationDetailInput = Literal["top-level", "full-tree"]
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class TelemetryExporter(Protocol):
|
|
50
|
+
"""A destination that receives one curated Durable Execution Telemetry record.
|
|
51
|
+
|
|
52
|
+
``max_record_size_bytes`` bounds the serialized record body (the plugin's
|
|
53
|
+
size limiter measures ``render(record)``). First-party exporters default it
|
|
54
|
+
to their destination's practical limit; an exporter whose value is ``None``
|
|
55
|
+
is never truncated.
|
|
56
|
+
``render`` maps the canonical record dict to the exact shape the exporter
|
|
57
|
+
serializes (identity for array exporters, the ``operationsByName`` expansion
|
|
58
|
+
for point-access exporters).
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
max_record_size_bytes: int | None
|
|
62
|
+
|
|
63
|
+
def render(self, record: dict[str, Any]) -> Any: ... # pragma: no cover
|
|
64
|
+
|
|
65
|
+
def export(self, record: dict[str, Any]) -> None: ... # pragma: no cover
|
|
66
|
+
|
|
67
|
+
def flush(self) -> None: ... # pragma: no cover
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
@dataclass(frozen=True)
|
|
71
|
+
class OperationOverride:
|
|
72
|
+
"""Per-operation override matched by ``operation_name``.
|
|
73
|
+
|
|
74
|
+
``result`` opts the operation's result into the record via a transform that
|
|
75
|
+
receives the checkpointed, JSON-parsed result (the SDK's own serialized form
|
|
76
|
+
— the plugin never runs custom Serdes). Mirrors JS ``OperationOverride``.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
operation_name: str
|
|
80
|
+
exclude: bool = False
|
|
81
|
+
result: Callable[[Any], Any] | None = None
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@dataclass(frozen=True)
|
|
85
|
+
class ContentOperations:
|
|
86
|
+
overrides: list[OperationOverride] = field(default_factory=list)
|
|
87
|
+
include_errors: bool | None = None
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@dataclass(frozen=True)
|
|
91
|
+
class ContentConfig:
|
|
92
|
+
"""Controls what data is included in emitted records.
|
|
93
|
+
|
|
94
|
+
``input`` / ``output``: ``False`` omits the field, a callable transforms it,
|
|
95
|
+
``True``/``None`` includes it as-is. Mirrors JS ``ContentConfig``.
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
input: bool | Callable[[Any], Any] | None = None
|
|
99
|
+
output: bool | Callable[[Any], Any] | None = None
|
|
100
|
+
operations: ContentOperations | None = None
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
@dataclass(frozen=True)
|
|
104
|
+
class DurableExecutionTelemetryConfig:
|
|
105
|
+
"""Configuration for the Durable Execution Telemetry plugin.
|
|
106
|
+
|
|
107
|
+
Mirrors JS ``DurableExecutionTelemetryConfig``.
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
exporters: list[TelemetryExporter] = field(default_factory=list)
|
|
111
|
+
sampling_rate: float | None = None
|
|
112
|
+
emit_mode: EmitMode | EmitModeInput | None = None
|
|
113
|
+
operation_detail: OperationDetail | OperationDetailInput | None = None
|
|
114
|
+
content: ContentConfig | None = None
|
|
115
|
+
|
|
116
|
+
def __post_init__(self) -> None:
|
|
117
|
+
# Normalize accepted string inputs to enum members so the plugin always
|
|
118
|
+
# compares against ``EmitMode`` / ``OperationDetail`` members. ``EmitMode(x)``
|
|
119
|
+
# is idempotent for members, accepts the exact JS-style strings, and raises
|
|
120
|
+
# ``ValueError`` for an unrecognized dynamic string. Frozen dataclass, so use
|
|
121
|
+
# ``object.__setattr__`` to rebind the normalized value.
|
|
122
|
+
if self.emit_mode is not None:
|
|
123
|
+
object.__setattr__(self, "emit_mode", EmitMode(self.emit_mode))
|
|
124
|
+
if self.operation_detail is not None:
|
|
125
|
+
object.__setattr__(
|
|
126
|
+
self, "operation_detail", OperationDetail(self.operation_detail)
|
|
127
|
+
)
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: aws-durable-execution-sdk-python-telemetry-exporter
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Durable Execution Telemetry instrumentation plugin for the AWS Durable Execution SDK for Python
|
|
5
|
+
Project-URL: Documentation, https://github.com/aws/aws-durable-execution-sdk-python#readme
|
|
6
|
+
Project-URL: Issues, https://github.com/aws/aws-durable-execution-sdk-python/issues
|
|
7
|
+
Project-URL: Source, https://github.com/aws/aws-durable-execution-sdk-python
|
|
8
|
+
Author-email: AWS durable-execution-dev <durable-execution-dev@amazon.com>
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
Keywords: durable-execution,durable-execution-telemetry,observability
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Programming Language :: Python
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Requires-Dist: aws-durable-execution-sdk-python>=2.0.0
|
|
20
|
+
Provides-Extra: s3
|
|
21
|
+
Requires-Dist: boto3>=1.26.0; extra == 's3'
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# AWS Durable Execution SDK for Python — Durable Execution Telemetry Exporter
|
|
25
|
+
|
|
26
|
+
Durable Execution Telemetry instrumentation plugin for the AWS Durable
|
|
27
|
+
Execution SDK for Python. A port of the JavaScript SDK's
|
|
28
|
+
`durableExecutionTelemetry()` plugin: it listens to the SDK's instrumentation
|
|
29
|
+
hooks and emits one curated `DurableExecutionTelemetry` record per execution
|
|
30
|
+
to the configured exporters. The wire record keeps the JS camelCase field
|
|
31
|
+
names so records read identically across SDKs.
|
|
32
|
+
|
|
33
|
+
> **Experimental.** Like its JS counterpart, this plugin is experimental and may
|
|
34
|
+
> change or be removed in future releases.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install aws-durable-execution-sdk-python-telemetry-exporter
|
|
40
|
+
# with the S3 exporter's local-dev dependency:
|
|
41
|
+
pip install "aws-durable-execution-sdk-python-telemetry-exporter[s3]"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from aws_durable_execution_sdk_python import durable_execution
|
|
48
|
+
from aws_durable_execution_sdk_python_telemetry_exporter import (
|
|
49
|
+
DurableExecutionTelemetryConfig,
|
|
50
|
+
durable_execution_telemetry,
|
|
51
|
+
)
|
|
52
|
+
from aws_durable_execution_sdk_python_telemetry_exporter.exporters import S3Exporter
|
|
53
|
+
|
|
54
|
+
@durable_execution(
|
|
55
|
+
plugins=[
|
|
56
|
+
durable_execution_telemetry(
|
|
57
|
+
DurableExecutionTelemetryConfig(
|
|
58
|
+
exporters=[
|
|
59
|
+
S3Exporter(bucket="my-bucket", prefix="durable-execution-telemetry/")
|
|
60
|
+
],
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
]
|
|
64
|
+
)
|
|
65
|
+
def handler(event, context):
|
|
66
|
+
...
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
With no exporter configured, records are written to the function's own
|
|
70
|
+
CloudWatch log group as single JSON lines (the `LambdaLogExporter` default),
|
|
71
|
+
carrying the name-keyed `operationsByName` summary. The `S3Exporter` writes the
|
|
72
|
+
lossless per-occurrence `operations` array, one object per execution
|
|
73
|
+
(upsert-by-execution-name, so re-emission overwrites rather than appends).
|
|
74
|
+
|
|
75
|
+
## Exporters
|
|
76
|
+
|
|
77
|
+
All exporters live in `aws_durable_execution_sdk_python_telemetry_exporter.exporters` and
|
|
78
|
+
are re-exported from the package root. Each serializes the record as compact
|
|
79
|
+
JSON. Exporters that call AWS accept an injected `client=` for tests and use
|
|
80
|
+
the Lambda runtime's boto3 otherwise; none adds a required dependency.
|
|
81
|
+
|
|
82
|
+
| Exporter | Destination | Upsert | Operations shape | Default size limit |
|
|
83
|
+
| --- | --- | --- | --- | --- |
|
|
84
|
+
| `LambdaLogExporter` | Function's own log group | No | `operationsByName` | 256 KB |
|
|
85
|
+
| `CloudWatchLogsExporter` | Any log group, one stream per day | No | `operationsByName` | 256 KB |
|
|
86
|
+
| `S3Exporter` | S3 object per execution | Yes (key) | `operations` | 5 MB |
|
|
87
|
+
| `DynamoDBExporter` | DynamoDB item | Configurable | `operationsByName` | 400 KB |
|
|
88
|
+
| `AuroraExporter` | Aurora MySQL/PostgreSQL row (Data API) | Yes (upsert) | full record as JSON column | 1 MB |
|
|
89
|
+
| `RedshiftExporter` | Redshift row (Data API) | Yes (MERGE) | full record as SUPER column | 1 MB |
|
|
90
|
+
| `OpenSearchExporter` | OpenSearch document | Yes (`_id`) | `operations` | 10 MB |
|
|
91
|
+
| `FirehoseExporter` | Firehose delivery stream | N/A | `operations_format` | 1 MB |
|
|
92
|
+
| `EventBridgeExporter` | EventBridge event | N/A | `operations_format` | 256 KB |
|
|
93
|
+
| `SQSExporter` | SQS message | N/A | `operations_format` | 256 KB |
|
|
94
|
+
| `OTelExporter` | OTLP/HTTP logs endpoint | N/A | `operations_format` | 1 MB |
|
|
95
|
+
| `HttpExporter` | Any HTTP endpoint | N/A | `operations_format` | none |
|
|
96
|
+
| `FileExporter` | Directory (EFS, mount, `/tmp`) | Configurable | `operations_format` | none |
|
|
97
|
+
|
|
98
|
+
`operations_format` is `"array"` (default), `"by-name"`, or `"both"`
|
|
99
|
+
(`OperationsFormat`). `max_record_size_bytes` raises or lowers an exporter's
|
|
100
|
+
size limit; omitting it keeps the default. `HttpExporter` and `FileExporter`
|
|
101
|
+
have no default and do not truncate unless a limit is set.
|
|
102
|
+
|
|
103
|
+
### CloudWatchLogsExporter
|
|
104
|
+
|
|
105
|
+
Writes one `PutLogEvents` event per record to `log_group_name`, in a stream
|
|
106
|
+
named `{log_stream_prefix}{YYYY}/{MM}/{DD}` (default prefix `durable-execution-telemetry/`).
|
|
107
|
+
IAM: `logs:CreateLogStream`, `logs:PutLogEvents` on the log group.
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
CloudWatchLogsExporter(log_group_name="/custom/durable-execution-telemetry")
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### DynamoDBExporter
|
|
114
|
+
|
|
115
|
+
`PutItem` keyed by `partition_key` (default `pk`) = `executionArn`. With the
|
|
116
|
+
default `sort_key="sk"` (= `emittedAt`) every export adds an item; pass
|
|
117
|
+
`sort_key=None` for a key-only table that upserts. IAM: `dynamodb:PutItem`.
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
DynamoDBExporter(table_name="durable-execution-telemetry")
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### AuroraExporter
|
|
124
|
+
|
|
125
|
+
Upserts a row by `execution_arn` through the RDS Data API; `engine` is
|
|
126
|
+
`"postgresql"` or `"mysql"` and selects the dialect. Columns: `execution_arn,
|
|
127
|
+
execution_name, function_name, status, start_time, end_time, duration_ms,
|
|
128
|
+
record_json, emitted_at`. IAM: `rds-data:ExecuteStatement`,
|
|
129
|
+
`secretsmanager:GetSecretValue`.
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
AuroraExporter(
|
|
133
|
+
resource_arn="arn:aws:rds:us-east-1:123456789012:cluster:my-cluster",
|
|
134
|
+
secret_arn="arn:aws:secretsmanager:us-east-1:123456789012:secret:my-db-creds",
|
|
135
|
+
database="telemetry",
|
|
136
|
+
engine="postgresql",
|
|
137
|
+
)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### RedshiftExporter
|
|
141
|
+
|
|
142
|
+
`MERGE` by `execution_arn` through the Redshift Data API into
|
|
143
|
+
`{schema}.{table}` (default `public.durable_execution_telemetry`, same columns as Aurora,
|
|
144
|
+
`record_json` as `SUPER`). Provide `workgroup_name` (Serverless) or
|
|
145
|
+
`cluster_identifier` (provisioned, with `db_user` or `secret_arn`). IAM:
|
|
146
|
+
`redshift-data:ExecuteStatement` plus `redshift-serverless:GetCredentials` or
|
|
147
|
+
`secretsmanager:GetSecretValue`. The statement is submitted and not awaited, so
|
|
148
|
+
statement failures are not reported and `on-change` records may land out of
|
|
149
|
+
order; prefer the default `on-complete` emit mode with this exporter.
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
RedshiftExporter(database="telemetry", workgroup_name="telemetry-wg")
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### OpenSearchExporter
|
|
156
|
+
|
|
157
|
+
`PUT {endpoint}/{index_name}/_doc/{executionArn}` (default index
|
|
158
|
+
`durable-execution-telemetry`). `auth="sigv4"` (default) signs with the runtime's
|
|
159
|
+
credentials via botocore; `auth="basic"` uses `username`/`password`. IAM:
|
|
160
|
+
`es:ESHttpPut` on the domain.
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
OpenSearchExporter(endpoint="https://my-domain.us-east-1.es.amazonaws.com", region="us-east-1")
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### FirehoseExporter
|
|
167
|
+
|
|
168
|
+
`PutRecord` of one JSON line (trailing newline) per record. IAM:
|
|
169
|
+
`firehose:PutRecord`.
|
|
170
|
+
|
|
171
|
+
```python
|
|
172
|
+
FirehoseExporter(delivery_stream_name="durable-execution-telemetry-stream")
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### EventBridgeExporter
|
|
176
|
+
|
|
177
|
+
`PutEvents` with `Source` (default `software.amazon.lambda.durable.telemetry`),
|
|
178
|
+
`DetailType` = record status, `Detail` = record. All arguments optional. IAM:
|
|
179
|
+
`events:PutEvents`.
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
EventBridgeExporter(event_bus_name="default")
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### SQSExporter
|
|
186
|
+
|
|
187
|
+
`SendMessage` with the record as body and `status`/`functionName` message
|
|
188
|
+
attributes. A `.fifo` queue URL enables `MessageGroupId` (default
|
|
189
|
+
`executionArn`, or `message_group_id`) and a deduplication id of
|
|
190
|
+
`executionArn:emittedAt`. IAM: `sqs:SendMessage`.
|
|
191
|
+
|
|
192
|
+
```python
|
|
193
|
+
SQSExporter(queue_url="https://sqs.us-east-1.amazonaws.com/123456789012/telemetry")
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### OTelExporter
|
|
197
|
+
|
|
198
|
+
POSTs one OTLP `ExportLogsServiceRequest` (`http/json` only) per record to
|
|
199
|
+
`endpoint`; identity fields become attributes and the record is the log body.
|
|
200
|
+
Pass vendor auth in `headers`. No IAM.
|
|
201
|
+
|
|
202
|
+
```python
|
|
203
|
+
OTelExporter(endpoint="https://otlp.vendor.com/v1/logs", headers={"x-api-key": "..."})
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### HttpExporter
|
|
207
|
+
|
|
208
|
+
`POST` (or `method="PUT"`) the record as JSON to `url` with
|
|
209
|
+
`Content-Type: application/json` plus `headers`; a non-2xx status raises.
|
|
210
|
+
`timeout_ms` defaults to 10000 and currently applies to each socket operation
|
|
211
|
+
(the connect, each write of the request, and each read of the status line,
|
|
212
|
+
headers, and a non-2xx error body; a 2xx body is never read) rather than to the
|
|
213
|
+
whole request, so an endpoint that consumes or responds slowly can hold the
|
|
214
|
+
export open longer than `timeout_ms`; a future release may enforce it as a
|
|
215
|
+
whole-request deadline. No IAM.
|
|
216
|
+
|
|
217
|
+
```python
|
|
218
|
+
HttpExporter(url="https://hooks.example.com/telemetry", headers={"Authorization": "Bearer ..."})
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### FileExporter
|
|
222
|
+
|
|
223
|
+
`mode="ndjson"` (default) appends to `{directory}/{YYYY-MM-DD}.ndjson`;
|
|
224
|
+
`mode="json"` writes `{directory}/{executionName}.json`, overwriting on update.
|
|
225
|
+
For Lambda use an EFS mount (IAM: `elasticfilesystem:ClientMount`,
|
|
226
|
+
`elasticfilesystem:ClientWrite`) or `/tmp` for testing. Appends from many
|
|
227
|
+
concurrent environments to one NDJSON file on a network file system can
|
|
228
|
+
interleave; use `mode="json"` when several environments share a directory.
|
|
229
|
+
|
|
230
|
+
```python
|
|
231
|
+
FileExporter(directory="/mnt/efs/durable-execution-telemetry")
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Emission behavior, record schema (`recordType: DurableExecutionTelemetry`,
|
|
235
|
+
`schemaVersion: "1.0"`), sampling, content configuration (input/output
|
|
236
|
+
omission, `include_errors`, per-operation result opt-in), truncation phases,
|
|
237
|
+
and `top-level` vs `full-tree` operation detail all mirror the JS plugin.
|
|
238
|
+
Behavior is validated cross-SDK by the `telemetry` conformance suite
|
|
239
|
+
(`aws-durable-execution-conformance-tests-telemetry`).
|
|
240
|
+
|
|
241
|
+
> **Note (asynchronous export).** Export rendering, truncation, `export()`, and
|
|
242
|
+
> `flush()` run on one lazy background worker per plugin. Checkpoint hooks only
|
|
243
|
+
> replace that execution's latest pending snapshot and wake the worker.
|
|
244
|
+
> Consecutive `on-change` snapshots for one execution coalesce whenever the
|
|
245
|
+
> worker has not yet claimed the previous one, including when no export is
|
|
246
|
+
> running, so under fast in-memory checkpoints (the local runner) a burst may
|
|
247
|
+
> deliver only its first and latest snapshots. Snapshots from different
|
|
248
|
+
> executions never coalesce with each other. An invocation that emits a record
|
|
249
|
+
> drains every pending snapshot and flushes exporters before it returns;
|
|
250
|
+
> invocations that emit nothing do not start or flush the worker.
|
|
251
|
+
|
|
252
|
+
## Requirements
|
|
253
|
+
|
|
254
|
+
- `aws-durable-execution-sdk-python` with the plugin invocation hooks that
|
|
255
|
+
surface `execution_input` / `execution_result` (included since the version
|
|
256
|
+
this package declares as its minimum).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
aws_durable_execution_sdk_python_telemetry_exporter/__about__.py,sha256=GPAocThPVDL3efYeQ46aR1SYARYXBL4S0Xswkn4UeFI,137
|
|
2
|
+
aws_durable_execution_sdk_python_telemetry_exporter/__init__.py,sha256=83VSkyDz8JSQ6TH52x9YnEP848mkUe7RV0M1jLMS2TA,2284
|
|
3
|
+
aws_durable_execution_sdk_python_telemetry_exporter/_export_scheduler.py,sha256=D1ItjefIIeDmmE08IBZUQgnupKtVMjei1XQcBFLB7Qg,7006
|
|
4
|
+
aws_durable_execution_sdk_python_telemetry_exporter/operations_index.py,sha256=xZmoEfeKGFr2wdgSHTUcV0yhN_sM72plO_iKQTgi0-M,4976
|
|
5
|
+
aws_durable_execution_sdk_python_telemetry_exporter/plugin.py,sha256=yB4sxdIp6NcCDRtEbL7Qchs0Y3FAwzSyMMOZxQYi6AU,18046
|
|
6
|
+
aws_durable_execution_sdk_python_telemetry_exporter/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
aws_durable_execution_sdk_python_telemetry_exporter/truncation.py,sha256=KnnOWvEy8jlwYfo-sPT9UP4aC-F2Kc7LqmRTBRUzEzg,3482
|
|
8
|
+
aws_durable_execution_sdk_python_telemetry_exporter/types.py,sha256=4dp5G7lgfL14Te2heyHD6NsGU_AEe8XCehnQLqHp-0k,4870
|
|
9
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/__init__.py,sha256=QK72ouRpu6_GmMfyxvocbVIkJTSQwdtSxmM2mcjXN2Q,2771
|
|
10
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/_common.py,sha256=wOHB3qUYkwVkCFgBP1pq3zS0ksGCaa-cjPWp4J7_4zg,4027
|
|
11
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/aurora_exporter.py,sha256=apkuD7uIxZtuplyy_Tv_SfslqT68uyhOhB1or01Z8Fc,5389
|
|
12
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/cloudwatch_logs_exporter.py,sha256=ilMYPXw8aNc2O515sVeNIjF0RSm9dlPbKGcniitG0B8,3195
|
|
13
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/dynamodb_exporter.py,sha256=FocpKBsz-TYzIqLl3gdIRbkU_-YNuxuPkqsb6uYNRkk,2692
|
|
14
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/eventbridge_exporter.py,sha256=22NqCpPmlPnXLZNguzu47Q95LH-k73wARBmfTQ99zoA,2816
|
|
15
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/file_exporter.py,sha256=kUkTIOJ2j3cXgFdO0nn6x9vq-slMc95ZZ5zhZzcIDIo,2948
|
|
16
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/firehose_exporter.py,sha256=lHE9BXlVvM7-R3Z0kECPKmrO8ozVp1n9CEUUOOKoy3E,2116
|
|
17
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/http_exporter.py,sha256=oxO6roVRkIe1IiTKaL3uGhKwt7i_OlE91Yr_IF1qOB8,3079
|
|
18
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/lambda_log_exporter.py,sha256=dy2ExgR6gWa_RbI-MPFVU60YnnPbF0Nnc8sM5-TNtdc,1504
|
|
19
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/opensearch_exporter.py,sha256=Al-fr2OCjXBwyKrmEhIIwu2AR5x7unb13i8bwNdAUMY,4104
|
|
20
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/otel_exporter.py,sha256=fdTC__j8XBzJcL53Wjj1QvUxWtdZ-yG3J6Zq4ENlxtc,6207
|
|
21
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/redshift_exporter.py,sha256=xkT2Pto64d7OJUPysyxu265HAF_PxuNDGBSIRa7Jgm8,6201
|
|
22
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/s3_exporter.py,sha256=Tm8crVKy0M3aoF44EazZ_OALn0Y_3EXrgmLJWxF4LYc,3877
|
|
23
|
+
aws_durable_execution_sdk_python_telemetry_exporter/exporters/sqs_exporter.py,sha256=zhj65YjuqCxEctiOhN3uxOdc-YniUoOrs0YZI5YnQIM,3333
|
|
24
|
+
aws_durable_execution_sdk_python_telemetry_exporter/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
|
|
25
|
+
aws_durable_execution_sdk_python_telemetry_exporter/NOTICE,sha256=1CkO1kwu3Q_OHYTj-d-yiBJA_lNN73a4zSntavaD4oc,67
|
|
26
|
+
aws_durable_execution_sdk_python_telemetry_exporter-0.0.1.dist-info/METADATA,sha256=FbBXlEp9YxwShlFj79i1CVninP4TZax-nWqWBQLEpgM,10952
|
|
27
|
+
aws_durable_execution_sdk_python_telemetry_exporter-0.0.1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
28
|
+
aws_durable_execution_sdk_python_telemetry_exporter-0.0.1.dist-info/RECORD,,
|