Skip to content
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9a3743d
Add OpenTelemetry base classes
rli Oct 17, 2024
1ae437e
Merge remote-tracking branch 'origin/main' into rli/otel
rli Oct 21, 2024
0769a77
lint
rli Oct 21, 2024
5d087e3
Merge remote-tracking branch 'origin/main' into rli/otel
rli Oct 22, 2024
b1ef95f
build
rli Oct 22, 2024
0a4e9ca
tst
rli Oct 22, 2024
c34c51c
lint
rli Oct 22, 2024
ddf6db9
hack in 233
rli Oct 24, 2024
7d90796
lint
rli Oct 24, 2024
f5e4c31
wip
rli Oct 25, 2024
f3d4c32
Merge remote-tracking branch 'origin/main' into rli/otel
rli Oct 25, 2024
eeb5b78
cleanup
rli Oct 28, 2024
201590c
Merge remote-tracking branch 'origin/main' into rli/otel
rli Oct 28, 2024
68ac68f
revert
rli Oct 28, 2024
37d92e3
revert
rli Oct 28, 2024
8389744
redundant
rli Oct 28, 2024
332ecb2
build
rli Oct 28, 2024
1f4cb7d
Merge remote-tracking branch 'origin/main' into rli/otel
rli Oct 30, 2024
11a9506
Tweak otelbase classes slightly to meet requirements from generator
rli Oct 30, 2024
551b153
lint
rli Oct 31, 2024
07018b2
Merge branch 'rli/otel' into rli/add-otel
rli Oct 31, 2024
8b30755
Move Q Chat 'TelemetryHelper' metrics to OTel
rli Oct 31, 2024
4b66203
Move CodeWhispererTelemetryService metrics to OTel
rli Nov 1, 2024
b096f26
Merge remote-tracking branch 'origin/main' into rli/move-q-tel-helper…
rli Nov 6, 2024
06c3878
Merge branch 'rli/move-q-tel-helper-otel' into rli/move-cw-tel-servic…
rli Nov 6, 2024
c30c6aa
lint
rli Nov 6, 2024
56fd69d
tst
rli Nov 6, 2024
8cfb058
Merge branch 'rli/move-q-tel-helper-otel' into rli/move-cw-tel-servic…
rli Nov 7, 2024
4f2b7c9
Merge branch 'main' into rli/move-cw-tel-service-otel
rli Nov 7, 2024
abd1f14
Merge remote-tracking branch 'origin/main' into rli/move-cw-tel-servi…
rli Nov 8, 2024
5a29b26
lint
rli Nov 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,60 +24,68 @@ sealed interface CwcMessage : AmazonQMessage

// === UI -> App Messages ===
sealed interface IncomingCwcMessage : CwcMessage {
interface TabId {
val tabId: String?
}

interface MessageId {
val messageId: String?
}

data class ClearChat(
@JsonProperty("tabID") val tabId: String,
) : IncomingCwcMessage
@JsonProperty("tabID") override val tabId: String,
) : IncomingCwcMessage, TabId

data class Help(
@JsonProperty("tabID") val tabId: String,
) : IncomingCwcMessage
@JsonProperty("tabID") override val tabId: String,
) : IncomingCwcMessage, TabId

data class ChatPrompt(
val chatMessage: String,
val command: String,
@JsonProperty("tabID") val tabId: String,
@JsonProperty("tabID") override val tabId: String,
val userIntent: String?,
) : IncomingCwcMessage
) : IncomingCwcMessage, TabId

data class TabAdded(
@JsonProperty("tabID") val tabId: String,
@JsonProperty("tabID") override val tabId: String,
val tabType: String,
) : IncomingCwcMessage
) : IncomingCwcMessage, TabId

data class TabRemoved(
@JsonProperty("tabID") val tabId: String,
@JsonProperty("tabID") override val tabId: String,
val tabType: String,
) : IncomingCwcMessage
) : IncomingCwcMessage, TabId

data class TabChanged(
@JsonProperty("tabID") val tabId: String,
@JsonProperty("tabID") override val tabId: String,
@JsonProperty("prevTabID") val prevTabId: String?,
) : IncomingCwcMessage
) : IncomingCwcMessage, TabId

data class FollowupClicked(
val followUp: FollowUp,
@JsonProperty("tabID") val tabId: String,
val messageId: String?,
@JsonProperty("tabID") override val tabId: String,
override val messageId: String?,
val command: String,
val tabType: String,
) : IncomingCwcMessage
) : IncomingCwcMessage, TabId, MessageId

data class CopyCodeToClipboard(
val command: String?,
@JsonProperty("tabID") val tabId: String,
val messageId: String,
@JsonProperty("tabID") override val tabId: String,
override val messageId: String,
val userIntent: UserIntent?,
val code: String,
val insertionTargetType: String?,
val eventId: String?,
val codeBlockIndex: Int?,
val totalCodeBlocks: Int?,
val codeBlockLanguage: String?,
) : IncomingCwcMessage
) : IncomingCwcMessage, TabId, MessageId

data class InsertCodeAtCursorPosition(
@JsonProperty("tabID") val tabId: String,
val messageId: String,
@JsonProperty("tabID") override val tabId: String,
override val messageId: String,
val userIntent: UserIntent?,
val code: String,
val insertionTargetType: String?,
Expand All @@ -86,29 +94,29 @@ sealed interface IncomingCwcMessage : CwcMessage {
val codeBlockIndex: Int?,
val totalCodeBlocks: Int?,
val codeBlockLanguage: String?,
) : IncomingCwcMessage
) : IncomingCwcMessage, TabId, MessageId

data class TriggerTabIdReceived(
@JsonProperty("triggerID") val triggerId: String,
@JsonProperty("tabID") val tabId: String,
) : IncomingCwcMessage
@JsonProperty("tabID") override val tabId: String,
) : IncomingCwcMessage, TabId

data class StopResponse(
@JsonProperty("tabID") val tabId: String,
) : IncomingCwcMessage
@JsonProperty("tabID") override val tabId: String,
) : IncomingCwcMessage, TabId

data class ChatItemVoted(
@JsonProperty("tabID") val tabId: String,
val messageId: String,
@JsonProperty("tabID") override val tabId: String,
override val messageId: String,
val vote: String, // upvote / downvote
) : IncomingCwcMessage
) : IncomingCwcMessage, TabId, MessageId

data class ChatItemFeedback(
@JsonProperty("tabID") val tabId: String,
@JsonProperty("tabID") override val tabId: String,
val selectedOption: String,
val comment: String?,
val messageId: String,
) : IncomingCwcMessage
override val messageId: String,
) : IncomingCwcMessage, TabId, MessageId

data class UIFocus(
val command: String,
Expand All @@ -119,19 +127,19 @@ sealed interface IncomingCwcMessage : CwcMessage {

data class ClickedLink(
@JsonProperty("command") val type: LinkType,
@JsonProperty("tabID") val tabId: String,
val messageId: String?,
@JsonProperty("tabID") override val tabId: String,
override val messageId: String?,
val link: String,
) : IncomingCwcMessage
) : IncomingCwcMessage, TabId, MessageId

data class AuthFollowUpWasClicked(
@JsonProperty("tabID") val tabId: String,
@JsonProperty("tabID") override val tabId: String,
val authType: AuthFollowUpType,
) : IncomingCwcMessage
) : IncomingCwcMessage, TabId

data class OpenSettings(
@JsonProperty("tabID") val tabId: String? = null,
) : IncomingCwcMessage
@JsonProperty("tabID") override val tabId: String? = null,
) : IncomingCwcMessage, TabId
}

enum class FocusType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class CodeWhispererService(private val cs: CoroutineScope) : Disposable {
getRequestContext(triggerTypeInfo, editor, project, psiFile, latencyContext)
} catch (e: Exception) {
LOG.debug { e.message.toString() }
CodeWhispererTelemetryService.getInstance().sendFailedServiceInvocationEvent(project, e::class.simpleName)
CodeWhispererTelemetryService.getInstance().sendFailedServiceInvocationEvent(e)

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols Warning

'sendFailedServiceInvocationEvent(kotlin.Exception /* = java.lang.Exception */): Unit' is deprecated. Does not capture entire context of method call
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class CodeWhispererServiceNew(private val cs: CoroutineScope) : Disposable {
getRequestContext(triggerTypeInfo, editor, project, psiFile)
} catch (e: Exception) {
LOG.debug { e.message.toString() }
CodeWhispererTelemetryServiceNew.getInstance().sendFailedServiceInvocationEvent(project, e::class.simpleName)
CodeWhispererTelemetryServiceNew.getInstance().sendFailedServiceInvocationEvent(e)

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols Warning

'sendFailedServiceInvocationEvent(kotlin.Exception /* = java.lang.Exception */): Unit' is deprecated. Does not capture entire context of method call
return
}
val caretContext = requestContext.fileContextInfo.caretContext
Expand Down
Loading