-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: Telemetry reporting #187
Conversation
# Conflicts: # clients/vscode-hlasmplugin/package-lock.json
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.
Some of the code smells should probably be addressed.
|
||
// setTimeout is needed, because telemetry initialization is asynchronous | ||
// and AFAIK no event in the API is exposed to send the activation telemetry event | ||
setTimeout(() => {telemetry.reportEvent("hlasm.activated", {server_variant:serverVariant.toString()});}, 1000); |
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 it be triggered by e.g. the LanguageClient onReady event?
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 don't think so. I wanted to have an event that would trigger right after activation and would not depend on e.g. ability to run native executables.
BTW creators of vscode-extension-telemetry acknowledged that this is a shortfall of the plugin and plan to either introduce an event or buffer where such event would be stored before they can be sent. microsoft/vscode-extension-telemetry#76
language_server/src/server.h
Outdated
struct telemetry_metrics_info | ||
{ | ||
json properties; | ||
json metrics; | ||
}; | ||
|
||
telemetry_metrics_info virtual get_telemetry_details(); |
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 seems a bit strange... how is the method supposed to know to which request the details are being provided?
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 agree it is a bit strange... the details are provided for the last request.
It fetches the details for requests with telemetry_log_level::LOG_WITH_METRICS
, which is actually only one request (didOpen).
I only wanted the lsp_server
to have the metadata consumer, but at the same time I wanted to log the requests in the server::call_method
, method, which is common for lsp and dap server. Thats why I ended up with this virtual method.
return this.telemetry_key; | ||
} | ||
|
||
private getTelemetryResourcePath() { |
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 used anymore?
return vscode.extensions.getExtension(EXTENSION_ID).packageJSON.version; | ||
} | ||
|
||
private getExtensionPath(): string { |
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.
only used in getTelemetryResourcePath?
// void server::write(const nlohmann::json& payload) { notify("telemetry/event", payload); } | ||
|
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.
// void server::write(const nlohmann::json& payload) { notify("telemetry/event", payload); } |
|
||
namespace hlasm_plugin::language_server { | ||
|
||
struct parsing_metadata_collector : public parser_library::parsing_metadata_consumer |
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.
struct parsing_metadata_collector : public parser_library::parsing_metadata_consumer | |
struct parsing_metadata_collector final : public parser_library::parsing_metadata_consumer |
SonarCloud Quality Gate failed. |
🎉 This PR is included in version 0.15.0-beta.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 0.15.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.