@microsoft/opentelemetry 1.3.0 → 1.4.0
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.
- package/README.md +130 -37
- package/dist/commonjs/a365/configuration/A365Configuration.d.ts +3 -0
- package/dist/commonjs/a365/configuration/A365Configuration.d.ts.map +1 -1
- package/dist/commonjs/a365/configuration/A365Configuration.js +5 -1
- package/dist/commonjs/a365/configuration/A365Configuration.js.map +1 -1
- package/dist/commonjs/a365/configuration/A365ConfigurationOptions.d.ts +3 -0
- package/dist/commonjs/a365/configuration/A365ConfigurationOptions.d.ts.map +1 -1
- package/dist/commonjs/a365/constants.d.ts +1 -1
- package/dist/commonjs/a365/exporter/Agent365Exporter.d.ts +29 -3
- package/dist/commonjs/a365/exporter/Agent365Exporter.d.ts.map +1 -1
- package/dist/commonjs/a365/exporter/Agent365Exporter.js +327 -73
- package/dist/commonjs/a365/exporter/Agent365Exporter.js.map +1 -1
- package/dist/commonjs/a365/exporter/Agent365ExporterOptions.d.ts +5 -0
- package/dist/commonjs/a365/exporter/Agent365ExporterOptions.d.ts.map +1 -1
- package/dist/commonjs/a365/exporter/Agent365ExporterOptions.js +3 -0
- package/dist/commonjs/a365/exporter/Agent365ExporterOptions.js.map +1 -1
- package/dist/commonjs/a365/exporter/durable/DurableDeliveryManager.d.ts +70 -0
- package/dist/commonjs/a365/exporter/durable/DurableDeliveryManager.d.ts.map +1 -0
- package/dist/commonjs/a365/exporter/durable/DurableDeliveryManager.js +346 -0
- package/dist/commonjs/a365/exporter/durable/DurableDeliveryManager.js.map +1 -0
- package/dist/commonjs/a365/exporter/durable/DurableDeliveryOptions.d.ts +31 -0
- package/dist/commonjs/a365/exporter/durable/DurableDeliveryOptions.d.ts.map +1 -0
- package/dist/commonjs/a365/exporter/durable/DurableDeliveryOptions.js +48 -0
- package/dist/commonjs/a365/exporter/durable/DurableDeliveryOptions.js.map +1 -0
- package/dist/commonjs/a365/exporter/durable/DurableRecord.d.ts +20 -0
- package/dist/commonjs/a365/exporter/durable/DurableRecord.d.ts.map +1 -0
- package/dist/commonjs/a365/exporter/durable/DurableRecord.js +98 -0
- package/dist/commonjs/a365/exporter/durable/DurableRecord.js.map +1 -0
- package/dist/commonjs/a365/exporter/durable/PersistentStore.d.ts +48 -0
- package/dist/commonjs/a365/exporter/durable/PersistentStore.d.ts.map +1 -0
- package/dist/commonjs/a365/exporter/durable/PersistentStore.js +637 -0
- package/dist/commonjs/a365/exporter/durable/PersistentStore.js.map +1 -0
- package/dist/commonjs/a365/exporter/durable/TransmissionGate.d.ts +24 -0
- package/dist/commonjs/a365/exporter/durable/TransmissionGate.d.ts.map +1 -0
- package/dist/commonjs/a365/exporter/durable/TransmissionGate.js +85 -0
- package/dist/commonjs/a365/exporter/durable/TransmissionGate.js.map +1 -0
- package/dist/commonjs/a365/exporter/durable/WindowsFileAccessControl.d.ts +35 -0
- package/dist/commonjs/a365/exporter/durable/WindowsFileAccessControl.d.ts.map +1 -0
- package/dist/commonjs/a365/exporter/durable/WindowsFileAccessControl.js +169 -0
- package/dist/commonjs/a365/exporter/durable/WindowsFileAccessControl.js.map +1 -0
- package/dist/commonjs/a365/exporter/durable/index.d.ts +12 -0
- package/dist/commonjs/a365/exporter/durable/index.d.ts.map +1 -0
- package/dist/commonjs/a365/exporter/durable/index.js +27 -0
- package/dist/commonjs/a365/exporter/durable/index.js.map +1 -0
- package/dist/commonjs/a365/exporter/index.d.ts +1 -1
- package/dist/commonjs/a365/exporter/index.d.ts.map +1 -1
- package/dist/commonjs/a365/exporter/index.js.map +1 -1
- package/dist/commonjs/a365/index.d.ts +1 -1
- package/dist/commonjs/a365/index.d.ts.map +1 -1
- package/dist/commonjs/a365/index.js.map +1 -1
- package/dist/commonjs/azureMonitor/index.d.ts.map +1 -1
- package/dist/commonjs/azureMonitor/index.js +4 -10
- package/dist/commonjs/azureMonitor/index.js.map +1 -1
- package/dist/commonjs/azureMonitor/logs/handler.d.ts +0 -7
- package/dist/commonjs/azureMonitor/logs/handler.d.ts.map +1 -1
- package/dist/commonjs/azureMonitor/logs/handler.js +0 -27
- package/dist/commonjs/azureMonitor/logs/handler.js.map +1 -1
- package/dist/commonjs/azureMonitor/metrics/performanceCounters.d.ts +3 -0
- package/dist/commonjs/azureMonitor/metrics/performanceCounters.d.ts.map +1 -1
- package/dist/commonjs/azureMonitor/metrics/performanceCounters.js +21 -12
- package/dist/commonjs/azureMonitor/metrics/performanceCounters.js.map +1 -1
- package/dist/commonjs/azureMonitor/traces/handler.d.ts +2 -9
- package/dist/commonjs/azureMonitor/traces/handler.d.ts.map +1 -1
- package/dist/commonjs/azureMonitor/traces/handler.js +2 -54
- package/dist/commonjs/azureMonitor/traces/handler.js.map +1 -1
- package/dist/commonjs/azureMonitor/utils/common.d.ts +29 -0
- package/dist/commonjs/azureMonitor/utils/common.d.ts.map +1 -1
- package/dist/commonjs/azureMonitor/utils/common.js +55 -0
- package/dist/commonjs/azureMonitor/utils/common.js.map +1 -1
- package/dist/commonjs/distro/distro.d.ts.map +1 -1
- package/dist/commonjs/distro/distro.js +3 -0
- package/dist/commonjs/distro/distro.js.map +1 -1
- package/dist/commonjs/genai/instrumentations/langchain/tracer.d.ts.map +1 -1
- package/dist/commonjs/genai/instrumentations/langchain/tracer.js +1 -0
- package/dist/commonjs/genai/instrumentations/langchain/tracer.js.map +1 -1
- package/dist/commonjs/genai/instrumentations/langchain/utils.d.ts +1 -0
- package/dist/commonjs/genai/instrumentations/langchain/utils.d.ts.map +1 -1
- package/dist/commonjs/genai/instrumentations/langchain/utils.js +109 -0
- package/dist/commonjs/genai/instrumentations/langchain/utils.js.map +1 -1
- package/dist/commonjs/genai/semconv.d.ts +10 -0
- package/dist/commonjs/genai/semconv.d.ts.map +1 -1
- package/dist/commonjs/genai/semconv.js +11 -1
- package/dist/commonjs/genai/semconv.js.map +1 -1
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/shared/config.d.ts +7 -0
- package/dist/commonjs/shared/config.d.ts.map +1 -1
- package/dist/commonjs/shared/config.js +19 -3
- package/dist/commonjs/shared/config.js.map +1 -1
- package/dist/commonjs/types.d.ts +1 -1
- package/dist/commonjs/types.js +1 -1
- package/dist/commonjs/utils/sdkStats.d.ts +7 -0
- package/dist/commonjs/utils/sdkStats.d.ts.map +1 -1
- package/dist/commonjs/utils/sdkStats.js +12 -2
- package/dist/commonjs/utils/sdkStats.js.map +1 -1
- package/dist/esm/a365/configuration/A365Configuration.d.ts +3 -0
- package/dist/esm/a365/configuration/A365Configuration.d.ts.map +1 -1
- package/dist/esm/a365/configuration/A365Configuration.js +5 -1
- package/dist/esm/a365/configuration/A365Configuration.js.map +1 -1
- package/dist/esm/a365/configuration/A365ConfigurationOptions.d.ts +3 -0
- package/dist/esm/a365/configuration/A365ConfigurationOptions.d.ts.map +1 -1
- package/dist/esm/a365/constants.d.ts +1 -1
- package/dist/esm/a365/exporter/Agent365Exporter.d.ts +29 -3
- package/dist/esm/a365/exporter/Agent365Exporter.d.ts.map +1 -1
- package/dist/esm/a365/exporter/Agent365Exporter.js +325 -71
- package/dist/esm/a365/exporter/Agent365Exporter.js.map +1 -1
- package/dist/esm/a365/exporter/Agent365ExporterOptions.d.ts +5 -0
- package/dist/esm/a365/exporter/Agent365ExporterOptions.d.ts.map +1 -1
- package/dist/esm/a365/exporter/Agent365ExporterOptions.js +3 -0
- package/dist/esm/a365/exporter/Agent365ExporterOptions.js.map +1 -1
- package/dist/esm/a365/exporter/durable/DurableDeliveryManager.d.ts +70 -0
- package/dist/esm/a365/exporter/durable/DurableDeliveryManager.d.ts.map +1 -0
- package/dist/esm/a365/exporter/durable/DurableDeliveryManager.js +342 -0
- package/dist/esm/a365/exporter/durable/DurableDeliveryManager.js.map +1 -0
- package/dist/esm/a365/exporter/durable/DurableDeliveryOptions.d.ts +31 -0
- package/dist/esm/a365/exporter/durable/DurableDeliveryOptions.d.ts.map +1 -0
- package/dist/esm/a365/exporter/durable/DurableDeliveryOptions.js +44 -0
- package/dist/esm/a365/exporter/durable/DurableDeliveryOptions.js.map +1 -0
- package/dist/esm/a365/exporter/durable/DurableRecord.d.ts +20 -0
- package/dist/esm/a365/exporter/durable/DurableRecord.d.ts.map +1 -0
- package/dist/esm/a365/exporter/durable/DurableRecord.js +93 -0
- package/dist/esm/a365/exporter/durable/DurableRecord.js.map +1 -0
- package/dist/esm/a365/exporter/durable/PersistentStore.d.ts +48 -0
- package/dist/esm/a365/exporter/durable/PersistentStore.d.ts.map +1 -0
- package/dist/esm/a365/exporter/durable/PersistentStore.js +599 -0
- package/dist/esm/a365/exporter/durable/PersistentStore.js.map +1 -0
- package/dist/esm/a365/exporter/durable/TransmissionGate.d.ts +24 -0
- package/dist/esm/a365/exporter/durable/TransmissionGate.d.ts.map +1 -0
- package/dist/esm/a365/exporter/durable/TransmissionGate.js +80 -0
- package/dist/esm/a365/exporter/durable/TransmissionGate.js.map +1 -0
- package/dist/esm/a365/exporter/durable/WindowsFileAccessControl.d.ts +35 -0
- package/dist/esm/a365/exporter/durable/WindowsFileAccessControl.d.ts.map +1 -0
- package/dist/esm/a365/exporter/durable/WindowsFileAccessControl.js +164 -0
- package/dist/esm/a365/exporter/durable/WindowsFileAccessControl.js.map +1 -0
- package/dist/esm/a365/exporter/durable/index.d.ts +12 -0
- package/dist/esm/a365/exporter/durable/index.d.ts.map +1 -0
- package/dist/esm/a365/exporter/durable/index.js +9 -0
- package/dist/esm/a365/exporter/durable/index.js.map +1 -0
- package/dist/esm/a365/exporter/index.d.ts +1 -1
- package/dist/esm/a365/exporter/index.d.ts.map +1 -1
- package/dist/esm/a365/exporter/index.js.map +1 -1
- package/dist/esm/a365/index.d.ts +1 -1
- package/dist/esm/a365/index.d.ts.map +1 -1
- package/dist/esm/a365/index.js.map +1 -1
- package/dist/esm/azureMonitor/index.d.ts.map +1 -1
- package/dist/esm/azureMonitor/index.js +4 -10
- package/dist/esm/azureMonitor/index.js.map +1 -1
- package/dist/esm/azureMonitor/logs/handler.d.ts +0 -7
- package/dist/esm/azureMonitor/logs/handler.d.ts.map +1 -1
- package/dist/esm/azureMonitor/logs/handler.js +0 -27
- package/dist/esm/azureMonitor/logs/handler.js.map +1 -1
- package/dist/esm/azureMonitor/metrics/performanceCounters.d.ts +3 -0
- package/dist/esm/azureMonitor/metrics/performanceCounters.d.ts.map +1 -1
- package/dist/esm/azureMonitor/metrics/performanceCounters.js +21 -12
- package/dist/esm/azureMonitor/metrics/performanceCounters.js.map +1 -1
- package/dist/esm/azureMonitor/traces/handler.d.ts +2 -9
- package/dist/esm/azureMonitor/traces/handler.d.ts.map +1 -1
- package/dist/esm/azureMonitor/traces/handler.js +2 -54
- package/dist/esm/azureMonitor/traces/handler.js.map +1 -1
- package/dist/esm/azureMonitor/utils/common.d.ts +29 -0
- package/dist/esm/azureMonitor/utils/common.d.ts.map +1 -1
- package/dist/esm/azureMonitor/utils/common.js +52 -0
- package/dist/esm/azureMonitor/utils/common.js.map +1 -1
- package/dist/esm/distro/distro.d.ts.map +1 -1
- package/dist/esm/distro/distro.js +3 -0
- package/dist/esm/distro/distro.js.map +1 -1
- package/dist/esm/genai/instrumentations/langchain/tracer.d.ts.map +1 -1
- package/dist/esm/genai/instrumentations/langchain/tracer.js +1 -0
- package/dist/esm/genai/instrumentations/langchain/tracer.js.map +1 -1
- package/dist/esm/genai/instrumentations/langchain/utils.d.ts +1 -0
- package/dist/esm/genai/instrumentations/langchain/utils.d.ts.map +1 -1
- package/dist/esm/genai/instrumentations/langchain/utils.js +109 -1
- package/dist/esm/genai/instrumentations/langchain/utils.js.map +1 -1
- package/dist/esm/genai/semconv.d.ts +10 -0
- package/dist/esm/genai/semconv.d.ts.map +1 -1
- package/dist/esm/genai/semconv.js +10 -0
- package/dist/esm/genai/semconv.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/shared/config.d.ts +7 -0
- package/dist/esm/shared/config.d.ts.map +1 -1
- package/dist/esm/shared/config.js +19 -3
- package/dist/esm/shared/config.js.map +1 -1
- package/dist/esm/types.d.ts +1 -1
- package/dist/esm/types.js +1 -1
- package/dist/esm/utils/sdkStats.d.ts +7 -0
- package/dist/esm/utils/sdkStats.d.ts.map +1 -1
- package/dist/esm/utils/sdkStats.js +12 -2
- package/dist/esm/utils/sdkStats.js.map +1 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -88,6 +88,38 @@ useMicrosoftOpenTelemetry({
|
|
|
88
88
|
});
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
+
When you enable the A365 HTTP exporter, durable delivery is enabled by default. Tune the durable
|
|
92
|
+
store if you need a protected persistent volume or different bounds:
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
useMicrosoftOpenTelemetry({
|
|
96
|
+
a365: {
|
|
97
|
+
enabled: true,
|
|
98
|
+
enableObservabilityExporter: true,
|
|
99
|
+
tokenResolver: (agentId, tenantId, authScopes) => getToken(agentId, tenantId, authScopes),
|
|
100
|
+
durableDelivery: {
|
|
101
|
+
storageDirectory: process.env.A365_DURABLE_STORAGE_DIRECTORY,
|
|
102
|
+
maxStorageBytes: 50 * 1024 * 1024,
|
|
103
|
+
maxRecordAgeMilliseconds: 2 * 24 * 60 * 60 * 1000,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Set `durableDelivery.enabled: false` to force legacy network-only delivery.
|
|
110
|
+
|
|
111
|
+
With durable delivery enabled, retryable A365 exporter payloads (including HTTP 401, 408, 429,
|
|
112
|
+
and 5xx responses) are stored as plaintext local files in a stable per-application partition and
|
|
113
|
+
replayed with a freshly resolved token plus the exporter's current cluster/domain routing; durable
|
|
114
|
+
files never store bearer tokens or authoritative route metadata. Delivery is at-least-once, so
|
|
115
|
+
duplicates are possible. The SDK restricts durable storage to the current user and Administrators
|
|
116
|
+
on Windows and uses owner-only `0700` directories and `0600` files on POSIX. Use a protected
|
|
117
|
+
persistent volume if records must survive container or host restarts; ephemeral container storage
|
|
118
|
+
only survives process restarts and still counts against the container's ephemeral-storage quota.
|
|
119
|
+
If durable storage permissions cannot be secured, the exporter logs the initialization failure and
|
|
120
|
+
degrades to network-only delivery; successful and non-retryable live sends still complete, but
|
|
121
|
+
retryable results that cannot be persisted fail.
|
|
122
|
+
|
|
91
123
|
For A365 scenarios, scope APIs, baggage, hosting middleware, and official terminology alignment, see [A365_DOCUMENTATION.md](./A365_DOCUMENTATION.md).
|
|
92
124
|
|
|
93
125
|
### Azure Monitor
|
|
@@ -119,19 +151,19 @@ That's it — traces, metrics, and logs are collected automatically with built-i
|
|
|
119
151
|
|
|
120
152
|
### `MicrosoftOpenTelemetryOptions`
|
|
121
153
|
|
|
122
|
-
| Option | Type | Default | Description
|
|
123
|
-
| ------------------------ | ---------------------------------- | ------------- |
|
|
124
|
-
| `resource` | `Resource` | auto-detected | OpenTelemetry Resource (service name, version, etc.)
|
|
125
|
-
| `samplingRatio` | `number` | `1.0` | Ratio of telemetry items to transmit (0.0–1.0)
|
|
126
|
-
| `tracesPerSecond` | `number` | `5` | Max traces per second. Set to `0` to use `samplingRatio` instead
|
|
127
|
-
| `instrumentationOptions` | `InstrumentationOptions` | all enabled | Toggle built-in instrumentations (see below)
|
|
128
|
-
| `spanProcessors` | `SpanProcessor[]` | — | Additional span processors
|
|
129
|
-
| `logRecordProcessors` | `LogRecordProcessor[]` | — | Additional log record processors
|
|
130
|
-
| `metricReaders` | `MetricReader[]` | — | Additional metric readers
|
|
131
|
-
| `views` | `ViewOptions[]` | — | Metric views
|
|
132
|
-
| `azureMonitor` | `AzureMonitorOpenTelemetryOptions` | — | Azure Monitor backend config. When provided, Azure Monitor export is enabled
|
|
133
|
-
| `a365` | `A365Options` | — | A365 observability config
|
|
134
|
-
| `enableConsoleExporters` | `boolean` | auto | Enable console exporters for traces, metrics, and logs
|
|
154
|
+
| Option | Type | Default | Description |
|
|
155
|
+
| ------------------------ | ---------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
156
|
+
| `resource` | `Resource` | auto-detected | OpenTelemetry Resource (service name, version, etc.) |
|
|
157
|
+
| `samplingRatio` | `number` | `1.0` | Ratio of telemetry items to transmit (0.0–1.0) |
|
|
158
|
+
| `tracesPerSecond` | `number` | `5` | Max traces per second. Set to `0` to use `samplingRatio` instead |
|
|
159
|
+
| `instrumentationOptions` | `InstrumentationOptions` | all enabled | Toggle built-in instrumentations (see below) |
|
|
160
|
+
| `spanProcessors` | `SpanProcessor[]` | — | Additional span processors |
|
|
161
|
+
| `logRecordProcessors` | `LogRecordProcessor[]` | — | Additional log record processors |
|
|
162
|
+
| `metricReaders` | `MetricReader[]` | — | Additional metric readers |
|
|
163
|
+
| `views` | `ViewOptions[]` | — | Metric views |
|
|
164
|
+
| `azureMonitor` | `AzureMonitorOpenTelemetryOptions` | — | Azure Monitor backend config. When provided, Azure Monitor export is enabled |
|
|
165
|
+
| `a365` | `A365Options` | — | A365 observability config |
|
|
166
|
+
| `enableConsoleExporters` | `boolean` | auto | Enable console exporters for traces, metrics, and logs |
|
|
135
167
|
| `enableSensitiveData` | `boolean` | `false` | Capture GenAI message content (prompts, completions, tool args/results, system instructions) on LangChain spans. Only enable in trusted, non-production environments |
|
|
136
168
|
|
|
137
169
|
### `InstrumentationOptions`
|
|
@@ -256,6 +288,7 @@ See the [OpenTelemetry OTLP Exporter specification](https://opentelemetry.io/doc
|
|
|
256
288
|
| `observabilityScopeOverride` | `string` | — | Single-string scope override (highest precedence). Equivalent to `A365_OBSERVABILITY_SCOPES_OVERRIDE` env var |
|
|
257
289
|
| `logLevel` | `string` | `"none"` | A365 internal log level: `none`, `info`, `warn`, `error`, or pipe-separated combination. Overrides `A365_OBSERVABILITY_LOG_LEVEL` env var |
|
|
258
290
|
| `useS2SEndpoint` | `boolean` | `false` | Use the S2S (service-to-service) endpoint path for export |
|
|
291
|
+
| `durableDelivery` | `Agent365DurableDeliveryOptions` | enabled with defaults | Enabled-by-default local store-and-replay for retryable A365 HTTP export requests when the A365 HTTP exporter is active. Set `durableDelivery.enabled: false` to force network-only delivery. Replays use fresh tokens/current routing, records stay in bounded plaintext local storage, and storage-init failures degrade to network-only delivery |
|
|
259
292
|
|
|
260
293
|
When A365 export is enabled, Microsoft OpenTelemetry defaults to GenAI-focused telemetry. To opt back into non-GenAI auto-instrumentation, set explicit overrides:
|
|
261
294
|
|
|
@@ -325,14 +358,68 @@ new ObservabilityHostingManager().configure(adapter as unknown as { use(...m: un
|
|
|
325
358
|
|
|
326
359
|
#### A365 exporter tuning
|
|
327
360
|
|
|
328
|
-
| Option | Type | Default
|
|
329
|
-
| -------------------------------- | -------- |
|
|
330
|
-
| `maxQueueSize` | `number` | `2048`
|
|
331
|
-
| `scheduledDelayMilliseconds` | `number` | `5000`
|
|
332
|
-
| `exporterTimeoutMilliseconds` | `number` | `90000`
|
|
333
|
-
| `httpRequestTimeoutMilliseconds` | `number` | `30000`
|
|
334
|
-
| `maxExportBatchSize` | `number` | `512`
|
|
335
|
-
| `maxPayloadBytes` | `number` |
|
|
361
|
+
| Option | Type | Default | Description |
|
|
362
|
+
| -------------------------------- | -------- | ------------ | ------------------------------------------------------------ |
|
|
363
|
+
| `maxQueueSize` | `number` | `2048` | Maximum span queue size before drops occur |
|
|
364
|
+
| `scheduledDelayMilliseconds` | `number` | `5000` | Delay (ms) between automatic batch flush attempts |
|
|
365
|
+
| `exporterTimeoutMilliseconds` | `number` | `90000` | Maximum time (ms) for the entire export call |
|
|
366
|
+
| `httpRequestTimeoutMilliseconds` | `number` | `30000` | HTTP request timeout (ms) when sending spans to A365 service |
|
|
367
|
+
| `maxExportBatchSize` | `number` | `512` | Maximum number of spans per export batch |
|
|
368
|
+
| `maxPayloadBytes` | `number` | `900 * 1024` | Maximum estimated payload size (bytes) per HTTP chunk |
|
|
369
|
+
|
|
370
|
+
#### A365 durable delivery
|
|
371
|
+
|
|
372
|
+
Durable delivery applies only to the A365 HTTP exporter, so set both `a365.enabled: true` and
|
|
373
|
+
`a365.enableObservabilityExporter: true` when you use it. Durable delivery is enabled by default;
|
|
374
|
+
set `durableDelivery.enabled: false` to force legacy network-only delivery.
|
|
375
|
+
|
|
376
|
+
| Option | Type | Default | Description |
|
|
377
|
+
| ------------------------------------ | --------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
378
|
+
| `enabled` | `boolean` | `true` | Durable delivery stays on unless you explicitly disable it |
|
|
379
|
+
| `storageDirectory` | `string` | auto | Root directory for durable records. When omitted, the SDK probes `LOCALAPPDATA`, then `TEMP`, then `os.tmpdir()` on Windows and appends `Microsoft/A365/otel-durable`; on POSIX it probes `TMPDIR`, then `/var/tmp`, then `/tmp` and uses the single `a365-otel-durable-<uid>` leaf. Every base root then gets a stable per-application `app-<hash>` child |
|
|
380
|
+
| `maxStorageBytes` | `number` | `50 * 1024 * 1024` | Maximum total bytes retained for pending and quarantined durable records |
|
|
381
|
+
| `maxRecordAgeMilliseconds` | `number` | `2 * 24 * 60 * 60 * 1000` | Maximum record age before expiry pruning |
|
|
382
|
+
| `replayIntervalMilliseconds` | `number` | `2 * 60 * 1000` | Delay between scheduled replay passes |
|
|
383
|
+
| `maxReplayBatchSize` | `number` | `10` | Maximum records claimed per replay pass |
|
|
384
|
+
| `leaseDurationMilliseconds` | `number` | `2 * 60 * 1000` | How long a claimed replay lease stays active before recovery |
|
|
385
|
+
| `shutdownTimeoutMilliseconds` | `number` | `10_000` | Shared graceful-shutdown budget for accepted live exports and admitted durable handoff completion |
|
|
386
|
+
| `tokenResolutionTimeoutMilliseconds` | `number` | `30_000` | Timeout for each replay token-resolution attempt |
|
|
387
|
+
|
|
388
|
+
Operational notes:
|
|
389
|
+
|
|
390
|
+
- Durable records are stored as plaintext JSON files. On POSIX, the SDK creates owner-only durable
|
|
391
|
+
directories/files (`0700` / `0600`). On Windows, the SDK removes inherited ACLs and grants full
|
|
392
|
+
control only to the current Windows identity and built-in Administrators. ACL hardening failures
|
|
393
|
+
cause durable storage initialization to fail and the exporter to use network-only delivery.
|
|
394
|
+
- Durable delivery is enabled by default when the A365 HTTP exporter is active. Set
|
|
395
|
+
`durableDelivery.enabled: false` to force legacy network-only delivery.
|
|
396
|
+
- Durable delivery is at-least-once. If a retryable request succeeds immediately before a crash or
|
|
397
|
+
after replay, duplicates are possible and receivers must be idempotent.
|
|
398
|
+
- Every replay attempt and `forceFlush()` pass resolves a fresh token and uses the exporter's
|
|
399
|
+
current cluster/domain routing; durable files do not store bearer tokens or authoritative route
|
|
400
|
+
metadata.
|
|
401
|
+
- If durable storage cannot initialize, the exporter logs the error and continues in network-only
|
|
402
|
+
mode. Successful and non-retryable live sends still complete, but retryable results that cannot
|
|
403
|
+
be persisted are reported as failures.
|
|
404
|
+
- If token resolution returns no token, throws, or times out, live delivery attempts to persist the
|
|
405
|
+
record for replay and replay releases the claim without extending the shared transmission backoff.
|
|
406
|
+
- Storage is bounded by both `maxStorageBytes` and `maxRecordAgeMilliseconds`; expired records are
|
|
407
|
+
pruned first, then the oldest retained records are evicted until the new record fits.
|
|
408
|
+
- Live delivery and replay share the same `Retry-After` / exponential-backoff transmission gate, so
|
|
409
|
+
a retryable response (401, 408, 429, or 5xx) pauses both immediate sends and replay probes until
|
|
410
|
+
the gate reopens.
|
|
411
|
+
- If you run in containers and need records to survive container restarts, rescheduling, or host
|
|
412
|
+
restarts outside the current container filesystem, set `storageDirectory` to a protected
|
|
413
|
+
persistent volume and size `maxStorageBytes` within your platform's storage quota.
|
|
414
|
+
- During `shutdownMicrosoftOpenTelemetry()`, the exporter first waits up to
|
|
415
|
+
`shutdownTimeoutMilliseconds` for already accepted live exports to settle. When durable delivery
|
|
416
|
+
is enabled, it also stops replay scheduling immediately, aborts in-flight durable HTTP, and uses
|
|
417
|
+
the same deadline for already admitted durable handoff completion. Retryable aborted payloads
|
|
418
|
+
stay on disk for replay on the next process or startup pass; shutdown does not drain the existing
|
|
419
|
+
spool. If you use `Agent365Exporter` directly, you may call `forceFlush()` before shutdown for
|
|
420
|
+
one bounded replay pass. The distro shutdown path does not call `exporter.forceFlush()`. When
|
|
421
|
+
durable delivery is disabled—or durable storage never initialized and the exporter stayed
|
|
422
|
+
network-only—shutdown still drains accepted live exports but does not replay or persist anything.
|
|
336
423
|
|
|
337
424
|
Example:
|
|
338
425
|
|
|
@@ -340,32 +427,38 @@ Example:
|
|
|
340
427
|
useMicrosoftOpenTelemetry({
|
|
341
428
|
a365: {
|
|
342
429
|
enabled: true,
|
|
343
|
-
|
|
430
|
+
enableObservabilityExporter: true,
|
|
431
|
+
tokenResolver: (agentId, tenantId, authScopes) => getToken(agentId, tenantId, authScopes),
|
|
344
432
|
maxQueueSize: 4096,
|
|
345
433
|
maxExportBatchSize: 1024,
|
|
346
434
|
scheduledDelayMilliseconds: 10000,
|
|
347
435
|
httpRequestTimeoutMilliseconds: 15000,
|
|
436
|
+
durableDelivery: {
|
|
437
|
+
storageDirectory: process.env.A365_DURABLE_STORAGE_DIRECTORY,
|
|
438
|
+
maxStorageBytes: 50 * 1024 * 1024,
|
|
439
|
+
maxRecordAgeMilliseconds: 2 * 24 * 60 * 60 * 1000,
|
|
440
|
+
},
|
|
348
441
|
},
|
|
349
442
|
});
|
|
350
443
|
```
|
|
351
444
|
|
|
352
445
|
#### A365 environment variables
|
|
353
446
|
|
|
354
|
-
A365
|
|
355
|
-
|
|
356
|
-
| Environment Variable | Description
|
|
357
|
-
| ---------------------------------------------- |
|
|
358
|
-
| `ENABLE_A365_OBSERVABILITY_EXPORTER` | `"true"` / `"false"` —
|
|
359
|
-
| `A365_OBSERVABILITY_SCOPES_OVERRIDE` | Space-separated list of OAuth scopes
|
|
360
|
-
| `A365_OBSERVABILITY_DOMAIN_OVERRIDE` | Override service domain
|
|
361
|
-
| `CLUSTER_CATEGORY` | Override cluster category
|
|
362
|
-
| `A365_OBSERVABILITY_LOG_LEVEL` | A365 internal logger filter level (`none`, `info`, `warn`, `error`, or pipe-delimited combination) — overrides `observabilityLogLevel`
|
|
363
|
-
| `A365_PER_REQUEST_MAX_TRACES` | Max buffered traces (default: `1000`)
|
|
364
|
-
| `A365_PER_REQUEST_MAX_SPANS_PER_TRACE` | Max spans per trace (default: `5000`)
|
|
365
|
-
| `A365_PER_REQUEST_MAX_CONCURRENT_EXPORTS` | Max concurrent exports (default: `20`)
|
|
366
|
-
| `A365_PER_REQUEST_FLUSH_GRACE_MS` | Grace period after root span ends (default: `250`)
|
|
367
|
-
| `A365_PER_REQUEST_MAX_TRACE_AGE_MS` | Max trace age before forced flush (default: `1800000`)
|
|
368
|
-
| `A365_OBSERVABILITY_TOKEN_EXCHANGE_TIMEOUT_MS` | Per-attempt timeout (ms) for agentic token exchange; `0` or negative disables (default: `30000`)
|
|
447
|
+
A365 also reads the following environment overrides:
|
|
448
|
+
|
|
449
|
+
| Environment Variable | Description |
|
|
450
|
+
| ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
451
|
+
| `ENABLE_A365_OBSERVABILITY_EXPORTER` | `"true"` / `"false"` — secondary toggle for the A365 HTTP exporter when `a365` options are provided in code; it does not enable `a365.enabled` on its own |
|
|
452
|
+
| `A365_OBSERVABILITY_SCOPES_OVERRIDE` | Space-separated list of OAuth scopes |
|
|
453
|
+
| `A365_OBSERVABILITY_DOMAIN_OVERRIDE` | Override service domain |
|
|
454
|
+
| `CLUSTER_CATEGORY` | Override cluster category |
|
|
455
|
+
| `A365_OBSERVABILITY_LOG_LEVEL` | A365 internal logger filter level (`none`, `info`, `warn`, `error`, or pipe-delimited combination) — overrides `observabilityLogLevel` |
|
|
456
|
+
| `A365_PER_REQUEST_MAX_TRACES` | Max buffered traces (default: `1000`) |
|
|
457
|
+
| `A365_PER_REQUEST_MAX_SPANS_PER_TRACE` | Max spans per trace (default: `5000`) |
|
|
458
|
+
| `A365_PER_REQUEST_MAX_CONCURRENT_EXPORTS` | Max concurrent exports (default: `20`) |
|
|
459
|
+
| `A365_PER_REQUEST_FLUSH_GRACE_MS` | Grace period after root span ends (default: `250`) |
|
|
460
|
+
| `A365_PER_REQUEST_MAX_TRACE_AGE_MS` | Max trace age before forced flush (default: `1800000`) |
|
|
461
|
+
| `A365_OBSERVABILITY_TOKEN_EXCHANGE_TIMEOUT_MS` | Per-attempt timeout (ms) for agentic token exchange; `0` or negative disables (default: `30000`) |
|
|
369
462
|
|
|
370
463
|
### Example
|
|
371
464
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { A365Options, ClusterCategory } from "./A365ConfigurationOptions.js";
|
|
2
|
+
import type { Agent365DurableDeliveryOptions } from "../exporter/durable/index.js";
|
|
2
3
|
import type { ContextualTokenResolver } from "../exporter/Agent365ExporterOptions.js";
|
|
3
4
|
/**
|
|
4
5
|
* Environment variable names for A365 configuration.
|
|
@@ -64,6 +65,8 @@ export declare class A365Configuration {
|
|
|
64
65
|
readonly maxExportBatchSize?: number;
|
|
65
66
|
/** Maximum estimated payload size (bytes) per HTTP chunk. */
|
|
66
67
|
readonly maxPayloadBytes?: number;
|
|
68
|
+
/** Durable delivery options for local spool-and-replay behavior. */
|
|
69
|
+
readonly durableDelivery?: Agent365DurableDeliveryOptions;
|
|
67
70
|
constructor(options?: A365Options);
|
|
68
71
|
private _warnIfOptionsSetButDisabled;
|
|
69
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A365Configuration.d.ts","sourceRoot":"","sources":["../../../../src/a365/configuration/A365Configuration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAuBtF;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAmBX;;;;;;;GAOG;AACH,qBAAa,iBAAiB;IAC5B,6CAA6C;IAC7C,SAAgB,OAAO,EAAE,OAAO,CAAC;IAEjC,+DAA+D;IAC/D,SAAgB,aAAa,CAAC,EAAE,CAC9B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EAAE,KAClB,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9B,iFAAiF;IACjF,SAAgB,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAElE,wBAAwB;IACxB,SAAgB,eAAe,EAAE,eAAe,CAAC;IAEjD,0DAA0D;IAC1D,SAAgB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExC,oDAAoD;IACpD,SAAgB,UAAU,EAAE,MAAM,EAAE,CAAC;IAErC;;;;;;;;OAQG;IACH,SAAgB,2BAA2B,EAAE,OAAO,CAAC;IAErD;;;;;;OAMG;IACH,SAAgB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElC,uDAAuD;IACvD,SAAgB,cAAc,EAAE,OAAO,CAAC;IAExC,kDAAkD;IAClD,SAAgB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtC,yDAAyD;IACzD,SAAgB,0BAA0B,CAAC,EAAE,MAAM,CAAC;IAEpD,sDAAsD;IACtD,SAAgB,2BAA2B,CAAC,EAAE,MAAM,CAAC;IAErD,gDAAgD;IAChD,SAAgB,8BAA8B,CAAC,EAAE,MAAM,CAAC;IAExD,gDAAgD;IAChD,SAAgB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5C,6DAA6D;IAC7D,SAAgB,eAAe,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"A365Configuration.d.ts","sourceRoot":"","sources":["../../../../src/a365/configuration/A365Configuration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAC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,CAAC,EAAE,WAAW;IA6FjC,OAAO,CAAC,4BAA4B;CAiBrC"}
|
|
@@ -104,6 +104,8 @@ class A365Configuration {
|
|
|
104
104
|
maxExportBatchSize;
|
|
105
105
|
/** Maximum estimated payload size (bytes) per HTTP chunk. */
|
|
106
106
|
maxPayloadBytes;
|
|
107
|
+
/** Durable delivery options for local spool-and-replay behavior. */
|
|
108
|
+
durableDelivery;
|
|
107
109
|
constructor(options) {
|
|
108
110
|
// 1. Set defaults
|
|
109
111
|
let enabled = false;
|
|
@@ -178,6 +180,7 @@ class A365Configuration {
|
|
|
178
180
|
this.httpRequestTimeoutMilliseconds = options?.httpRequestTimeoutMilliseconds;
|
|
179
181
|
this.maxExportBatchSize = options?.maxExportBatchSize;
|
|
180
182
|
this.maxPayloadBytes = options?.maxPayloadBytes;
|
|
183
|
+
this.durableDelivery = options?.durableDelivery;
|
|
181
184
|
// Warn when A365-scoped options are set but A365 is not enabled
|
|
182
185
|
if (!this.enabled) {
|
|
183
186
|
this._warnIfOptionsSetButDisabled(options);
|
|
@@ -188,7 +191,8 @@ class A365Configuration {
|
|
|
188
191
|
return;
|
|
189
192
|
const hasNonTrivialOptions = options.tokenResolver !== undefined ||
|
|
190
193
|
options.contextualTokenResolver !== undefined ||
|
|
191
|
-
options.domainOverride !== undefined
|
|
194
|
+
options.domainOverride !== undefined ||
|
|
195
|
+
options.durableDelivery !== undefined;
|
|
192
196
|
if (hasNonTrivialOptions) {
|
|
193
197
|
(0, logging_js_1.getA365Logger)().warn("A365 configuration options are set but A365 is not enabled. " +
|
|
194
198
|
"Set `a365.enabled: true` or set `ENABLE_A365_OBSERVABILITY_EXPORTER=true` " +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A365Configuration.js","sourceRoot":"","sources":["../../../../src/a365/configuration/A365Configuration.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;
|
|
1
|
+
{"version":3,"file":"A365Configuration.js","sourceRoot":"","sources":["../../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ACxB,OAAO,CAAC,aAAa,KAAK,SAAS;YACnC,OAAO,CAAC,uBAAuB,KAAK,SAAS;YAC7C,OAAO,CAAC,cAAc,KAAK,SAAS;YACpC,OAAO,CAAC,eAAe,KAAK,SAAS,CAAC;QAExC,IAAI,oBAAoB,EAAE,CAAC;YACzB,IAAA,0BAAa,GAAE,CAAC,IAAI,CAClB,8DAA8D;gBAC5D,4EAA4E;gBAC5E,yEAAyE,CAC5E,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAjLD,8CAiLC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ContextualTokenResolver } from "../exporter/Agent365ExporterOptions.js";
|
|
2
|
+
import type { Agent365DurableDeliveryOptions } from "../exporter/durable/index.js";
|
|
2
3
|
/**
|
|
3
4
|
* Cluster categories for A365 service endpoint resolution.
|
|
4
5
|
* Mirrors the ClusterCategory enum from Agent365-nodejs.
|
|
@@ -82,5 +83,7 @@ export interface A365Options {
|
|
|
82
83
|
maxExportBatchSize?: number;
|
|
83
84
|
/** Maximum estimated payload size (bytes) per HTTP chunk. */
|
|
84
85
|
maxPayloadBytes?: number;
|
|
86
|
+
/** Durable delivery options for local spool-and-replay behavior. */
|
|
87
|
+
durableDelivery?: Agent365DurableDeliveryOptions;
|
|
85
88
|
}
|
|
86
89
|
//# sourceMappingURL=A365ConfigurationOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A365ConfigurationOptions.d.ts","sourceRoot":"","sources":["../../../../src/a365/configuration/A365ConfigurationOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"A365ConfigurationOptions.d.ts","sourceRoot":"","sources":["../../../../src/a365/configuration/A365ConfigurationOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,KAAK,EAAE,8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,CAAC;IAEzB,oEAAoE;IACpE,eAAe,CAAC,EAAE,8BAA8B,CAAC;CAClD"}
|
|
@@ -170,7 +170,7 @@ export declare class OpenTelemetryConstants {
|
|
|
170
170
|
/** Telemetry SDK language value reported by this distro. */
|
|
171
171
|
static readonly TELEMETRY_SDK_LANGUAGE_VALUE = "nodejs";
|
|
172
172
|
/** Telemetry SDK version value reported by this distro. */
|
|
173
|
-
static readonly TELEMETRY_SDK_VERSION_VALUE = "1.
|
|
173
|
+
static readonly TELEMETRY_SDK_VERSION_VALUE = "1.4.0";
|
|
174
174
|
/** Operation name used for guardrail-evaluation spans. */
|
|
175
175
|
static readonly APPLY_GUARDRAIL_OPERATION_NAME = "apply_guardrail";
|
|
176
176
|
/** Attribute key for the guardian identifier (`microsoft.guardian.id`). */
|
|
@@ -11,6 +11,13 @@ import type { Agent365ExporterOptions } from "./Agent365ExporterOptions.js";
|
|
|
11
11
|
export declare class Agent365Exporter implements SpanExporter {
|
|
12
12
|
private closed;
|
|
13
13
|
private readonly options;
|
|
14
|
+
private durableManager?;
|
|
15
|
+
private durableInitializationPromise?;
|
|
16
|
+
private durableInitializationError?;
|
|
17
|
+
private durableInitializationFailed;
|
|
18
|
+
private shutdownPromise?;
|
|
19
|
+
private shutdownFinalized;
|
|
20
|
+
private readonly activeExports;
|
|
14
21
|
private get logger();
|
|
15
22
|
/**
|
|
16
23
|
* Creates a new Agent365 span exporter.
|
|
@@ -38,8 +45,21 @@ export declare class Agent365Exporter implements SpanExporter {
|
|
|
38
45
|
* @param resultCallback Callback invoked with the export result.
|
|
39
46
|
*/
|
|
40
47
|
export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): Promise<void>;
|
|
48
|
+
private exportInternal;
|
|
41
49
|
private exportGroup;
|
|
50
|
+
private exportNetworkGroup;
|
|
51
|
+
private exportDurableGroup;
|
|
42
52
|
private resolveToken;
|
|
53
|
+
private resolveRecordToken;
|
|
54
|
+
private resolveTokenForIdentity;
|
|
55
|
+
private buildExportUrl;
|
|
56
|
+
private buildReplayUrl;
|
|
57
|
+
private warnIfSendingBearerTokenToNonHttpsEndpoint;
|
|
58
|
+
private validateReplayRecord;
|
|
59
|
+
private getAgenticUserId;
|
|
60
|
+
private getDurableManager;
|
|
61
|
+
private startDurableInitialization;
|
|
62
|
+
private postRecordOnce;
|
|
43
63
|
private postWithRetries;
|
|
44
64
|
private mapAndTruncateSpans;
|
|
45
65
|
private getResourceAttributes;
|
|
@@ -47,14 +67,20 @@ export declare class Agent365Exporter implements SpanExporter {
|
|
|
47
67
|
private mapSpan;
|
|
48
68
|
/**
|
|
49
69
|
* Shuts down the exporter. After this resolves, subsequent {@link export}
|
|
50
|
-
* calls fail immediately.
|
|
70
|
+
* calls fail immediately. Accepted exports settle before shutdown completes
|
|
71
|
+
* when they finish before the configured shutdown deadline; durable delivery
|
|
72
|
+
* requests are aborted at that deadline.
|
|
51
73
|
*/
|
|
52
74
|
shutdown(): Promise<void>;
|
|
53
75
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
76
|
+
* Waits for accepted exports and drains pending durable records when durable
|
|
77
|
+
* delivery is enabled.
|
|
56
78
|
*/
|
|
57
79
|
forceFlush(): Promise<void>;
|
|
80
|
+
private shutdownInternal;
|
|
81
|
+
private waitForActiveExports;
|
|
82
|
+
private waitForWithinShutdownDeadline;
|
|
83
|
+
private closeLateDurableManager;
|
|
58
84
|
private logExporterEvent;
|
|
59
85
|
}
|
|
60
86
|
//# sourceMappingURL=Agent365Exporter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agent365Exporter.d.ts","sourceRoot":"","sources":["../../../../src/a365/exporter/Agent365Exporter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE9F,OAAO,KAAK,EAAE,uBAAuB,EA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