Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
12 changes: 12 additions & 0 deletions src/rovo-dev/analytics/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ export namespace Track {
};
};

export type ReplayCompleted = {
action: 'rovoDevReplayCompleted';
subject: 'atlascode';
attributes: {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
sessionId: string;
messagePartsCount: number;
};
};

// TODO: rovodev metadata fields here are different from other events, reconcile later?
export type PerformanceEvent = {
action: 'performanceEvent';
Expand All @@ -173,4 +184,5 @@ export type TrackEvent =
| Track.DetailsExpanded
| Track.CreatePrButtonClicked
| Track.AiResultViewed
| Track.ReplayCompleted
| Track.PerformanceEvent;
9 changes: 9 additions & 0 deletions src/rovo-dev/rovoDevChatProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,15 @@ export class RovoDevChatProvider {

if (replayBuffer.length > 0) {
await this.processRovoDevReplayResponse(replayBuffer);

// Emit analytics for replay completion
this._telemetryProvider.fireTelemetryEvent({
action: 'rovoDevReplayCompleted',
subject: 'atlascode',
attributes: {
messagePartsCount: replayBuffer.length,
},
});
}

while (!isDone) {
Expand Down
9 changes: 7 additions & 2 deletions src/rovo-dev/rovoDevTelemetryProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export type TelemetryEvent =
| PartialEvent<Track.GitPushAction>
| PartialEvent<Track.DetailsExpanded>
| PartialEvent<Track.CreatePrButtonClicked>
| PartialEvent<Track.AiResultViewed>;
| PartialEvent<Track.AiResultViewed>
| PartialEvent<Track.ReplayCompleted>;

export class RovoDevTelemetryProvider {
private _chatSessionId: string = '';
Expand Down Expand Up @@ -79,7 +80,11 @@ export class RovoDevTelemetryProvider {
}

// rovoDevNewSessionActionEvent is the only event that doesn't need the promptId
if (event.action !== 'rovoDevNewSessionAction' && !event.attributes.promptId) {
if (
event.action !== 'rovoDevNewSessionAction' &&
event.action !== 'rovoDevReplayCompleted' &&
!event.attributes.promptId
) {
this.onError(new Error('Unable to send Rovo Dev telemetry: PromptId not initialized'));
return false;
}
Expand Down
Loading