File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
src/ResourceManager/Automation/Commands.Automation/Common Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ public class Constants
38
38
39
39
public const string ClientRequestIdHeaderName = "x-ms-client-request-id" ;
40
40
41
+ public const string ActivityIdHeaderName = "x-ms-activity-id" ;
42
+
41
43
// default schedule expiry time for daily schedule, consistent with UX
42
44
// 12/31/9999 12:00:00 AM
43
45
public static readonly DateTimeOffset DefaultScheduleExpiryTime = DateTimeOffset . MaxValue ;
Original file line number Diff line number Diff line change 14
14
15
15
using System ;
16
16
using System . Collections . Generic ;
17
+ using System . Diagnostics . Eventing ;
17
18
using System . Linq ;
18
19
using System . Text ;
19
20
using System . Threading . Tasks ;
@@ -31,6 +32,11 @@ public RequestSettings(IAutomationManagementClient automationClient)
31
32
client = ( ( AutomationManagementClient ) automationClient ) ;
32
33
client . HttpClient . DefaultRequestHeaders . Remove ( Constants . ClientRequestIdHeaderName ) ;
33
34
client . HttpClient . DefaultRequestHeaders . Add ( Constants . ClientRequestIdHeaderName , Guid . NewGuid ( ) . ToString ( ) ) ;
35
+
36
+ client . HttpClient . DefaultRequestHeaders . Remove ( Constants . ActivityIdHeaderName ) ;
37
+ var activityId = Guid . NewGuid ( ) ;
38
+ EventProvider . SetActivityId ( ref activityId ) ;
39
+ client . HttpClient . DefaultRequestHeaders . Add ( Constants . ActivityIdHeaderName , activityId . ToString ( ) ) ;
34
40
}
35
41
36
42
public void Dispose ( )
@@ -43,6 +49,7 @@ protected virtual void Dispose(bool disposing)
43
49
if ( disposing )
44
50
{
45
51
client . HttpClient . DefaultRequestHeaders . Remove ( Constants . ClientRequestIdHeaderName ) ;
52
+ client . HttpClient . DefaultRequestHeaders . Remove ( Constants . ActivityIdHeaderName ) ;
46
53
}
47
54
}
48
55
}
You can’t perform that action at this time.
0 commit comments