@lunora/runtime 1.0.0-alpha.33 → 1.0.0-alpha.34
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/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ export { DEFAULT_REGISTRY_CACHE_TTL_MS, SHARD_REGISTRY_DO_NAME, createDynamicSha
|
|
|
5
5
|
export { LunoraError, toErrorResponse } from './packem_shared/LunoraError-Bpb9EFJ3.mjs';
|
|
6
6
|
export { LOG_ARCHIVE_PATH, resolveLogArchiveFromEnv } from './packem_shared/LOG_ARCHIVE_PATH-CNs0bznX.mjs';
|
|
7
7
|
export { emitLogEvent, emitRpcEvent } from './packem_shared/emitLogEvent-pEdtqAK8.mjs';
|
|
8
|
-
export { analyticsEngineSink, combineSinks, consoleSink, otlpSink, pipelineLogSink, sentrySink, webhookSink } from './packem_shared/analyticsEngineSink-
|
|
8
|
+
export { analyticsEngineSink, combineSinks, consoleSink, otlpSink, pipelineLogSink, sentrySink, webhookSink } from './packem_shared/analyticsEngineSink-DE48mQA9.mjs';
|
|
9
9
|
export { D as DEFAULT_LOG_COLUMNS, a as DEFAULT_LOG_LIMIT, c as createPipelineLogReader } from './packem_shared/pipeline-log-reader-BXULGNC3.mjs';
|
|
10
10
|
export { createQueryCoordinator, createStaticShardRegistry, mergeStrategyForAggregate } from './packem_shared/createQueryCoordinator-DNCJzOZE.mjs';
|
|
11
11
|
export { applyJurisdiction, resolveShard } from './packem_shared/applyJurisdiction-BkZtTkct.mjs';
|
package/dist/packem_shared/{analyticsEngineSink-Bn7p0URe.mjs → analyticsEngineSink-DE48mQA9.mjs}
RENAMED
|
@@ -139,9 +139,15 @@ const otlpLogBody = (event, serviceName) => {
|
|
|
139
139
|
}
|
|
140
140
|
return wrapResourceLogs(logRecord, "@lunora/runtime", serviceName);
|
|
141
141
|
};
|
|
142
|
+
const OTLP_GZIP_THRESHOLD = 1024;
|
|
143
|
+
const gzipEncode = async (text) => {
|
|
144
|
+
const stream = new Blob([text]).stream().pipeThrough(new CompressionStream("gzip"));
|
|
145
|
+
return new Response(stream).arrayBuffer();
|
|
146
|
+
};
|
|
142
147
|
const otlpPost = (url, body, headers, context) => {
|
|
143
148
|
try {
|
|
144
|
-
const
|
|
149
|
+
const json = JSON.stringify(body);
|
|
150
|
+
const sent = (json.length < OTLP_GZIP_THRESHOLD ? fetch(url, { body: json, headers, method: "POST" }) : gzipEncode(json).then((gz) => fetch(url, { body: gz, headers: { ...headers, "content-encoding": "gzip" }, method: "POST" }))).catch(() => {
|
|
145
151
|
});
|
|
146
152
|
if (context?.waitUntil) {
|
|
147
153
|
context.waitUntil(sent);
|