Skip to content

Commit

Permalink
Revert "Update the App Insights version. (#7253)" (#7292)
Browse files Browse the repository at this point in the history
This reverts commit 15b1ad2.
  • Loading branch information
cristinamanum authored Jun 24, 2019
1 parent 15b1ad2 commit b7545ef
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 80 deletions.
10 changes: 5 additions & 5 deletions src/NuGetGallery.Core/NuGetGallery.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,19 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="NuGet.Services.Entities">
<Version>2.50.0-cmanu-ai23-2746063</Version>
<Version>2.49.0</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.FeatureFlags">
<Version>2.50.0-cmanu-ai23-2746063</Version>
<Version>2.49.0</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.Messaging.Email">
<Version>2.50.0-cmanu-ai23-2746063</Version>
<Version>2.49.0</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.Validation">
<Version>2.50.0-cmanu-ai23-2746063</Version>
<Version>2.49.0</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.Validation.Issues">
<Version>2.50.0-cmanu-ai23-2746063</Version>
<Version>2.49.0</Version>
</PackageReference>
<PackageReference Include="NuGet.StrongName.AnglicanGeek.MarkdownMailer">
<Version>1.2.0</Version>
Expand Down
4 changes: 2 additions & 2 deletions src/NuGetGallery.Services/NuGetGallery.Services.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights">
<Version>2.10.0</Version>
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.Mvc">
<Version>5.2.3</Version>
Expand All @@ -125,7 +125,7 @@
<Version>5.0.0-preview1.5665</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.Logging">
<Version>2.50.0-cmanu-ai23-2746063</Version>
<Version>2.49.0</Version>
</PackageReference>
<PackageReference Include="System.Runtime">
<Version>4.3.1</Version>
Expand Down
58 changes: 13 additions & 45 deletions src/NuGetGallery/ApplicationInsights.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
<!--
Learn more about Application Insights configuration with ApplicationInsights.config here:
http://go.microsoft.com/fwlink/?LinkID=513840
Note: If not present, please add <InstrumentationKey>Your Key</InstrumentationKey> to the top of this file.
-->
<TelemetryProcessors>
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryProcessor, Microsoft.AI.PerfCounterCollector"/>
</TelemetryProcessors>
<TelemetryInitializers>
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.HttpDependenciesParsingTelemetryInitializer, Microsoft.AI.DependencyCollector"/>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer"/>
Expand Down Expand Up @@ -41,36 +50,6 @@
-->
</Add>
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryModule, Microsoft.AI.PerfCounterCollector"/>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AppServicesHeartbeatTelemetryModule, Microsoft.AI.WindowsServer"/>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureInstanceMetadataTelemetryModule, Microsoft.AI.WindowsServer">
<!--
Remove individual fields collected here by adding them to the ApplicationInsighs.HeartbeatProvider
with the following syntax:
<Add Type="Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnosticsTelemetryModule, Microsoft.ApplicationInsights">
<ExcludedHeartbeatProperties>
<Add>osType</Add>
<Add>location</Add>
<Add>name</Add>
<Add>offer</Add>
<Add>platformFaultDomain</Add>
<Add>platformUpdateDomain</Add>
<Add>publisher</Add>
<Add>sku</Add>
<Add>version</Add>
<Add>vmId</Add>
<Add>vmSize</Add>
<Add>subscriptionId</Add>
<Add>resourceGroupName</Add>
<Add>placementGroupId</Add>
<Add>tags</Add>
<Add>vmScaleSetName</Add>
</ExcludedHeartbeatProperties>
</Add>
NOTE: exclusions will be lost upon upgrade.
-->
</Add>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.DeveloperModeWithDebuggerAttachedTelemetryModule, Microsoft.AI.WindowsServer"/>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.UnhandledExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
<Add Type="Microsoft.ApplicationInsights.WindowsServer.UnobservedExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
Expand All @@ -81,6 +60,7 @@
NOTE: handler configuration will be lost upon NuGet upgrade.
-->
<Add>System.Web.Handlers.TransferRequestHandler</Add>
<Add>Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler</Add>
<Add>System.Web.StaticFileHandler</Add>
<Add>System.Web.Handlers.AssemblyResourceLoader</Add>
Expand All @@ -92,23 +72,11 @@
</Handlers>
</Add>
<Add Type="Microsoft.ApplicationInsights.Web.ExceptionTrackingTelemetryModule, Microsoft.AI.Web"/>
<Add Type="Microsoft.ApplicationInsights.Web.AspNetDiagnosticTelemetryModule, Microsoft.AI.Web"/>
</TelemetryModules>
<ApplicationIdProvider Type="Microsoft.ApplicationInsights.Extensibility.Implementation.ApplicationId.ApplicationInsightsApplicationIdProvider, Microsoft.ApplicationInsights"/>
<TelemetrySinks>
<Add Name="default">
<TelemetryProcessors>
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryProcessor, Microsoft.AI.PerfCounterCollector"/>
<Add Type="Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor, Microsoft.ApplicationInsights"/>
</TelemetryProcessors>
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel"/>
</Add>
</TelemetrySinks>
<!--
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel"/>
<!--
Learn more about Application Insights configuration with ApplicationInsights.config here:
http://go.microsoft.com/fwlink/?LinkID=513840
Note: If not present, please add <InstrumentationKey>Your Key</InstrumentationKey> to the top of this file.
-->
</ApplicationInsights>

--></ApplicationInsights>
44 changes: 32 additions & 12 deletions src/NuGetGallery/NuGetGallery.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2114,13 +2114,6 @@
<PackageReference Include="Markdig.Signed">
<Version>0.15.4</Version>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights.TraceListener">
<Version>2.10.0</Version>
<ExcludeAssets>contentFiles</ExcludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights.Web">
<Version>2.10.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection">
<Version>2.2.0</Version>
</PackageReference>
Expand All @@ -2131,7 +2124,7 @@
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.Licenses">
<Version>2.50.0-cmanu-ai23-2746063</Version>
<Version>2.49.0</Version>
</PackageReference>
<PackageReference Include="NuGet.StrongName.AnglicanGeek.MarkdownMailer">
<Version>1.2.0</Version>
Expand Down Expand Up @@ -2198,6 +2191,30 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights">
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights.Agent.Intercept">
<Version>2.0.6</Version>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector">
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights.PerfCounterCollector">
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights.TraceListener">
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights.Web">
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer">
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel">
<Version>2.2.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.DynamicData.EFProvider">
<Version>6.0.0</Version>
</PackageReference>
Expand Down Expand Up @@ -2331,16 +2348,16 @@
<Version>5.0.0-preview1.5665</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.KeyVault">
<Version>2.50.0-cmanu-ai23-2746063</Version>
<Version>2.49.0</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.Logging">
<Version>2.50.0-cmanu-ai23-2746063</Version>
<Version>2.49.0</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.Owin">
<Version>2.50.0-cmanu-ai23-2746063</Version>
<Version>2.49.0</Version>
</PackageReference>
<PackageReference Include="NuGet.Services.Sql">
<Version>2.50.0-cmanu-ai23-2746063</Version>
<Version>2.49.0</Version>
</PackageReference>
<PackageReference Include="Owin">
<Version>1.0.0</Version>
Expand All @@ -2360,6 +2377,9 @@
<PackageReference Include="System.Diagnostics.Debug">
<Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.DiagnosticSource">
<Version>4.3.0</Version>
</PackageReference>
<PackageReference Include="System.Linq.Expressions">
<Version>4.3.0</Version>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/NuGetGallery/Telemetry/ClientTelemetryPIIProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions src/NuGetGallery/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah, Version=1.2.14706.0, Culture=neutral, PublicKeyToken=57eac04b2e0f138e, processorArchitecture=MSIL"/>
<add name="AsyncFileUpload" type="NuGetGallery.AsyncFileUpload.AsyncFileUploadModule, NuGetGallery"/>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
<add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation"/>
</httpModules>
<httpHandlers>
<!-- Remove Default HTTP Handler -->
Expand Down Expand Up @@ -370,8 +369,6 @@
<remove name="RoleManager"/>
<remove name="ApplicationInsightsWebTracking"/>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler"/>
<remove name="TelemetryCorrelationHttpModule"/>
<add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="managedHandler"/>
</modules>
<validation validateIntegratedModeConfiguration="false"/>
<httpErrors errorMode="DetailedLocalOnly">
Expand Down Expand Up @@ -769,7 +766,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.ApplicationInsights" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.10.0.0" newVersion="2.10.0.0"/>
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.IO.Compression" publicKeyToken="B77A5C561934E089" culture="neutral"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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);
}
}

Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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]
Expand All @@ -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)
Expand Down

0 comments on commit b7545ef

Please sign in to comment.