Skip to content

Commit ad5fbc2

Browse files
authored
feat: Add "queryRewriteId" param to Query Rewrite events (#9949)
1 parent 3386fb7 commit ad5fbc2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/cubejs-api-gateway/src/gateway.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as stream from 'stream';
33
import { assertNever } from 'assert-never';
44
import jwt, { Algorithm as JWTAlgorithm } from 'jsonwebtoken';
55
import R from 'ramda';
6+
import { v4 as uuidv4 } from 'uuid';
67
import bodyParser from 'body-parser';
78
import { graphqlHTTP } from 'express-graphql';
89
import structuredClone from '@ungap/structured-clone';
@@ -1214,8 +1215,10 @@ class ApiGateway {
12141215

12151216
const queries: Query[] = Array.isArray(query) ? query : [query];
12161217

1218+
const queryRewriteId = uuidv4();
12171219
this.log({
12181220
type: 'Query Rewrite',
1221+
queryRewriteId,
12191222
query
12201223
}, context);
12211224

@@ -1280,6 +1283,7 @@ class ApiGateway {
12801283

12811284
this.log({
12821285
type: 'Query Rewrite completed',
1286+
queryRewriteId,
12831287
normalizedQueries,
12841288
duration: new Date().getTime() - startTime,
12851289
query

0 commit comments

Comments
 (0)