-
Notifications
You must be signed in to change notification settings - Fork 83
feat(webui): Add logs to presto search routes. #1275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -60,6 +60,7 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => { | |||||||
| // eslint-disable-next-line max-lines-per-function | ||||||||
| async (request, reply) => { | ||||||||
| const {queryString} = request.body; | ||||||||
| request.log.info({queryString}, "/api/presto-search/query args"); | ||||||||
|
|
||||||||
| let searchJobId: string; | ||||||||
| let totalResultsCount = 0; | ||||||||
|
|
@@ -213,6 +214,9 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => { | |||||||
| }, | ||||||||
| async (request, reply) => { | ||||||||
| const {searchJobId} = request.body; | ||||||||
|
|
||||||||
| request.log.info({searchJobId}, "api/presto-search/cancel args"); | ||||||||
|
Comment on lines
+217
to
+218
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
|
||||||||
|
Comment on lines
216
to
+219
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Keep log message prefixes consistent across endpoints. This uses "api/presto-search/cancel args" (no leading slash) while the /query log uses a leading slash. Favour the no-slash form across all three endpoints for consistency. 🤖 Prompt for AI Agents |
||||||||
| await new Promise<void>((resolve, reject) => { | ||||||||
| Presto.client.kill(searchJobId, (error) => { | ||||||||
| if (null !== error) { | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Avoid logging full query text; truncate/redact and align message prefix.
Raw queries can contain PII/secrets and can bloat logs. Truncate before logging (and consider gating behind a debug level/feature flag). Also align message prefix with other routes (no leading slash).
const {queryString} = request.body; -request.log.info({queryString}, "/api/presto-search/query args"); +const maxLen = 512; +const qsLog = + ("string" === typeof queryString && queryString.length > maxLen) + ? `${queryString.slice(0, maxLen)}…(truncated)` + : queryString; +request.log.info({queryString: qsLog}, "api/presto-search/query args");Please confirm this logging aligns with your privacy policy and production log size constraints.
🏁 Script executed:
Length of output: 12144
Truncate queryString and log at debug level
queryString(>512 chars) to${queryString.slice(0,512)}…(truncated)to avoid PII/excessive logsrequest.log.debug({ queryString: qsLog }, "/api/presto-search/query args")(debug-level, matching/api/search/query args)Please confirm this meets our privacy policy and production log-size constraints.
🤖 Prompt for AI Agents