File tree 2 files changed +17
-1
lines changed
src/Microsoft.Extensions.Configuration.AzureAppConfiguration
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
23
23
{
24
24
internal class AzureAppConfigurationProvider : ConfigurationProvider , IConfigurationRefresher , IDisposable
25
25
{
26
+ private readonly ActivitySource _activitySource = new ActivitySource ( ActivityNames . AzureAppConfigurationActivitySource ) ;
26
27
private bool _optional ;
27
28
private bool _isInitialLoadComplete = false ;
28
29
private bool _isAssemblyInspected ;
@@ -158,7 +159,7 @@ public AzureAppConfigurationProvider(IConfigurationClientManager configClientMan
158
159
public override void Load ( )
159
160
{
160
161
var watch = Stopwatch . StartNew ( ) ;
161
-
162
+ using Activity activity = _activitySource . StartActivity ( ActivityNames . Load ) ;
162
163
try
163
164
{
164
165
using var startupCancellationTokenSource = new CancellationTokenSource ( _options . Startup . Timeout ) ;
@@ -258,6 +259,7 @@ public async Task RefreshAsync(CancellationToken cancellationToken)
258
259
return ;
259
260
}
260
261
262
+ using Activity activity = _activitySource . StartActivity ( ActivityNames . Refresh ) ;
261
263
// Check if initial configuration load had failed
262
264
if ( _mappedData == null )
263
265
{
@@ -1413,6 +1415,7 @@ private async Task ProcessKeyValueChangesAsync(
1413
1415
public void Dispose ( )
1414
1416
{
1415
1417
( _configClientManager as ConfigurationClientManager ) ? . Dispose ( ) ;
1418
+ _activitySource . Dispose ( ) ;
1416
1419
}
1417
1420
}
1418
1421
}
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