-
Notifications
You must be signed in to change notification settings - Fork 376
Overlay: report telemetry #2975
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
Conversation
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.
Pull Request Overview
This PR adds telemetry tracking for overlay database analysis operations. The changes enable the CodeQL Action to collect and report statistics about overlay-base database downloads and analysis modes.
- Modified the download function to return telemetry statistics instead of a boolean
- Added new telemetry fields to track download size, duration, and analysis modes
- Expanded test coverage for the updated download function behavior
Reviewed Changes
Copilot reviewed 8 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/overlay-database-utils.ts | Updated download function to return telemetry stats and measure database size/download time |
src/overlay-database-utils.test.ts | Added comprehensive test cases for the modified download function |
src/init-action.ts | Updated to capture and pass overlay database stats to telemetry reporting |
src/analyze.ts | Added telemetry flags to track overlay vs overlay-base analysis modes |
lib/* | Generated JavaScript files reflecting the TypeScript changes |
76a1b2d
to
2b3bae6
Compare
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.
This generally looks good, assuming all the necessary backend work is also done to support this. Thanks also for including some tests.
There are no blocking issues. I flagged up a couple points that might be good to deal with before merging this though, as well as some other trivial points.
src/overlay-database-utils.ts
Outdated
logger.warning( | ||
"Filesystem error while accessing downloaded overlay-base database", | ||
); |
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.
tryGetFolderBytes
will log a warning (since you don't set quiet=true
) before returning undefined
, so this will always lead to two warnings for the same problem, which I believe will show up as separate workflow annotations.
I'd suggest either removing this warning or setting quiet=true
in the tryGetFolderBytes
call.
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.
I think both messages are worth preserving because they tell the user different things.
- The warning from
tryGetFolderBytes
explains what went wrong. This is important if the user were to fix the underlying technical problem. - The warning here in
downloadOverlayBaseDatabaseFromCache
explains the consequence of the failure (that the downloaded overlay-base database cannot be accessed) so that the user can assess the severity and impact of the problem.
That said, I agree that they do not both have to be warnings. I downgraded this message to info
.
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.
Perhaps it would be reasonable for tryGetFolderBytes
to return the error rather than undefined
and then leave it up to the caller to decide what to do with that (e.g. include it in a combined log message with the consequence + underlying problem).
Not something you need to act on if you're happy to downgrade this to an info
-level message.
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.
Thanks. I already downgraded the log from warning
and info
, and I am happy with that change.
2b3bae6
to
39b0524
Compare
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.
Looks good now, thank you!
This PR adds telemetry fields for overlay analysis.
analysis_is_overlay
analysis_builds_overlay_base_database
overlay_base_database_download_size_bytes
overlay_base_database_download_duration_ms
Merge / deployment checklist