File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed 
src/Microsoft.Extensions.Configuration.AzureAppConfiguration Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ namespace Microsoft.Extensions.Configuration.AzureAppConfiguration
2323{ 
2424    internal  class  AzureAppConfigurationProvider  :  ConfigurationProvider ,  IConfigurationRefresher ,  IDisposable 
2525    { 
26+         private  readonly  ActivitySource  _activitySource  =  new  ActivitySource ( ActivityNames . AzureAppConfigurationActivitySource ) ; 
2627        private  bool  _optional ; 
2728        private  bool  _isInitialLoadComplete  =  false ; 
2829        private  bool  _isAssemblyInspected ; 
@@ -158,7 +159,7 @@ public AzureAppConfigurationProvider(IConfigurationClientManager configClientMan
158159        public  override  void  Load ( ) 
159160        { 
160161            var  watch  =  Stopwatch . StartNew ( ) ; 
161- 
162+              using   Activity   activity   =   _activitySource . StartActivity ( ActivityNames . Load ) ; 
162163            try 
163164            { 
164165                using  var  startupCancellationTokenSource  =  new  CancellationTokenSource ( _options . Startup . Timeout ) ; 
@@ -258,6 +259,7 @@ public async Task RefreshAsync(CancellationToken cancellationToken)
258259                        return ; 
259260                    } 
260261
262+                     using  Activity  activity  =  _activitySource . StartActivity ( ActivityNames . Refresh ) ; 
261263                    // Check if initial configuration load had failed 
262264                    if  ( _mappedData  ==  null ) 
263265                    { 
@@ -1406,6 +1408,7 @@ private async Task ProcessKeyValueChangesAsync(
14061408        public  void  Dispose ( ) 
14071409        { 
14081410            ( _configClientManager  as  ConfigurationClientManager ) ? . Dispose ( ) ; 
1411+             _activitySource . Dispose ( ) ; 
14091412        } 
14101413    } 
14111414} 
Original file line number Diff line number Diff line change 1+ // Copyright (c) Microsoft Corporation. 
2+ // Licensed under the MIT license. 
3+ // 
4+ 
5+ namespace  Microsoft . Extensions . Configuration . AzureAppConfiguration 
6+ { 
7+     internal  static class  ActivityNames 
8+     { 
9+         public  const  string  AzureAppConfigurationActivitySource  =  "Microsoft.Extensions.Configuration.AzureAppConfiguration" ; 
10+         public  const  string  Load  =  "Load" ; 
11+         public  const  string  Refresh  =  "Refresh" ; 
12+     } 
13+ } 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments