-
Notifications
You must be signed in to change notification settings - Fork 251
feat(amazonq): LSP telemetry/event messages trigger client side telemetry service calls #5511
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
base: feature/q-lsp-chat
Are you sure you want to change the base?
Conversation
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]
|
import java.util.concurrent.CompletableFuture | ||
|
||
/** | ||
* Concrete implementation of [AmazonQLanguageClient] to handle messages sent from server | ||
*/ | ||
class AmazonQLanguageClientImpl(private val project: Project) : AmazonQLanguageClient { | ||
override fun telemetryEvent(`object`: Any) { | ||
println(`object`) | ||
when (`object`) { | ||
is MutableMap<*, *> -> handleTelemetryMap(`object`) |
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.
warn for the other case?
...munity/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt
Outdated
Show resolved
Hide resolved
...munity/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt
Outdated
Show resolved
Hide resolved
TelemetryService.getInstance().record(project) { | ||
datum(name) { | ||
createTime(Instant.now()) | ||
unit(telemetryMap["unit"] as? MetricUnit ?: MetricUnit.NONE) |
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.
how does Flare model this event? i'm not sure if Gson will magically deserialize into these types
…olkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt Co-authored-by: Richard Li <[email protected]>
…olkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt Co-authored-by: Richard Li <[email protected]>
val name = telemetryMap["name"] as? String ?: return | ||
|
||
@Suppress("UNCHECKED_CAST") | ||
val data = telemetryMap["data"] as? Map<String, Any> ?: return |
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.
is this the correct action here? are there any telemetry events we want to be emitting that would have no data?
...munity/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt
Fixed
Show fixed
Hide fixed
# Conflicts: # plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImpl.kt # plugins/amazonq/shared/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLanguageClientImplTest.kt
|
||
TelemetryService.getInstance().record(project) { | ||
datum(name) { | ||
createTime(Instant.now()) |
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.
time should be extracted from the metric?
LSP client handles telemetry/event messages sent from the server
Types of changes
Description
the generic TelemetryService.record() is used to dynamically send telemetry calls received from the server.
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.