diff --git a/src/Catalog/NuGet.Services.Metadata.Catalog.csproj b/src/Catalog/NuGet.Services.Metadata.Catalog.csproj index 84808cb83..0a44ad961 100644 --- a/src/Catalog/NuGet.Services.Metadata.Catalog.csproj +++ b/src/Catalog/NuGet.Services.Metadata.Catalog.csproj @@ -291,7 +291,7 @@ 4.4.5-dev-2939401 - 2.46.0 + 2.57.0 5.0.0-preview1.5665 @@ -302,9 +302,6 @@ 1.0.6 - - 2.2.0 - 0.6.0 @@ -320,13 +317,13 @@ 5.0.0-preview1.5665 - 2.25.0-master-30088 + 2.57.0 4.3.3 - 8.2.1 + 9.3.3 diff --git a/src/Ng/Arguments.cs b/src/Ng/Arguments.cs index 127a50544..af6ecb15e 100644 --- a/src/Ng/Arguments.cs +++ b/src/Ng/Arguments.cs @@ -15,6 +15,7 @@ public static class Arguments public const string Gallery = "gallery"; public const string Id = "id"; public const string InstrumentationKey = "instrumentationkey"; + public const string HeartbeatIntervalSeconds = "HeartbeatIntervalSeconds"; public const string Path = "path"; public const string Source = "source"; public const string Verbose = "verbose"; diff --git a/src/Ng/Ng.csproj b/src/Ng/Ng.csproj index a1daa9edc..d47e6100f 100644 --- a/src/Ng/Ng.csproj +++ b/src/Ng/Ng.csproj @@ -160,9 +160,6 @@ runtime; build; native; contentfiles; analyzers all - - 2.2.0 - 1.1.1 @@ -178,23 +175,20 @@ 5.0.0-preview1.5665 - 2.2.2 + 2.57.0 - 2.25.0-master-30088 + 2.57.0 - 2.46.0 + 2.57.0 - 2.25.0-sb-queuesize-32353 + 2.57.0 4.0.0 - - 8.2.1 - diff --git a/src/Ng/Program.cs b/src/Ng/Program.cs index a65398229..7d6dc46dd 100644 --- a/src/Ng/Program.cs +++ b/src/Ng/Program.cs @@ -58,7 +58,19 @@ public static async Task MainAsync(string[] args) TelemetryConfiguration.Active.TelemetryInitializers.Add(new JobNameTelemetryInitializer(jobName, instanceName)); // Configure ApplicationInsights - ApplicationInsights.Initialize(arguments.GetOrDefault(Arguments.InstrumentationKey)); + var instrumentationKey = arguments.GetOrDefault(Arguments.InstrumentationKey); + var heartbeatIntervalSeconds = arguments.GetOrDefault(Arguments.HeartbeatIntervalSeconds); + + if (heartbeatIntervalSeconds == 0) + { + ApplicationInsights.Initialize(instrumentationKey); + } + else + { + ApplicationInsights.Initialize( + instrumentationKey, + TimeSpan.FromSeconds(heartbeatIntervalSeconds)); + } // Create an ILoggerFactory var loggerConfiguration = LoggingSetup.CreateDefaultLoggerConfiguration(withConsoleLogger: true); @@ -83,7 +95,7 @@ public static async Task MainAsync(string[] args) catch (ArgumentException ae) { _logger?.LogError("A required argument was not found or was malformed/invalid: {Exception}", ae); - + Console.WriteLine(job != null ? job.GetUsage() : NgJob.GetUsageBase()); } catch (Exception e) diff --git a/src/NuGet.Indexing/NuGet.Indexing.csproj b/src/NuGet.Indexing/NuGet.Indexing.csproj index d98d0aa03..98b69f1cb 100644 --- a/src/NuGet.Indexing/NuGet.Indexing.csproj +++ b/src/NuGet.Indexing/NuGet.Indexing.csproj @@ -188,7 +188,7 @@ 5.0.0-preview1.5665 - 2.2.2 + 2.57.0 4.4.5-dev-2939401 @@ -197,7 +197,7 @@ 4.3.3 - 8.2.1 + 9.3.3 diff --git a/src/NuGet.Services.AzureSearch/NuGet.Services.AzureSearch.csproj b/src/NuGet.Services.AzureSearch/NuGet.Services.AzureSearch.csproj index 7727fbef7..aa89d1a14 100644 --- a/src/NuGet.Services.AzureSearch/NuGet.Services.AzureSearch.csproj +++ b/src/NuGet.Services.AzureSearch/NuGet.Services.AzureSearch.csproj @@ -243,7 +243,7 @@ 5.0.3 - 4.1.0-dev-2942767 + 4.2.0 4.8.0 diff --git a/src/NuGet.Services.BasicSearch/ApplicationInsights.config b/src/NuGet.Services.BasicSearch/ApplicationInsights.config index 3d103298b..dc6b4285c 100644 --- a/src/NuGet.Services.BasicSearch/ApplicationInsights.config +++ b/src/NuGet.Services.BasicSearch/ApplicationInsights.config @@ -1,13 +1,12 @@  - 5 Trace;Exception - + @@ -51,6 +50,36 @@ --> + + + + @@ -61,7 +90,6 @@ NOTE: handler configuration will be lost upon NuGet upgrade. --> - System.Web.Handlers.TransferRequestHandler Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler System.Web.StaticFileHandler System.Web.Handlers.AssemblyResourceLoader @@ -73,11 +101,22 @@ + - - \ No newline at end of file + --> + \ No newline at end of file diff --git a/src/NuGet.Services.BasicSearch/BasicSearchConfiguration.cs b/src/NuGet.Services.BasicSearch/BasicSearchConfiguration.cs index f9aed8c58..bdb437968 100644 --- a/src/NuGet.Services.BasicSearch/BasicSearchConfiguration.cs +++ b/src/NuGet.Services.BasicSearch/BasicSearchConfiguration.cs @@ -19,6 +19,9 @@ public class BasicSearchConfiguration : IndexingConfiguration [ConfigurationKeyPrefix(SerilogPrefix)] public string ApplicationInsightsInstrumentationKey { get; set; } + [ConfigurationKeyPrefix(SerilogPrefix)] + public int ApplicationInsightsHeartbeatIntervalSeconds { get; set; } + [ConfigurationKeyPrefix(SearchPrefix)] [ConfigurationKey("IndexRefresh")] [DefaultValue(300)] diff --git a/src/NuGet.Services.BasicSearch/NuGet.Services.BasicSearch.csproj b/src/NuGet.Services.BasicSearch/NuGet.Services.BasicSearch.csproj index 546cd5b28..036000eb4 100644 --- a/src/NuGet.Services.BasicSearch/NuGet.Services.BasicSearch.csproj +++ b/src/NuGet.Services.BasicSearch/NuGet.Services.BasicSearch.csproj @@ -130,9 +130,6 @@ runtime; build; native; contentfiles; analyzers all - - 2.2.0 - 1.0.17-build01715 @@ -143,7 +140,7 @@ 0.12.0-build17386 - 2.2.0 + 2.10.0 0.12.0-build02810 @@ -164,10 +161,10 @@ 3.0.1 - 2.25.0-master-30088 + 2.57.0 - 2.2.3 + 2.57.0 2.0.9 diff --git a/src/NuGet.Services.BasicSearch/Startup.cs b/src/NuGet.Services.BasicSearch/Startup.cs index 210873f7e..a8ade702f 100644 --- a/src/NuGet.Services.BasicSearch/Startup.cs +++ b/src/NuGet.Services.BasicSearch/Startup.cs @@ -41,16 +41,21 @@ public class Startup private SearchTelemetryClient _searchTelemetryClient; private IConfigurationFactory _configFactory; - public void Configuration(IAppBuilder app, IConfigurationFactory configFactory, Directory directory, + public void Configuration( + IAppBuilder app, + IConfigurationFactory configFactory, + Directory directory, ILoader loader) { _configFactory = configFactory; var config = GetConfiguration().Result; // Configure - if ( ! string.IsNullOrEmpty(config.ApplicationInsightsInstrumentationKey)) + if (!string.IsNullOrEmpty(config.ApplicationInsightsInstrumentationKey)) { - TelemetryConfiguration.Active.InstrumentationKey = config.ApplicationInsightsInstrumentationKey; + Logging.ApplicationInsights.Initialize( + config.ApplicationInsightsInstrumentationKey, + TimeSpan.FromSeconds(config.ApplicationInsightsHeartbeatIntervalSeconds)); } // Add telemetry initializers @@ -218,7 +223,7 @@ private async Task GetConfiguration() { return await _configFactory.Get(); } - catch (KeyVaultClientException e) + catch (KeyVaultClientException e) { // The status code we expect is (e.Status == HttpStatusCode.Unauthorized || e.Status == HttpStatusCode.Forbidden) but the catch is not explicit since confidence here is low. diff --git a/src/NuGet.Services.BasicSearch/Web.config b/src/NuGet.Services.BasicSearch/Web.config index 6b920800b..346f2a061 100644 --- a/src/NuGet.Services.BasicSearch/Web.config +++ b/src/NuGet.Services.BasicSearch/Web.config @@ -51,7 +51,10 @@ + + + @@ -61,100 +64,116 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/NuGet.Services.Metadata.Catalog.Monitoring/NuGet.Services.Metadata.Catalog.Monitoring.csproj b/src/NuGet.Services.Metadata.Catalog.Monitoring/NuGet.Services.Metadata.Catalog.Monitoring.csproj index a29939e10..c16cc8af5 100644 --- a/src/NuGet.Services.Metadata.Catalog.Monitoring/NuGet.Services.Metadata.Catalog.Monitoring.csproj +++ b/src/NuGet.Services.Metadata.Catalog.Monitoring/NuGet.Services.Metadata.Catalog.Monitoring.csproj @@ -172,10 +172,7 @@ all - 2.25.0-sb-queuesize-32353 - - - 8.2.1 + 2.57.0 diff --git a/src/NuGet.Services.SearchService/App_Start/WebApiConfig.cs b/src/NuGet.Services.SearchService/App_Start/WebApiConfig.cs index e16e424ff..f8b8c9f01 100644 --- a/src/NuGet.Services.SearchService/App_Start/WebApiConfig.cs +++ b/src/NuGet.Services.SearchService/App_Start/WebApiConfig.cs @@ -120,9 +120,12 @@ private static AutofacWebApiDependencyResolver GetDependencyResolver(HttpConfigu var configuration = GetConfiguration(); var instrumentationKey = configuration.Root.GetValue("ApplicationInsights_InstrumentationKey"); + var heartbeatIntervalSeconds = configuration.Root.GetValue("ApplicationInsights_HeartbeatIntervalSeconds", 60); if (!string.IsNullOrWhiteSpace(instrumentationKey)) { - TelemetryConfiguration.Active.InstrumentationKey = instrumentationKey; + ApplicationInsights.Initialize( + instrumentationKey, + TimeSpan.FromSeconds(heartbeatIntervalSeconds)); } TelemetryConfiguration.Active.TelemetryInitializers.Add(new AzureWebAppTelemetryInitializer()); diff --git a/src/NuGet.Services.SearchService/ApplicationInsights.config b/src/NuGet.Services.SearchService/ApplicationInsights.config index 5cade8dba..d695415d1 100644 --- a/src/NuGet.Services.SearchService/ApplicationInsights.config +++ b/src/NuGet.Services.SearchService/ApplicationInsights.config @@ -6,9 +6,6 @@ Note: If not present, please add Your Key to the top of this file. --> - - - @@ -50,6 +47,36 @@ --> + + + + @@ -61,7 +88,6 @@ NOTE: handler configuration will be lost upon NuGet upgrade. --> - System.Web.Handlers.TransferRequestHandler Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler System.Web.StaticFileHandler System.Web.Handlers.AssemblyResourceLoader @@ -73,8 +99,18 @@ + - + + + + + + + + + +