@dbos-inc/dbos-sdk 0.7.35 → 0.8.14-preview
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/cloud-cli/applications/configure.d.ts +1 -1
- package/dist/src/cloud-cli/applications/configure.d.ts.map +1 -1
- package/dist/src/cloud-cli/applications/configure.js +35 -28
- package/dist/src/cloud-cli/applications/configure.js.map +1 -1
- package/dist/src/cloud-cli/applications/delete-app.js +1 -1
- package/dist/src/cloud-cli/applications/delete-app.js.map +1 -1
- package/dist/src/cloud-cli/applications/deploy-app-code.d.ts.map +1 -1
- package/dist/src/cloud-cli/applications/deploy-app-code.js +10 -2
- package/dist/src/cloud-cli/applications/deploy-app-code.js.map +1 -1
- package/dist/src/cloud-cli/applications/get-app-logs.js +1 -1
- package/dist/src/cloud-cli/applications/get-app-logs.js.map +1 -1
- package/dist/src/cloud-cli/applications/list-apps.js +1 -1
- package/dist/src/cloud-cli/applications/list-apps.js.map +1 -1
- package/dist/src/cloud-cli/applications/register-app.js +1 -1
- package/dist/src/cloud-cli/applications/register-app.js.map +1 -1
- package/dist/src/cloud-cli/applications/update-app.d.ts.map +1 -1
- package/dist/src/cloud-cli/applications/update-app.js +3 -2
- package/dist/src/cloud-cli/applications/update-app.js.map +1 -1
- package/dist/src/cloud-cli/cli.js +6 -6
- package/dist/src/cloud-cli/cli.js.map +1 -1
- package/dist/src/cloud-cli/login.d.ts.map +1 -1
- package/dist/src/cloud-cli/login.js +3 -2
- package/dist/src/cloud-cli/login.js.map +1 -1
- package/dist/src/cloud-cli/register.js +1 -1
- package/dist/src/cloud-cli/register.js.map +1 -1
- package/dist/src/cloud-cli/userdb.d.ts +10 -2
- package/dist/src/cloud-cli/userdb.d.ts.map +1 -1
- package/dist/src/cloud-cli/userdb.js +63 -100
- package/dist/src/cloud-cli/userdb.js.map +1 -1
- package/dist/src/communicator.d.ts +1 -1
- package/dist/src/communicator.d.ts.map +1 -1
- package/dist/src/context.d.ts +1 -1
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/context.js +1 -1
- package/dist/src/context.js.map +1 -1
- package/dist/src/dbos-executor.d.ts +18 -7
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +155 -52
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/dbos-runtime/cli.d.ts +0 -1
- package/dist/src/dbos-runtime/cli.d.ts.map +1 -1
- package/dist/src/dbos-runtime/cli.js +14 -2
- package/dist/src/dbos-runtime/cli.js.map +1 -1
- package/dist/src/dbos-runtime/config.d.ts +0 -1
- package/dist/src/dbos-runtime/config.d.ts.map +1 -1
- package/dist/src/dbos-runtime/config.js +0 -1
- package/dist/src/dbos-runtime/config.js.map +1 -1
- package/dist/src/dbos-runtime/debug.d.ts +4 -0
- package/dist/src/dbos-runtime/debug.d.ts.map +1 -0
- package/dist/src/dbos-runtime/debug.js +23 -0
- package/dist/src/dbos-runtime/debug.js.map +1 -0
- package/dist/src/dbos-runtime/runtime.d.ts +1 -1
- package/dist/src/dbos-runtime/runtime.d.ts.map +1 -1
- package/dist/src/dbos-runtime/runtime.js +13 -14
- package/dist/src/dbos-runtime/runtime.js.map +1 -1
- package/dist/src/debugger/debug_workflow.js +6 -6
- package/dist/src/debugger/debug_workflow.js.map +1 -1
- package/dist/src/httpServer/server.d.ts +1 -1
- package/dist/src/httpServer/server.d.ts.map +1 -1
- package/dist/src/{dbos-runtime → staticAnalysis}/TypeParser.d.ts +4 -0
- package/dist/src/staticAnalysis/TypeParser.d.ts.map +1 -0
- package/dist/src/{dbos-runtime → staticAnalysis}/TypeParser.js +34 -1
- package/dist/src/staticAnalysis/TypeParser.js.map +1 -0
- package/dist/src/{dbos-runtime → staticAnalysis}/openApi.d.ts.map +1 -1
- package/dist/src/{dbos-runtime → staticAnalysis}/openApi.js +1 -31
- package/dist/src/staticAnalysis/openApi.js.map +1 -0
- package/dist/src/staticAnalysis/tsDiagUtil.d.ts.map +1 -0
- package/dist/src/staticAnalysis/tsDiagUtil.js.map +1 -0
- package/dist/src/system_database.d.ts +20 -9
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +36 -41
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/telemetry/collector.d.ts +5 -5
- package/dist/src/telemetry/collector.d.ts.map +1 -1
- package/dist/src/telemetry/collector.js +5 -17
- package/dist/src/telemetry/collector.js.map +1 -1
- package/dist/src/telemetry/exporters.d.ts +11 -24
- package/dist/src/telemetry/exporters.d.ts.map +1 -1
- package/dist/src/telemetry/exporters.js +42 -129
- package/dist/src/telemetry/exporters.js.map +1 -1
- package/dist/src/telemetry/index.d.ts +6 -2
- package/dist/src/telemetry/index.d.ts.map +1 -1
- package/dist/src/telemetry/index.js +16 -0
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/logs.d.ts +35 -11
- package/dist/src/telemetry/logs.d.ts.map +1 -1
- package/dist/src/telemetry/logs.js +158 -53
- package/dist/src/telemetry/logs.js.map +1 -1
- package/dist/src/telemetry/traces.d.ts +1 -6
- package/dist/src/telemetry/traces.d.ts.map +1 -1
- package/dist/src/telemetry/traces.js +2 -34
- package/dist/src/telemetry/traces.js.map +1 -1
- package/dist/src/testing/testing_runtime.d.ts +1 -1
- package/dist/src/testing/testing_runtime.js +1 -1
- package/dist/src/transaction.d.ts +1 -1
- package/dist/src/transaction.d.ts.map +1 -1
- package/dist/src/workflow.d.ts +2 -0
- package/dist/src/workflow.d.ts.map +1 -1
- package/dist/src/workflow.js +18 -13
- package/dist/src/workflow.js.map +1 -1
- package/examples/hello/dbos-config.yaml +0 -1
- package/package.json +3 -2
- package/dist/src/dbos-runtime/TypeParser.d.ts.map +0 -1
- package/dist/src/dbos-runtime/TypeParser.js.map +0 -1
- package/dist/src/dbos-runtime/openApi.js.map +0 -1
- package/dist/src/dbos-runtime/tsDiagUtil.d.ts.map +0 -1
- package/dist/src/dbos-runtime/tsDiagUtil.js.map +0 -1
- package/dist/src/telemetry/signals.d.ts +0 -20
- package/dist/src/telemetry/signals.d.ts.map +0 -1
- package/dist/src/telemetry/signals.js +0 -11
- package/dist/src/telemetry/signals.js.map +0 -1
- /package/dist/src/{dbos-runtime → staticAnalysis}/openApi.d.ts +0 -0
- /package/dist/src/{dbos-runtime → staticAnalysis}/tsDiagUtil.d.ts +0 -0
- /package/dist/src/{dbos-runtime → staticAnalysis}/tsDiagUtil.js +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.PostgresSystemDatabase =
|
4
|
+
exports.PostgresSystemDatabase = void 0;
|
5
5
|
const serialize_error_1 = require("serialize-error");
|
6
6
|
const dbos_executor_1 = require("./dbos-executor");
|
7
7
|
const pg_1 = require("pg");
|
@@ -9,7 +9,6 @@ const error_1 = require("./error");
|
|
9
9
|
const workflow_1 = require("./workflow");
|
10
10
|
const system_db_schema_1 = require("../schemas/system_db_schema");
|
11
11
|
const utils_1 = require("./utils");
|
12
|
-
exports.DBOSExecutorIDHeader = "dbos-executor-id";
|
13
12
|
class PostgresSystemDatabase {
|
14
13
|
pgPoolConfig;
|
15
14
|
systemDatabaseName;
|
@@ -53,7 +52,7 @@ class PostgresSystemDatabase {
|
|
53
52
|
await this.pool.end();
|
54
53
|
}
|
55
54
|
async checkWorkflowOutput(workflowUUID) {
|
56
|
-
const { rows } = await this.pool.query(
|
55
|
+
const { rows } = await this.pool.query(`SELECT status, output, error FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_status WHERE workflow_uuid=$1`, [workflowUUID]);
|
57
56
|
if (rows.length === 0 || rows[0].status === workflow_1.StatusString.PENDING) {
|
58
57
|
return dbos_executor_1.dbosNull;
|
59
58
|
}
|
@@ -64,17 +63,13 @@ class PostgresSystemDatabase {
|
|
64
63
|
return JSON.parse(rows[0].output);
|
65
64
|
}
|
66
65
|
}
|
67
|
-
async initWorkflowStatus(
|
68
|
-
|
69
|
-
|
70
|
-
executorID = request.headers[exports.DBOSExecutorIDHeader];
|
71
|
-
}
|
72
|
-
await this.pool.query(`INSERT INTO workflow_status (workflow_uuid, status, name, authenticated_user, assumed_role, authenticated_roles, request, output, executor_id) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9) ON CONFLICT (workflow_uuid) DO NOTHING`, [workflowUUID, workflow_1.StatusString.PENDING, name, authenticatedUser, assumedRole, JSON.stringify(authenticatedRoles), JSON.stringify(request), null, executorID]);
|
73
|
-
const { rows } = await this.pool.query(`INSERT INTO workflow_inputs (workflow_uuid, inputs) VALUES($1, $2) ON CONFLICT (workflow_uuid) DO UPDATE SET workflow_uuid = excluded.workflow_uuid RETURNING inputs`, [workflowUUID, JSON.stringify(args)]);
|
66
|
+
async initWorkflowStatus(initStatus, args) {
|
67
|
+
await this.pool.query(`INSERT INTO ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_status (workflow_uuid, status, name, authenticated_user, assumed_role, authenticated_roles, request, output, executor_id) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9) ON CONFLICT (workflow_uuid) DO NOTHING`, [initStatus.workflowUUID, initStatus.status, initStatus.name, initStatus.authenticatedUser, initStatus.assumedRole, JSON.stringify(initStatus.authenticatedRoles), JSON.stringify(initStatus.request), null, initStatus.executorID]);
|
68
|
+
const { rows } = await this.pool.query(`INSERT INTO ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_inputs (workflow_uuid, inputs) VALUES($1, $2) ON CONFLICT (workflow_uuid) DO UPDATE SET workflow_uuid = excluded.workflow_uuid RETURNING inputs`, [initStatus.workflowUUID, JSON.stringify(args)]);
|
74
69
|
return JSON.parse(rows[0].inputs);
|
75
70
|
}
|
76
|
-
bufferWorkflowOutput(workflowUUID,
|
77
|
-
this.workflowStatusBuffer.set(workflowUUID,
|
71
|
+
bufferWorkflowOutput(workflowUUID, status) {
|
72
|
+
this.workflowStatusBuffer.set(workflowUUID, status);
|
78
73
|
}
|
79
74
|
/**
|
80
75
|
* Flush the workflow output buffer to the database.
|
@@ -85,15 +80,16 @@ class PostgresSystemDatabase {
|
|
85
80
|
try {
|
86
81
|
const client = await this.pool.connect();
|
87
82
|
await client.query("BEGIN");
|
88
|
-
for (const [workflowUUID,
|
89
|
-
await client.query(`INSERT INTO workflow_status (workflow_uuid, status, output) VALUES($1, $2, $3) ON CONFLICT (workflow_uuid)
|
90
|
-
DO UPDATE SET status=EXCLUDED.status, output=EXCLUDED.output;`, [workflowUUID,
|
83
|
+
for (const [workflowUUID, status] of localBuffer) {
|
84
|
+
await client.query(`INSERT INTO ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_status (workflow_uuid, status, name, authenticated_user, assumed_role, authenticated_roles, request, output, executor_id) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9) ON CONFLICT (workflow_uuid)
|
85
|
+
DO UPDATE SET status=EXCLUDED.status, output=EXCLUDED.output;`, [workflowUUID, status.status, status.name, status.authenticatedUser, status.assumedRole, JSON.stringify(status.authenticatedRoles), JSON.stringify(status.request), JSON.stringify(status.output), status.executorID]);
|
91
86
|
}
|
92
87
|
await client.query("COMMIT");
|
93
88
|
client.release();
|
94
89
|
}
|
95
90
|
catch (error) {
|
96
|
-
|
91
|
+
error.message = `Error flushing workflow buffer: ${error.message}`;
|
92
|
+
this.logger.error(error);
|
97
93
|
// If there is a failure in flushing the buffer, return items to the global buffer for retrying later.
|
98
94
|
for (const [workflowUUID, output] of localBuffer) {
|
99
95
|
if (!this.workflowStatusBuffer.has(workflowUUID)) {
|
@@ -103,27 +99,26 @@ class PostgresSystemDatabase {
|
|
103
99
|
}
|
104
100
|
return Array.from(localBuffer.keys());
|
105
101
|
}
|
106
|
-
async recordWorkflowError(workflowUUID,
|
107
|
-
|
108
|
-
|
109
|
-
DO UPDATE SET status=EXCLUDED.status, error=EXCLUDED.error;`, [workflowUUID, workflow_1.StatusString.ERROR, serialErr]);
|
102
|
+
async recordWorkflowError(workflowUUID, status) {
|
103
|
+
await this.pool.query(`INSERT INTO ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_status (workflow_uuid, status, name, authenticated_user, assumed_role, authenticated_roles, request, error, executor_id) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9) ON CONFLICT (workflow_uuid)
|
104
|
+
DO UPDATE SET status=EXCLUDED.status, error=EXCLUDED.error;`, [workflowUUID, workflow_1.StatusString.ERROR, status.name, status.authenticatedUser, status.assumedRole, JSON.stringify(status.authenticatedRoles), JSON.stringify(status.request), status.error, status.executorID]);
|
110
105
|
}
|
111
106
|
async getPendingWorkflows(executorID) {
|
112
|
-
const { rows } = await this.pool.query(`SELECT workflow_uuid FROM workflow_status WHERE status=$1 AND executor_id=$2`, [workflow_1.StatusString.PENDING, executorID]);
|
107
|
+
const { rows } = await this.pool.query(`SELECT workflow_uuid FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_status WHERE status=$1 AND executor_id=$2`, [workflow_1.StatusString.PENDING, executorID]);
|
113
108
|
return rows.map(i => i.workflow_uuid);
|
114
109
|
}
|
115
110
|
async setWorkflowInputs(workflowUUID, args) {
|
116
|
-
await this.pool.query(`INSERT INTO workflow_inputs (workflow_uuid, inputs) VALUES($1, $2) ON CONFLICT (workflow_uuid) DO NOTHING`, [workflowUUID, JSON.stringify(args)]);
|
111
|
+
await this.pool.query(`INSERT INTO ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_inputs (workflow_uuid, inputs) VALUES($1, $2) ON CONFLICT (workflow_uuid) DO NOTHING`, [workflowUUID, JSON.stringify(args)]);
|
117
112
|
}
|
118
113
|
async getWorkflowInputs(workflowUUID) {
|
119
|
-
const { rows } = await this.pool.query(`SELECT inputs FROM workflow_inputs WHERE workflow_uuid=$1`, [workflowUUID]);
|
114
|
+
const { rows } = await this.pool.query(`SELECT inputs FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_inputs WHERE workflow_uuid=$1`, [workflowUUID]);
|
120
115
|
if (rows.length === 0) {
|
121
116
|
return null;
|
122
117
|
}
|
123
118
|
return JSON.parse(rows[0].inputs);
|
124
119
|
}
|
125
120
|
async checkOperationOutput(workflowUUID, functionID) {
|
126
|
-
const { rows } = await this.pool.query(
|
121
|
+
const { rows } = await this.pool.query(`SELECT output, error FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.operation_outputs WHERE workflow_uuid=$1 AND function_id=$2`, [workflowUUID, functionID]);
|
127
122
|
if (rows.length === 0) {
|
128
123
|
return dbos_executor_1.dbosNull;
|
129
124
|
}
|
@@ -137,7 +132,7 @@ class PostgresSystemDatabase {
|
|
137
132
|
async recordOperationOutput(workflowUUID, functionID, output) {
|
138
133
|
const serialOutput = JSON.stringify(output);
|
139
134
|
try {
|
140
|
-
await this.pool.query(
|
135
|
+
await this.pool.query(`INSERT INTO ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.operation_outputs (workflow_uuid, function_id, output) VALUES ($1, $2, $3);`, [workflowUUID, functionID, serialOutput]);
|
141
136
|
}
|
142
137
|
catch (error) {
|
143
138
|
const err = error;
|
@@ -153,7 +148,7 @@ class PostgresSystemDatabase {
|
|
153
148
|
async recordOperationError(workflowUUID, functionID, error) {
|
154
149
|
const serialErr = JSON.stringify((0, serialize_error_1.serializeError)(error));
|
155
150
|
try {
|
156
|
-
await this.pool.query(
|
151
|
+
await this.pool.query(`INSERT INTO ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.operation_outputs (workflow_uuid, function_id, error) VALUES ($1, $2, $3);`, [workflowUUID, functionID, serialErr]);
|
157
152
|
}
|
158
153
|
catch (error) {
|
159
154
|
const err = error;
|
@@ -171,7 +166,7 @@ class PostgresSystemDatabase {
|
|
171
166
|
*/
|
172
167
|
async recordNotificationOutput(client, workflowUUID, functionID, output) {
|
173
168
|
try {
|
174
|
-
await client.query(
|
169
|
+
await client.query(`INSERT INTO ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.operation_outputs (workflow_uuid, function_id, output) VALUES ($1, $2, $3);`, [workflowUUID, functionID, JSON.stringify(output)]);
|
175
170
|
}
|
176
171
|
catch (error) {
|
177
172
|
await client.query("ROLLBACK");
|
@@ -191,13 +186,13 @@ class PostgresSystemDatabase {
|
|
191
186
|
topic = topic ?? this.nullTopic;
|
192
187
|
const client = await this.pool.connect();
|
193
188
|
await client.query("BEGIN ISOLATION LEVEL READ COMMITTED");
|
194
|
-
const { rows } = await client.query(
|
189
|
+
const { rows } = await client.query(`SELECT output FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.operation_outputs WHERE workflow_uuid=$1 AND function_id=$2`, [workflowUUID, functionID]);
|
195
190
|
if (rows.length > 0) {
|
196
191
|
await client.query("ROLLBACK");
|
197
192
|
client.release();
|
198
193
|
return;
|
199
194
|
}
|
200
|
-
await client.query(`INSERT INTO notifications (destination_uuid, topic, message) VALUES ($1, $2, $3);`, [destinationUUID, topic, JSON.stringify(message)]);
|
195
|
+
await client.query(`INSERT INTO ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.notifications (destination_uuid, topic, message) VALUES ($1, $2, $3);`, [destinationUUID, topic, JSON.stringify(message)]);
|
201
196
|
await this.recordNotificationOutput(client, workflowUUID, functionID, undefined);
|
202
197
|
await client.query("COMMIT");
|
203
198
|
client.release();
|
@@ -205,7 +200,7 @@ class PostgresSystemDatabase {
|
|
205
200
|
async recv(workflowUUID, functionID, topic, timeoutSeconds = dbos_executor_1.DBOSExecutor.defaultNotificationTimeoutSec) {
|
206
201
|
topic = topic ?? this.nullTopic;
|
207
202
|
// First, check for previous executions.
|
208
|
-
const checkRows = (await this.pool.query(
|
203
|
+
const checkRows = (await this.pool.query(`SELECT output FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.operation_outputs WHERE workflow_uuid=$1 AND function_id=$2`, [workflowUUID, functionID])).rows;
|
209
204
|
if (checkRows.length > 0) {
|
210
205
|
return JSON.parse(checkRows[0].output);
|
211
206
|
}
|
@@ -224,7 +219,7 @@ class PostgresSystemDatabase {
|
|
224
219
|
});
|
225
220
|
const received = Promise.race([messagePromise, timeoutPromise]);
|
226
221
|
// Check if the key is already in the DB, then wait for the notification if it isn't.
|
227
|
-
const initRecvRows = (await this.pool.query(
|
222
|
+
const initRecvRows = (await this.pool.query(`SELECT topic FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.notifications WHERE destination_uuid=$1 AND topic=$2;`, [workflowUUID, topic])).rows;
|
228
223
|
if (initRecvRows.length === 0) {
|
229
224
|
await received;
|
230
225
|
}
|
@@ -234,14 +229,14 @@ class PostgresSystemDatabase {
|
|
234
229
|
await client.query(`BEGIN ISOLATION LEVEL READ COMMITTED`);
|
235
230
|
const finalRecvRows = (await client.query(`WITH oldest_entry AS (
|
236
231
|
SELECT destination_uuid, topic, message, created_at_epoch_ms
|
237
|
-
FROM notifications
|
232
|
+
FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.notifications
|
238
233
|
WHERE destination_uuid = $1
|
239
234
|
AND topic = $2
|
240
235
|
ORDER BY created_at_epoch_ms ASC
|
241
236
|
LIMIT 1
|
242
237
|
)
|
243
238
|
|
244
|
-
DELETE FROM notifications
|
239
|
+
DELETE FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.notifications
|
245
240
|
USING oldest_entry
|
246
241
|
WHERE notifications.destination_uuid = oldest_entry.destination_uuid
|
247
242
|
AND notifications.topic = oldest_entry.topic
|
@@ -259,13 +254,13 @@ class PostgresSystemDatabase {
|
|
259
254
|
async setEvent(workflowUUID, functionID, key, message) {
|
260
255
|
const client = await this.pool.connect();
|
261
256
|
await client.query("BEGIN ISOLATION LEVEL READ COMMITTED");
|
262
|
-
let { rows } = await client.query(
|
257
|
+
let { rows } = await client.query(`SELECT output FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.operation_outputs WHERE workflow_uuid=$1 AND function_id=$2`, [workflowUUID, functionID]);
|
263
258
|
if (rows.length > 0) {
|
264
259
|
await client.query("ROLLBACK");
|
265
260
|
client.release();
|
266
261
|
return;
|
267
262
|
}
|
268
|
-
({ rows } = await client.query(`INSERT INTO workflow_events (workflow_uuid, key, value) VALUES ($1, $2, $3) ON CONFLICT (workflow_uuid, key) DO NOTHING RETURNING workflow_uuid;`, [workflowUUID, key, JSON.stringify(message)]));
|
263
|
+
({ rows } = await client.query(`INSERT INTO ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_events (workflow_uuid, key, value) VALUES ($1, $2, $3) ON CONFLICT (workflow_uuid, key) DO NOTHING RETURNING workflow_uuid;`, [workflowUUID, key, JSON.stringify(message)]));
|
269
264
|
if (rows.length === 0) {
|
270
265
|
await client.query("ROLLBACK");
|
271
266
|
client.release();
|
@@ -278,7 +273,7 @@ class PostgresSystemDatabase {
|
|
278
273
|
async getEvent(workflowUUID, key, timeoutSeconds, callerUUID, functionID) {
|
279
274
|
// Check if the operation has been done before for OAOO (only do this inside a workflow).
|
280
275
|
if (callerUUID !== undefined && functionID !== undefined) {
|
281
|
-
const { rows } = await this.pool.query(
|
276
|
+
const { rows } = await this.pool.query(`SELECT output FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.operation_outputs WHERE workflow_uuid=$1 AND function_id=$2`, [callerUUID, functionID]);
|
282
277
|
if (rows.length > 0) {
|
283
278
|
return JSON.parse(rows[0].output);
|
284
279
|
}
|
@@ -297,7 +292,7 @@ class PostgresSystemDatabase {
|
|
297
292
|
});
|
298
293
|
const received = Promise.race([valuePromise, timeoutPromise]);
|
299
294
|
// Check if the key is already in the DB, then wait for the notification if it isn't.
|
300
|
-
const initRecvRows = (await this.pool.query(
|
295
|
+
const initRecvRows = (await this.pool.query(`SELECT key, value FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_events WHERE workflow_uuid=$1 AND key=$2;`, [workflowUUID, key])).rows;
|
301
296
|
if (initRecvRows.length === 0) {
|
302
297
|
await received;
|
303
298
|
}
|
@@ -309,7 +304,7 @@ class PostgresSystemDatabase {
|
|
309
304
|
}
|
310
305
|
else {
|
311
306
|
// Read it again from the database.
|
312
|
-
const finalRecvRows = (await this.pool.query(
|
307
|
+
const finalRecvRows = (await this.pool.query(`SELECT value FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_events WHERE workflow_uuid=$1 AND key=$2;`, [workflowUUID, key])).rows;
|
313
308
|
if (finalRecvRows.length > 0) {
|
314
309
|
value = JSON.parse(finalRecvRows[0].value);
|
315
310
|
}
|
@@ -323,12 +318,12 @@ class PostgresSystemDatabase {
|
|
323
318
|
async getWorkflowStatus(workflowUUID, callerUUID, functionID) {
|
324
319
|
// Check if the operation has been done before for OAOO (only do this inside a workflow).
|
325
320
|
if (callerUUID !== undefined && functionID !== undefined) {
|
326
|
-
const { rows } = await this.pool.query(
|
321
|
+
const { rows } = await this.pool.query(`SELECT output FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.operation_outputs WHERE workflow_uuid=$1 AND function_id=$2`, [callerUUID, functionID]);
|
327
322
|
if (rows.length > 0) {
|
328
323
|
return JSON.parse(rows[0].output);
|
329
324
|
}
|
330
325
|
}
|
331
|
-
const { rows } = await this.pool.query(
|
326
|
+
const { rows } = await this.pool.query(`SELECT status, name, authenticated_user, assumed_role, authenticated_roles, request FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_status WHERE workflow_uuid=$1`, [workflowUUID]);
|
332
327
|
let value = null;
|
333
328
|
if (rows.length > 0) {
|
334
329
|
value = {
|
@@ -350,7 +345,7 @@ class PostgresSystemDatabase {
|
|
350
345
|
const pollingIntervalMs = 1000;
|
351
346
|
// eslint-disable-next-line no-constant-condition
|
352
347
|
while (true) {
|
353
|
-
const { rows } = await this.pool.query(
|
348
|
+
const { rows } = await this.pool.query(`SELECT status, output, error FROM ${dbos_executor_1.DBOSExecutor.systemDBSchemaName}.workflow_status WHERE workflow_uuid=$1`, [workflowUUID]);
|
354
349
|
if (rows.length > 0) {
|
355
350
|
const status = rows[0].status;
|
356
351
|
if (status === workflow_1.Status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;CACF;AAlaD,wDAkaC"}
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { MethodRegistrationBase } from "../decorators";
|
2
1
|
import { ITelemetryExporter } from "./exporters";
|
3
|
-
import {
|
2
|
+
import { Span } from "@opentelemetry/sdk-trace-base";
|
3
|
+
import { LogRecord } from "@opentelemetry/api-logs";
|
4
|
+
export type TelemetrySignal = LogRecord | Span;
|
4
5
|
export declare class TelemetryCollector {
|
5
|
-
readonly
|
6
|
+
readonly exporter?: ITelemetryExporter | undefined;
|
6
7
|
private readonly signals;
|
7
8
|
private readonly signalBufferID;
|
8
9
|
private readonly processAndExportSignalsIntervalMs;
|
9
10
|
private readonly processAndExportSignalsMaxBatchSize;
|
10
|
-
constructor(
|
11
|
-
init(registeredOperations?: Array<MethodRegistrationBase>): Promise<void>;
|
11
|
+
constructor(exporter?: ITelemetryExporter | undefined);
|
12
12
|
destroy(): Promise<void>;
|
13
13
|
push(signal: TelemetrySignal): void;
|
14
14
|
private pop;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/telemetry/collector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/telemetry/collector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,IAAI,CAAC;AAmB/C,qBAAa,kBAAkB;IAQjB,QAAQ,CAAC,QAAQ,CAAC;IAN9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoC;IAC5D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,iCAAiC,CAAQ;IAC1D,OAAO,CAAC,QAAQ,CAAC,mCAAmC,CAAM;gBAGrC,QAAQ,CAAC,gCAAoB;IAM5C,OAAO;IAKb,IAAI,CAAC,MAAM,EAAE,eAAe;IAI5B,OAAO,CAAC,GAAG;IAIL,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;CAqB/C"}
|
@@ -15,34 +15,22 @@ class SignalsQueue {
|
|
15
15
|
}
|
16
16
|
// TODO: Handle temporary workflows properly.
|
17
17
|
class TelemetryCollector {
|
18
|
-
|
18
|
+
exporter;
|
19
19
|
// Signals buffer management
|
20
20
|
signals = new SignalsQueue();
|
21
21
|
signalBufferID;
|
22
22
|
processAndExportSignalsIntervalMs = 1000;
|
23
23
|
processAndExportSignalsMaxBatchSize = 10;
|
24
24
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
25
|
-
constructor(
|
26
|
-
this.
|
25
|
+
constructor(exporter) {
|
26
|
+
this.exporter = exporter;
|
27
27
|
this.signalBufferID = setInterval(() => {
|
28
28
|
void this.processAndExportSignals();
|
29
29
|
}, this.processAndExportSignalsIntervalMs);
|
30
30
|
}
|
31
|
-
async init(registeredOperations = []) {
|
32
|
-
for (const exporter of this.exporters) {
|
33
|
-
if (exporter.init) {
|
34
|
-
await exporter.init(registeredOperations);
|
35
|
-
}
|
36
|
-
}
|
37
|
-
}
|
38
31
|
async destroy() {
|
39
32
|
clearInterval(this.signalBufferID);
|
40
33
|
await this.processAndExportSignals();
|
41
|
-
for (const exporter of this.exporters) {
|
42
|
-
if (exporter.destroy) {
|
43
|
-
await exporter.destroy();
|
44
|
-
}
|
45
|
-
}
|
46
34
|
}
|
47
35
|
push(signal) {
|
48
36
|
this.signals.push(signal);
|
@@ -61,8 +49,8 @@ class TelemetryCollector {
|
|
61
49
|
}
|
62
50
|
if (batch.length > 0) {
|
63
51
|
const exports = [];
|
64
|
-
|
65
|
-
exports.push(exporter.export(batch));
|
52
|
+
if (this.exporter) {
|
53
|
+
exports.push(this.exporter.export(batch));
|
66
54
|
}
|
67
55
|
try {
|
68
56
|
await Promise.all(exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../../src/telemetry/collector.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../../src/telemetry/collector.ts"],"names":[],"mappings":";;;AAMA,MAAM,YAAY;IAChB,IAAI,GAAsB,EAAE,CAAC;IAE7B,IAAI,CAAC,MAAuB;QAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IAED,GAAG;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;CACF;AAED,6CAA6C;AAC7C,MAAa,kBAAkB;IAQR;IAPrB,4BAA4B;IACX,OAAO,GAAiB,IAAI,YAAY,EAAE,CAAC;IAC3C,cAAc,CAAiB;IAC/B,iCAAiC,GAAG,IAAI,CAAC;IACzC,mCAAmC,GAAG,EAAE,CAAC;IAE1D,8DAA8D;IAC9D,YAAqB,QAA6B;QAA7B,aAAQ,GAAR,QAAQ,CAAqB;QAChD,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;YACrC,KAAK,IAAI,CAAC,uBAAuB,EAAE,CAAC;QACtC,CAAC,EAAE,IAAI,CAAC,iCAAiC,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,OAAO;QACX,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACnC,MAAM,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACvC,CAAC;IAED,IAAI,CAAC,MAAuB;QAC1B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAEO,GAAG;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,MAAM,KAAK,GAAsB,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,mCAAmC,EAAE;YACzF,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC1B,IAAI,CAAC,MAAM,EAAE;gBACX,MAAM;aACP;YACD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACpB;QACD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YACpB,MAAM,OAAO,GAAG,EAAE,CAAC;YACnB,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;aAC3C;YACD,IAAI;gBACF,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;aAC5B;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CAAE,CAAW,CAAC,OAAO,CAAC,CAAC;aACrC;SACF;IACH,CAAC;CACF;AAhDD,gDAgDC"}
|
@@ -1,28 +1,15 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
export(signal: TelemetrySignal[]): Promise<T>;
|
6
|
-
process?(signal: TelemetrySignal[]): U;
|
7
|
-
init?(registeredOperations?: ReadonlyArray<MethodRegistrationBase>): Promise<void>;
|
8
|
-
destroy?(): Promise<void>;
|
1
|
+
import { TelemetrySignal } from "./collector";
|
2
|
+
export interface OTLPExporterConfig {
|
3
|
+
logsEndpoint?: string;
|
4
|
+
tracesEndpoint?: string;
|
9
5
|
}
|
10
|
-
export
|
11
|
-
export
|
12
|
-
private readonly exporter;
|
13
|
-
constructor(endpoint?: string);
|
14
|
-
export(signals: TelemetrySignal[]): Promise<void>;
|
6
|
+
export interface ITelemetryExporter {
|
7
|
+
export(signal: TelemetrySignal[]): Promise<void>;
|
15
8
|
}
|
16
|
-
export declare
|
17
|
-
|
18
|
-
private readonly
|
19
|
-
|
20
|
-
|
21
|
-
constructor(poolConfig: PoolConfig, observabilityDBName?: string);
|
22
|
-
static getPGDataType(t: DBOSDataType): string;
|
23
|
-
init(registeredOperations?: ReadonlyArray<MethodRegistrationBase>): Promise<void>;
|
24
|
-
destroy(): Promise<void>;
|
25
|
-
process(signals: TelemetrySignal[]): QueryConfig[];
|
26
|
-
export(telemetrySignals: TelemetrySignal[]): Promise<QueryArrayResult[]>;
|
9
|
+
export declare class TelemetryExporter implements ITelemetryExporter {
|
10
|
+
private readonly tracesExporter?;
|
11
|
+
private readonly logsExporter?;
|
12
|
+
constructor(config: OTLPExporterConfig);
|
13
|
+
export(signals: TelemetrySignal[]): Promise<void>;
|
27
14
|
}
|
28
15
|
//# sourceMappingURL=exporters.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"exporters.d.ts","sourceRoot":"","sources":["../../../src/telemetry/exporters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"exporters.d.ts","sourceRoot":"","sources":["../../../src/telemetry/exporters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAQ9C,MAAM,WAAW,kBAAkB;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD;AAED,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAoB;IACpD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAkB;gBACpC,MAAM,EAAE,kBAAkB;IAehC,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAmCxD"}
|