From b7545ef857a136bc54927cbe6eea7092fc9c2462 Mon Sep 17 00:00:00 2001 From: cmanu Date: Mon, 24 Jun 2019 09:58:39 -0700 Subject: [PATCH] Revert "Update the App Insights version. (#7253)" (#7292) This reverts commit 15b1ad2366199d828eae74775d8b5b70e83ea534. --- .../NuGetGallery.Core.csproj | 10 ++-- .../NuGetGallery.Services.csproj | 4 +- src/NuGetGallery/ApplicationInsights.config | 58 +++++-------------- src/NuGetGallery/NuGetGallery.csproj | 44 ++++++++++---- .../ClientInformationTelemetryEnricher.cs | 8 +-- .../Telemetry/ClientTelemetryPIIProcessor.cs | 2 +- src/NuGetGallery/Web.config | 5 +- ...ClientInformationTelemetryEnricherTests.cs | 14 ++--- 8 files changed, 65 insertions(+), 80 deletions(-) diff --git a/src/NuGetGallery.Core/NuGetGallery.Core.csproj b/src/NuGetGallery.Core/NuGetGallery.Core.csproj index 5a6170f627..8cafd06137 100644 --- a/src/NuGetGallery.Core/NuGetGallery.Core.csproj +++ b/src/NuGetGallery.Core/NuGetGallery.Core.csproj @@ -223,19 +223,19 @@ - 2.50.0-cmanu-ai23-2746063 + 2.49.0 - 2.50.0-cmanu-ai23-2746063 + 2.49.0 - 2.50.0-cmanu-ai23-2746063 + 2.49.0 - 2.50.0-cmanu-ai23-2746063 + 2.49.0 - 2.50.0-cmanu-ai23-2746063 + 2.49.0 1.2.0 diff --git a/src/NuGetGallery.Services/NuGetGallery.Services.csproj b/src/NuGetGallery.Services/NuGetGallery.Services.csproj index 5a7e55355e..ee095d59fb 100644 --- a/src/NuGetGallery.Services/NuGetGallery.Services.csproj +++ b/src/NuGetGallery.Services/NuGetGallery.Services.csproj @@ -110,7 +110,7 @@ all - 2.10.0 + 2.2.0 5.2.3 @@ -125,7 +125,7 @@ 5.0.0-preview1.5665 - 2.50.0-cmanu-ai23-2746063 + 2.49.0 4.3.1 diff --git a/src/NuGetGallery/ApplicationInsights.config b/src/NuGetGallery/ApplicationInsights.config index adff596444..1c5d739123 100644 --- a/src/NuGetGallery/ApplicationInsights.config +++ b/src/NuGetGallery/ApplicationInsights.config @@ -1,5 +1,14 @@  + + + + @@ -41,36 +50,6 @@ --> - - - - @@ -81,6 +60,7 @@ 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 @@ -92,23 +72,11 @@ - - - - - - - - - - - - - - + --> \ No newline at end of file diff --git a/src/NuGetGallery/NuGetGallery.csproj b/src/NuGetGallery/NuGetGallery.csproj index 6b4b66adb5..debef7c88c 100644 --- a/src/NuGetGallery/NuGetGallery.csproj +++ b/src/NuGetGallery/NuGetGallery.csproj @@ -2114,13 +2114,6 @@ 0.15.4 - - 2.10.0 - contentFiles - - - 2.10.0 - 2.2.0 @@ -2131,7 +2124,7 @@ 2.2.0 - 2.50.0-cmanu-ai23-2746063 + 2.49.0 1.2.0 @@ -2198,6 +2191,30 @@ runtime; build; native; contentfiles; analyzers all + + 2.2.0 + + + 2.0.6 + + + 2.2.0 + + + 2.2.0 + + + 2.2.0 + + + 2.2.0 + + + 2.2.0 + + + 2.2.0 + 6.0.0 @@ -2331,16 +2348,16 @@ 5.0.0-preview1.5665 - 2.50.0-cmanu-ai23-2746063 + 2.49.0 - 2.50.0-cmanu-ai23-2746063 + 2.49.0 - 2.50.0-cmanu-ai23-2746063 + 2.49.0 - 2.50.0-cmanu-ai23-2746063 + 2.49.0 1.0.0 @@ -2360,6 +2377,9 @@ 4.3.0 + + 4.3.0 + 4.3.0 diff --git a/src/NuGetGallery/Telemetry/ClientInformationTelemetryEnricher.cs b/src/NuGetGallery/Telemetry/ClientInformationTelemetryEnricher.cs index d785d5bdf3..e06e17a62c 100644 --- a/src/NuGetGallery/Telemetry/ClientInformationTelemetryEnricher.cs +++ b/src/NuGetGallery/Telemetry/ClientInformationTelemetryEnricher.cs @@ -21,18 +21,18 @@ public void Initialize(ITelemetry telemetry) { // ClientVersion is available for NuGet clients starting version 4.1.0-~4.5.0 // Was deprecated and replaced by Protocol version - telemetry.Context.GlobalProperties.Add( + telemetry.Context.Properties.Add( TelemetryService.ClientVersion, httpContext.Request.Headers[GalleryConstants.ClientVersionHeaderName]); - telemetry.Context.GlobalProperties.Add( + telemetry.Context.Properties.Add( TelemetryService.ProtocolVersion, httpContext.Request.Headers[GalleryConstants.NuGetProtocolHeaderName]); - telemetry.Context.GlobalProperties.Add(TelemetryService.ClientInformation, httpContext.GetClientInformation()); + telemetry.Context.Properties.Add(TelemetryService.ClientInformation, httpContext.GetClientInformation()); // Is the user authenticated or this is an anonymous request? - telemetry.Context.GlobalProperties.Add(TelemetryService.IsAuthenticated, httpContext.Request.IsAuthenticated.ToString()); + telemetry.Context.Properties.Add(TelemetryService.IsAuthenticated, httpContext.Request.IsAuthenticated.ToString()); } } } diff --git a/src/NuGetGallery/Telemetry/ClientTelemetryPIIProcessor.cs b/src/NuGetGallery/Telemetry/ClientTelemetryPIIProcessor.cs index 0e865c1e50..a7d313d86d 100644 --- a/src/NuGetGallery/Telemetry/ClientTelemetryPIIProcessor.cs +++ b/src/NuGetGallery/Telemetry/ClientTelemetryPIIProcessor.cs @@ -28,7 +28,7 @@ public void Process(ITelemetry item) private void ModifyItem(ITelemetry item) { var requestTelemetryItem = item as RequestTelemetry; - if(requestTelemetryItem != null && requestTelemetryItem.Url != null) + if(requestTelemetryItem != null) { var route = GetCurrentRoute(); if(route == null) diff --git a/src/NuGetGallery/Web.config b/src/NuGetGallery/Web.config index 9d15c6bbe9..1f9b38d91e 100644 --- a/src/NuGetGallery/Web.config +++ b/src/NuGetGallery/Web.config @@ -319,7 +319,6 @@ - @@ -370,8 +369,6 @@ - - @@ -769,7 +766,7 @@ - + diff --git a/tests/NuGetGallery.Facts/Telemetry/ClientInformationTelemetryEnricherTests.cs b/tests/NuGetGallery.Facts/Telemetry/ClientInformationTelemetryEnricherTests.cs index d74b6de9bc..85e3c2a8e4 100644 --- a/tests/NuGetGallery.Facts/Telemetry/ClientInformationTelemetryEnricherTests.cs +++ b/tests/NuGetGallery.Facts/Telemetry/ClientInformationTelemetryEnricherTests.cs @@ -37,7 +37,7 @@ public void EnrichesOnlyRequestsTelemetry(Type telemetryType) { // Arrange var telemetry = (ITelemetry)telemetryType.GetConstructor(new Type[] { }).Invoke(new object[] { }); - telemetry.Context.GlobalProperties.Add("Test", "blala"); + telemetry.Context.Properties.Add("Test", "blala"); var headers = new NameValueCollection { @@ -54,11 +54,11 @@ public void EnrichesOnlyRequestsTelemetry(Type telemetryType) // Assert if (telemetry is RequestTelemetry) { - Assert.Equal(5, telemetry.Context.GlobalProperties.Count); + Assert.Equal(5, telemetry.Context.Properties.Count); } else { - Assert.Equal(1, telemetry.Context.GlobalProperties.Count); + Assert.Equal(1, telemetry.Context.Properties.Count); } } @@ -79,7 +79,7 @@ public void EnrichesTelemetryWithClientVersion() enricher.Initialize(telemetry); // Assert - Assert.Equal("5.0.0", telemetry.Context.GlobalProperties[TelemetryService.ClientVersion]); + Assert.Equal("5.0.0", telemetry.Properties[TelemetryService.ClientVersion]); } [Fact] @@ -99,7 +99,7 @@ public void EnrichesTelemetryWithProtocolVersion() enricher.Initialize(telemetry); // Assert - Assert.Equal("5.0.0", telemetry.Context.GlobalProperties[TelemetryService.ProtocolVersion]); + Assert.Equal("5.0.0", telemetry.Properties[TelemetryService.ProtocolVersion]); } [Fact] @@ -119,7 +119,7 @@ public void EnrichesTelemetryWithClientInfo() enricher.Initialize(telemetry); // Assert - Assert.NotEmpty(telemetry.Context.GlobalProperties[TelemetryService.ClientInformation]); + Assert.NotEmpty(telemetry.Properties[TelemetryService.ClientInformation]); } [Theory] @@ -135,7 +135,7 @@ public void EnrichesTelemetryWithIsAuthenticated(bool isAuthenticated) enricher.Initialize(telemetry); // Assert - Assert.Equal(isAuthenticated, bool.Parse(telemetry.Context.GlobalProperties[TelemetryService.IsAuthenticated])); + Assert.Equal(isAuthenticated, bool.Parse(telemetry.Properties[TelemetryService.IsAuthenticated])); } private TestableClientInformationTelemetryEnricher CreateTestEnricher(NameValueCollection headers, bool isAuthenticated = false)