Skip to content

Commit 19a354f

Browse files
committed
Revert "remove correlation ids in Chat and UserAction"
This reverts commit b383900.
1 parent 263e61b commit 19a354f

File tree

2 files changed

+9
-37
lines changed

2 files changed

+9
-37
lines changed

shell/agents/Microsoft.Azure.Agent/AzureAgent.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,31 +124,21 @@ public void Initialize(AgentConfig config)
124124
public void OnUserAction(UserActionPayload actionPayload) {
125125
// Send telemetry about the user action.
126126
bool isUserFeedback = false;
127-
bool allowIdsForCorrelation = false;
128127
string details = null;
129128
UserAction action = actionPayload.Action;
130129

131130
if (action is UserAction.Dislike)
132131
{
133-
isUserFeedback = true;
134-
DislikePayload dislikePayload = (DislikePayload)actionPayload;
135-
allowIdsForCorrelation = dislikePayload.ShareConversation;
136132
var dislike = (DislikePayload) actionPayload;
133+
isUserFeedback = true;
137134
details = string.Format("{0} | {1}", dislike.ShortFeedback, dislike.LongFeedback);
138135
}
139136
else if (action is UserAction.Like)
140137
{
141138
isUserFeedback = true;
142139
}
143140

144-
if (isUserFeedback)
145-
{
146-
Telemetry.Trace(AzTrace.Feedback(action.ToString(), _copilotResponse, details, allowIdsForCorrelation));
147-
}
148-
else
149-
{
150-
Telemetry.Trace(AzTrace.UserAction(action.ToString(), _copilotResponse, details));
151-
}
141+
Telemetry.Trace(AzTrace.UserAction(action.ToString(), _copilotResponse, details, isUserFeedback));
152142
}
153143

154144
public async Task RefreshChatAsync(IShell shell, bool force)

shell/agents/Microsoft.Azure.Agent/Telemetry.cs

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -76,40 +76,20 @@ internal static void Initialize()
7676
internal object Details { get; set; }
7777

7878
internal static AzTrace UserAction(
79-
string shellCommand,
80-
CopilotResponse response,
81-
object details)
82-
{
83-
if (Telemetry.Enabled)
84-
{
85-
return new()
86-
{
87-
TopicName = response.TopicName,
88-
ShellCommand = shellCommand,
89-
EventType = "UserAction",
90-
Details = details
91-
};
92-
}
93-
94-
// Don't create an object when telemetry is disabled.
95-
return null;
96-
}
97-
98-
internal static AzTrace Feedback(
9979
string shellCommand,
10080
CopilotResponse response,
10181
object details,
102-
bool allowIdsForCorrelation)
82+
bool isFeedback = false)
10383
{
10484
if (Telemetry.Enabled)
10585
{
10686
return new()
10787
{
108-
QueryId = allowIdsForCorrelation ? response.ReplyToId : null,
88+
QueryId = response.ReplyToId,
10989
TopicName = response.TopicName,
110-
ConversationId = allowIdsForCorrelation ? response.ConversationId : null,
90+
ConversationId = response.ConversationId,
11191
ShellCommand = shellCommand,
112-
EventType = "Feedback",
92+
EventType = isFeedback ? "Feedback" : "UserAction",
11393
Details = details
11494
};
11595
}
@@ -125,7 +105,9 @@ internal static AzTrace Chat(CopilotResponse response)
125105
return new()
126106
{
127107
EventType = "Chat",
128-
TopicName = response.TopicName
108+
QueryId = response.ReplyToId,
109+
TopicName = response.TopicName,
110+
ConversationId = response.ConversationId
129111
};
130112
}
131113

0 commit comments

Comments
 (0)