Skip to content

Commit 8cfb058

Browse files
committed
Merge branch 'rli/move-q-tel-helper-otel' into rli/move-cw-tel-service-otel
2 parents 06c3878 + 56fd69d commit 8cfb058

File tree

2 files changed

+8
-5
lines changed
  • plugins/amazonq/chat/jetbrains-community

2 files changed

+8
-5
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/controller/chat/telemetry/TelemetryHelper.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class TelemetryHelper(private val project: Project, private val sessionStorage:
7272
// When chat panel is focused
7373
fun recordEnterFocusChat() {
7474
Telemetry.amazonq.enterFocusChat.use { it.passive(true) }
75-
7675
}
7776

7877
// When chat panel is unfocused
@@ -178,7 +177,6 @@ class TelemetryHelper(private val project: Project, private val sessionStorage:
178177
.cwsprChatRequestLength(data.message.length.toLong())
179178
.cwsprChatConversationType(CwsprChatConversationType.Chat)
180179
.credentialStartUrl(getStartUrl(project))
181-
182180
}
183181
}
184182

@@ -297,11 +295,16 @@ class TelemetryHelper(private val project: Project, private val sessionStorage:
297295
}
298296

299297
is IncomingCwcMessage.ChatItemFeedback -> {
298+
span.cwsprChatInteractionType(CwsprChatInteractionType.Unknown)
300299
recordFeedback(message)
301300
null
302301
}
303302

304-
else -> null
303+
else -> {
304+
span.cwsprChatInteractionType(CwsprChatInteractionType.Unknown)
305+
306+
null
307+
}
305308
}?.let {
306309
// override request and add customizationArn if it's not null, else return itself
307310
customization?.let { myCustomization ->
@@ -409,7 +412,6 @@ class TelemetryHelper(private val project: Project, private val sessionStorage:
409412

410413
fun recordOpenChat() {
411414
Telemetry.amazonq.openChat.use { it.passive(true) }
412-
413415
}
414416

415417
fun recordCloseChat() {

plugins/amazonq/chat/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/amazonq/TelemetryHelperTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import org.mockito.kotlin.doReturn
2222
import org.mockito.kotlin.eq
2323
import org.mockito.kotlin.mock
2424
import org.mockito.kotlin.stub
25+
import org.mockito.kotlin.times
2526
import org.mockito.kotlin.verify
2627
import software.amazon.awssdk.awscore.DefaultAwsResponseMetadata
2728
import software.amazon.awssdk.awscore.util.AwsHeader.AWS_REQUEST_ID
@@ -608,7 +609,7 @@ class TelemetryHelperTest {
608609

609610
// Toolkit telemetry
610611
argumentCaptor<MetricEvent> {
611-
verify(mockBatcher).enqueue(capture())
612+
verify(mockBatcher, times(2)).enqueue(capture())
612613
val event = firstValue.data.find { it.name == "feedback_result" }
613614
assertNotNull(event)
614615
assertThat(event).matches { it.metadata["result"] == "Succeeded" }

0 commit comments

Comments
 (0)