@logbrew/sdk 0.1.29 → 0.1.30
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 +2 -2
- package/core.cjs +2 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -456,7 +456,7 @@ Prefer removing sensitive values at the source before calling LogBrew. `eventFil
|
|
|
456
456
|
|
|
457
457
|
## Automatic Delivery
|
|
458
458
|
|
|
459
|
-
When a client owns a `transport`, it automatically sends queued work after
|
|
459
|
+
When a client owns a `transport`, it automatically sends queued work 1 second after the first queued event or when 50 events are waiting, whichever happens first, so a single event is readable in about a second while bursts still share one request. The one-shot timer starts only after capture, later events do not restart it, is `unref()`'d on Node.js, and is cancelled by manual flush, purge, or shutdown. Automatic sends reuse the same serialized flush path, immutable retry body, accepted-prefix acknowledgement, and persistent queue as manual calls. They do not install process, signal, page, or exit hooks.
|
|
460
460
|
|
|
461
461
|
```js
|
|
462
462
|
const transport = RecordingTransport.alwaysAccept();
|
|
@@ -465,7 +465,7 @@ const client = LogBrewClient.create({
|
|
|
465
465
|
sdkName: "checkout-api",
|
|
466
466
|
sdkVersion: "1.0.0",
|
|
467
467
|
transport,
|
|
468
|
-
deliveryIntervalMs:
|
|
468
|
+
deliveryIntervalMs: 1000,
|
|
469
469
|
deliveryQueueThreshold: 50
|
|
470
470
|
});
|
|
471
471
|
|
package/core.cjs
CHANGED
|
@@ -88,7 +88,8 @@ const DEFAULT_MAX_QUEUE_SIZE = 1000;
|
|
|
88
88
|
const DEFAULT_MAX_QUEUE_BYTES = 4 * 1024 * 1024;
|
|
89
89
|
const DEFAULT_MAX_BATCH_EVENTS = 100;
|
|
90
90
|
const DEFAULT_MAX_BATCH_BYTES = 256 * 1024;
|
|
91
|
-
|
|
91
|
+
// One second matches the OpenTelemetry log processor default, so a lone event becomes readable quickly.
|
|
92
|
+
const DEFAULT_DELIVERY_INTERVAL_MS = 1000;
|
|
92
93
|
const MAX_DELIVERY_INTERVAL_MS = 60 * 1000;
|
|
93
94
|
const DEFAULT_DELIVERY_QUEUE_THRESHOLD = 50;
|
|
94
95
|
const MAX_CLIENT_REPORT_REASONS = 16;
|
package/index.d.ts
CHANGED
|
@@ -886,7 +886,7 @@ export declare class LogBrewClient {
|
|
|
886
886
|
transport?: Transport;
|
|
887
887
|
/** Enable interval and queue-threshold delivery. Defaults to true when transport is supplied. */
|
|
888
888
|
automaticDelivery?: boolean;
|
|
889
|
-
/** One-shot delivery interval in milliseconds. Defaults to
|
|
889
|
+
/** One-shot delivery interval in milliseconds. Defaults to 1000 and must not exceed 60000. */
|
|
890
890
|
deliveryIntervalMs?: number;
|
|
891
891
|
/** Queue count that triggers delivery without waiting for the interval. Defaults to min(50, maxQueueSize). */
|
|
892
892
|
deliveryQueueThreshold?: number;
|