-
Notifications
You must be signed in to change notification settings - Fork 272
fix(amazonq): add metrics for flare/node resolution #5786
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
We need some visibility on how prevalent failures are
Qodana Community for JVMIt seems all right 👌 No new problems were found according to the checks applied 💡 Qodana analysis was run in the pull request mode: only the changed files were checked Contact Qodana teamContact us at [email protected]
|
if (!nodeRuntime.isNullOrEmpty()) { | ||
LOG.info { "Using node from $nodeRuntime " } | ||
|
||
resolveNodeMetric(false, true) |
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.
nit: is it possible to add parameter names?
if (!validateFileHash(filePath, expectedHash)) { | ||
it.success(false) | ||
|
||
val exception = LspException("Hash mismatch after re-download for ${filePath.fileName}", LspException.ErrorCode.HASH_MISMATCH) |
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.
Should we run this through the util that removes username(scrubNames)
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.
it's path.fileName
so should not have username because this is just the server version
val resolveNodeMetric = { isBundled: Boolean, success: Boolean -> | ||
Telemetry.languageserver.setup.use { | ||
it.metadata("languageServerSetupStage", "resolveNode") | ||
it.metadata("credentialStartUrl", getStartUrl(project)) |
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.
getStartUrl may be null if user has not login but I think it's fine
if (!filePath.exists()) { | ||
logger.info { "Downloading file: ${filePath.fileName}" } | ||
saveFileFromUrl(url, filePath, ProgressManager.getInstance().progressIndicator) | ||
recordDownload { saveFileFromUrl(url, filePath, ProgressManager.getInstance().progressIndicator) } | ||
} | ||
if (!validateFileHash(filePath, expectedHash)) { | ||
logger.warn { "Hash mismatch for ${filePath.fileName}, re-downloading" } | ||
filePath.deleteIfExists() |
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.
not related to this PR but it seems like we can download twice if the first downloaded one has hash mismatch due to antivirus changing content, but still acceptable
We need some visibility on how prevalent failures are
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.