@@ -36,15 +36,15 @@ 7. DO NOT include the placeholder summary when the commands contains no placehol
3636 """ ;
3737
3838 private int _turnsLeft ;
39- private CopilotResponse _copilotResponse ;
39+ internal CopilotResponse _copilotResponse ;
4040 private AgentSetting _setting ;
4141
4242 private readonly string _instructions ;
4343 private readonly StringBuilder _buffer ;
4444 private readonly HttpClient _httpClient ;
45- private readonly ChatSession _chatSession ;
45+ internal readonly ChatSession _chatSession ;
4646 private readonly Dictionary < string , string > _valueStore ;
47- private MetricHelper _metricHelper ;
47+ // private MetricHelper _metricHelper;
4848
4949 public AzureAgent ( )
5050 {
@@ -90,7 +90,6 @@ public void Initialize(AgentConfig config)
9090
9191 _turnsLeft = int . MaxValue ;
9292 _setting = AgentSetting . LoadFromFile ( SettingFile ) ;
93- _metricHelper = new MetricHelper ( ChatSession . CONVERSATION_URL ) ;
9493
9594 if ( _setting is null )
9695 {
@@ -131,13 +130,14 @@ public void OnUserAction(UserActionPayload actionPayload) {
131130 IsUserFeedback = true ;
132131 }
133132
134- _metricHelper . LogTelemetry (
133+ MetricHelper . metricHelper . LogTelemetry (
135134 new AzTrace ( )
136135 {
137136 Command = actionPayload . Action . ToString ( ) ,
138- CorrelationId = _chatSession . CorrelationId ,
137+ ConversationId = _chatSession . ConversationId ,
138+ ActivityId = _copilotResponse . ReplyToId ,
139139 EventType = IsUserFeedback ? "Feedback" : "UserAction" ,
140- Handler = _copilotResponse . TopicName ,
140+ TopicName = _copilotResponse . TopicName ,
141141 DetailedMessage = DetailedMessage
142142 } ) ;
143143 }
@@ -196,12 +196,12 @@ public async Task<bool> ChatAsync(string input, IShell shell)
196196
197197 if ( ! MetricHelper . TelemetryOptOut )
198198 {
199- _metricHelper . LogTelemetry (
199+ MetricHelper . metricHelper . LogTelemetry (
200200 new AzTrace ( )
201201 {
202- CorrelationId = _chatSession . CorrelationId ,
202+ ConversationId = _chatSession . ConversationId ,
203203 EventType = "Chat" ,
204- Handler = _copilotResponse . TopicName ,
204+ TopicName = _copilotResponse . TopicName ,
205205 ActivityId = _copilotResponse . ReplyToId
206206 } ) ;
207207 }
@@ -364,12 +364,13 @@ private ResponseData ParseCLIHandlerResponse(IShell shell)
364364 // TODO: send telemetry about this case.
365365 if ( ! MetricHelper . TelemetryOptOut )
366366 {
367- _metricHelper . LogTelemetry (
367+ MetricHelper . metricHelper . LogTelemetry (
368368 new AzTrace ( )
369369 {
370- CorrelationId = _chatSession . CorrelationId ,
370+ ConversationId = _chatSession . ConversationId ,
371+ ActivityId = _copilotResponse . ReplyToId ,
371372 EventType = "Exception" ,
372- Handler = _copilotResponse . TopicName ,
373+ TopicName = _copilotResponse . TopicName ,
373374 DetailedMessage = "The placeholder section is not in the format as we've instructed"
374375 } ) ;
375376 }
@@ -430,7 +431,6 @@ internal void ReplaceKnownPlaceholders(ResponseData data)
430431 }
431432 }
432433
433- Dictionary < string , Boolean > DetailedMessage = new ( ) ;
434434 if ( pairs . Count == placeholders . Count )
435435 {
436436 data . PlaceholderSet = null ;
@@ -439,26 +439,8 @@ internal void ReplaceKnownPlaceholders(ResponseData data)
439439 {
440440 for ( int i = indices . Count - 1 ; i >= 0 ; i -- )
441441 {
442- DetailedMessage . Add ( placeholders [ indices [ i ] ] . Name . Trim ( new Char [ ] { '<' , '>' } ) , true ) ;
443442 placeholders . RemoveAt ( indices [ i ] ) ;
444443 }
445- foreach ( var i in placeholders )
446- {
447- DetailedMessage . Add ( i . Name . Trim ( new Char [ ] { '<' , '>' } ) , false ) ;
448- }
449- }
450-
451- if ( ! MetricHelper . TelemetryOptOut )
452- {
453- _metricHelper . LogTelemetry (
454- new AzTrace ( )
455- {
456- Command = "Replace" ,
457- CorrelationId = _chatSession . CorrelationId ,
458- EventType = "UserAction" ,
459- Handler = _copilotResponse . TopicName ,
460- DetailedMessage = JsonSerializer . Serialize ( DetailedMessage )
461- } ) ;
462444 }
463445 }
464446
0 commit comments