Expose per-query structured evaluator logs#1186
Conversation
40e3944 to
b31b26f
Compare
| /** | ||
| * The dataset for which we want to start a new structured log | ||
| */ | ||
| db: Dataset; |
There was a problem hiding this comment.
So, these logs are specific to a dataset, not a query?
There was a problem hiding this comment.
In a sense, yes. We rotate the logs when new queries are started, but if there are multiple concurrent queries running then events from the evaluator will end up in the latest query to be started.
| multiSelect: QueryHistoryInfo[] | ||
| ) { | ||
| // Local queries only | ||
| if (!this.assertSingleQuery(multiSelect) || singleItem?.t !== 'local') { |
There was a problem hiding this comment.
Best if you call const { finalSingleItem, finalMultiSelect } = this.determineSelection(singleItem, multiSelect); before this so that you handle some edge cases where you right-click on an item that is not selected.
There was a problem hiding this comment.
Thanks, done.
| multiSelect: QueryHistoryInfo[] | ||
| ) { | ||
| // Local queries only | ||
| if (!this.assertSingleQuery(multiSelect) || singleItem?.t !== 'local') { |
| } | ||
|
|
||
| if (singleItem.evalLogLocation) { | ||
| const summaryLocation = singleItem.evalLogLocation + '.summary'; |
There was a problem hiding this comment.
I'd prefer to have these file names encapsulated in the LocalQueryInfo object. Can you create a getter called evalLogSummaryLocation? and return the proper path?
There was a problem hiding this comment.
Good idea, done.
| } | ||
|
|
||
| export function findQueryStructLogFile(resultPath: string): string { | ||
| return path.join(resultPath, 'evaluator-log.jsonl'); |
There was a problem hiding this comment.
Just making sure this isn't a typo and it should be evaluator-log.json.
There was a problem hiding this comment.
It is not a typo - .jsonl is the format for line-delimited JSON (https://jsonlines.org/) which is what this file is.
| progress: ProgressCallback, | ||
| token: CancellationToken, | ||
| templates?: messages.TemplateDefinitions, | ||
| queryInfo?: LocalQueryInfo, |
There was a problem hiding this comment.
So, this value will only be available for queries directly initiated by the user? Contextual queries won't have the queryInfo? That's fine, but I just want to be sure I understand. Could you add a comment here to explain that?
There was a problem hiding this comment.
Yes, that's exactly right. There's a few places where queries aren't initiated by the user (as you say, contextual queries, and also test code). In these cases we don't have a sensible place to put the structured logs, nor any reason to store them, so we don't create a log for these cases.
|
Thanks for the review @aeisenberg! I've believe I have addressed all your comments either with responses above or in the new commit 🙂 |
angelapwen
left a comment
There was a problem hiding this comment.
✔️ just a few comments since we are waiting for the per-query structured logging PR to merge and be released anyway.
| if (!this.assertSingleQuery(finalMultiSelect) || !finalSingleItem || finalSingleItem.t !== 'local') { | ||
| return; |
There was a problem hiding this comment.
Should this situation also result in some kind of error message?
There was a problem hiding this comment.
Hmm, good question. I followed what @aeisenberg did above for other similar drop downs. Any particular reason you went with just a return rather than a more explicit error?
| if (!this.assertSingleQuery(finalMultiSelect) || !finalSingleItem || finalSingleItem.t !== 'local') { | ||
| return; |
76cd2fa to
9db40c2
Compare
|
Rebased onto the latest |
Do not merge until the corresponding internal PR to the query server has been merged and the estimated version in this PR has been updated to match when we actually ship that.
This PR adds two new options to the Query History view:
Checklist
ready-for-doc-reviewlabel there.