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
3838
3939 public const string ClientRequestIdHeaderName = "x-ms-client-request-id" ;
4040
41+ public const string ActivityIdHeaderName = "x-ms-activity-id" ;
42+
4143 // default schedule expiry time for daily schedule, consistent with UX
4244 // 12/31/9999 12:00:00 AM
4345 public static readonly DateTimeOffset DefaultScheduleExpiryTime = DateTimeOffset . MaxValue ;
Original file line number Diff line number Diff line change 1414
1515using System ;
1616using System . Collections . Generic ;
17+ using System . Diagnostics . Eventing ;
1718using System . Linq ;
1819using System . Text ;
1920using System . Threading . Tasks ;
@@ -31,6 +32,11 @@ public RequestSettings(IAutomationManagementClient automationClient)
3132 client = ( ( AutomationManagementClient ) automationClient ) ;
3233 client . HttpClient . DefaultRequestHeaders . Remove ( Constants . ClientRequestIdHeaderName ) ;
3334 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 ( ) ) ;
3440 }
3541
3642 public void Dispose ( )
@@ -43,6 +49,7 @@ protected virtual void Dispose(bool disposing)
4349 if ( disposing )
4450 {
4551 client . HttpClient . DefaultRequestHeaders . Remove ( Constants . ClientRequestIdHeaderName ) ;
52+ client . HttpClient . DefaultRequestHeaders . Remove ( Constants . ActivityIdHeaderName ) ;
4653 }
4754 }
4855 }
You can’t perform that action at this time.
0 commit comments