Skip to content

Commit b7545ef

Browse files
Revert "Update the App Insights version. (#7253)" (#7292)
This reverts commit 15b1ad2.
1 parent 15b1ad2 commit b7545ef

8 files changed

Lines changed: 65 additions & 80 deletions

File tree

src/NuGetGallery.Core/NuGetGallery.Core.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,19 +223,19 @@
223223
</ItemGroup>
224224
<ItemGroup>
225225
<PackageReference Include="NuGet.Services.Entities">
226-
<Version>2.50.0-cmanu-ai23-2746063</Version>
226+
<Version>2.49.0</Version>
227227
</PackageReference>
228228
<PackageReference Include="NuGet.Services.FeatureFlags">
229-
<Version>2.50.0-cmanu-ai23-2746063</Version>
229+
<Version>2.49.0</Version>
230230
</PackageReference>
231231
<PackageReference Include="NuGet.Services.Messaging.Email">
232-
<Version>2.50.0-cmanu-ai23-2746063</Version>
232+
<Version>2.49.0</Version>
233233
</PackageReference>
234234
<PackageReference Include="NuGet.Services.Validation">
235-
<Version>2.50.0-cmanu-ai23-2746063</Version>
235+
<Version>2.49.0</Version>
236236
</PackageReference>
237237
<PackageReference Include="NuGet.Services.Validation.Issues">
238-
<Version>2.50.0-cmanu-ai23-2746063</Version>
238+
<Version>2.49.0</Version>
239239
</PackageReference>
240240
<PackageReference Include="NuGet.StrongName.AnglicanGeek.MarkdownMailer">
241241
<Version>1.2.0</Version>

src/NuGetGallery.Services/NuGetGallery.Services.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<PrivateAssets>all</PrivateAssets>
111111
</PackageReference>
112112
<PackageReference Include="Microsoft.ApplicationInsights">
113-
<Version>2.10.0</Version>
113+
<Version>2.2.0</Version>
114114
</PackageReference>
115115
<PackageReference Include="Microsoft.AspNet.Mvc">
116116
<Version>5.2.3</Version>
@@ -125,7 +125,7 @@
125125
<Version>5.0.0-preview1.5665</Version>
126126
</PackageReference>
127127
<PackageReference Include="NuGet.Services.Logging">
128-
<Version>2.50.0-cmanu-ai23-2746063</Version>
128+
<Version>2.49.0</Version>
129129
</PackageReference>
130130
<PackageReference Include="System.Runtime">
131131
<Version>4.3.1</Version>
Lines changed: 13 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
3+
<!--
4+
Learn more about Application Insights configuration with ApplicationInsights.config here:
5+
http://go.microsoft.com/fwlink/?LinkID=513840
6+
7+
Note: If not present, please add <InstrumentationKey>Your Key</InstrumentationKey> to the top of this file.
8+
-->
9+
<TelemetryProcessors>
10+
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryProcessor, Microsoft.AI.PerfCounterCollector"/>
11+
</TelemetryProcessors>
312
<TelemetryInitializers>
413
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.HttpDependenciesParsingTelemetryInitializer, Microsoft.AI.DependencyCollector"/>
514
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer"/>
@@ -41,36 +50,6 @@
4150
-->
4251
</Add>
4352
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryModule, Microsoft.AI.PerfCounterCollector"/>
44-
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AppServicesHeartbeatTelemetryModule, Microsoft.AI.WindowsServer"/>
45-
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureInstanceMetadataTelemetryModule, Microsoft.AI.WindowsServer">
46-
<!--
47-
Remove individual fields collected here by adding them to the ApplicationInsighs.HeartbeatProvider
48-
with the following syntax:
49-
50-
<Add Type="Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnosticsTelemetryModule, Microsoft.ApplicationInsights">
51-
<ExcludedHeartbeatProperties>
52-
<Add>osType</Add>
53-
<Add>location</Add>
54-
<Add>name</Add>
55-
<Add>offer</Add>
56-
<Add>platformFaultDomain</Add>
57-
<Add>platformUpdateDomain</Add>
58-
<Add>publisher</Add>
59-
<Add>sku</Add>
60-
<Add>version</Add>
61-
<Add>vmId</Add>
62-
<Add>vmSize</Add>
63-
<Add>subscriptionId</Add>
64-
<Add>resourceGroupName</Add>
65-
<Add>placementGroupId</Add>
66-
<Add>tags</Add>
67-
<Add>vmScaleSetName</Add>
68-
</ExcludedHeartbeatProperties>
69-
</Add>
70-
71-
NOTE: exclusions will be lost upon upgrade.
72-
-->
73-
</Add>
7453
<Add Type="Microsoft.ApplicationInsights.WindowsServer.DeveloperModeWithDebuggerAttachedTelemetryModule, Microsoft.AI.WindowsServer"/>
7554
<Add Type="Microsoft.ApplicationInsights.WindowsServer.UnhandledExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
7655
<Add Type="Microsoft.ApplicationInsights.WindowsServer.UnobservedExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
@@ -81,6 +60,7 @@
8160
8261
NOTE: handler configuration will be lost upon NuGet upgrade.
8362
-->
63+
<Add>System.Web.Handlers.TransferRequestHandler</Add>
8464
<Add>Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler</Add>
8565
<Add>System.Web.StaticFileHandler</Add>
8666
<Add>System.Web.Handlers.AssemblyResourceLoader</Add>
@@ -92,23 +72,11 @@
9272
</Handlers>
9373
</Add>
9474
<Add Type="Microsoft.ApplicationInsights.Web.ExceptionTrackingTelemetryModule, Microsoft.AI.Web"/>
95-
<Add Type="Microsoft.ApplicationInsights.Web.AspNetDiagnosticTelemetryModule, Microsoft.AI.Web"/>
9675
</TelemetryModules>
97-
<ApplicationIdProvider Type="Microsoft.ApplicationInsights.Extensibility.Implementation.ApplicationId.ApplicationInsightsApplicationIdProvider, Microsoft.ApplicationInsights"/>
98-
<TelemetrySinks>
99-
<Add Name="default">
100-
<TelemetryProcessors>
101-
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryProcessor, Microsoft.AI.PerfCounterCollector"/>
102-
<Add Type="Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor, Microsoft.ApplicationInsights"/>
103-
</TelemetryProcessors>
104-
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel"/>
105-
</Add>
106-
</TelemetrySinks>
107-
<!--
76+
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel"/>
77+
<!--
10878
Learn more about Application Insights configuration with ApplicationInsights.config here:
10979
http://go.microsoft.com/fwlink/?LinkID=513840
11080
11181
Note: If not present, please add <InstrumentationKey>Your Key</InstrumentationKey> to the top of this file.
112-
-->
113-
</ApplicationInsights>
114-
82+
--></ApplicationInsights>

src/NuGetGallery/NuGetGallery.csproj

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,13 +2114,6 @@
21142114
<PackageReference Include="Markdig.Signed">
21152115
<Version>0.15.4</Version>
21162116
</PackageReference>
2117-
<PackageReference Include="Microsoft.ApplicationInsights.TraceListener">
2118-
<Version>2.10.0</Version>
2119-
<ExcludeAssets>contentFiles</ExcludeAssets>
2120-
</PackageReference>
2121-
<PackageReference Include="Microsoft.ApplicationInsights.Web">
2122-
<Version>2.10.0</Version>
2123-
</PackageReference>
21242117
<PackageReference Include="Microsoft.Extensions.DependencyInjection">
21252118
<Version>2.2.0</Version>
21262119
</PackageReference>
@@ -2131,7 +2124,7 @@
21312124
<Version>2.2.0</Version>
21322125
</PackageReference>
21332126
<PackageReference Include="NuGet.Services.Licenses">
2134-
<Version>2.50.0-cmanu-ai23-2746063</Version>
2127+
<Version>2.49.0</Version>
21352128
</PackageReference>
21362129
<PackageReference Include="NuGet.StrongName.AnglicanGeek.MarkdownMailer">
21372130
<Version>1.2.0</Version>
@@ -2198,6 +2191,30 @@
21982191
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
21992192
<PrivateAssets>all</PrivateAssets>
22002193
</PackageReference>
2194+
<PackageReference Include="Microsoft.ApplicationInsights">
2195+
<Version>2.2.0</Version>
2196+
</PackageReference>
2197+
<PackageReference Include="Microsoft.ApplicationInsights.Agent.Intercept">
2198+
<Version>2.0.6</Version>
2199+
</PackageReference>
2200+
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector">
2201+
<Version>2.2.0</Version>
2202+
</PackageReference>
2203+
<PackageReference Include="Microsoft.ApplicationInsights.PerfCounterCollector">
2204+
<Version>2.2.0</Version>
2205+
</PackageReference>
2206+
<PackageReference Include="Microsoft.ApplicationInsights.TraceListener">
2207+
<Version>2.2.0</Version>
2208+
</PackageReference>
2209+
<PackageReference Include="Microsoft.ApplicationInsights.Web">
2210+
<Version>2.2.0</Version>
2211+
</PackageReference>
2212+
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer">
2213+
<Version>2.2.0</Version>
2214+
</PackageReference>
2215+
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel">
2216+
<Version>2.2.0</Version>
2217+
</PackageReference>
22012218
<PackageReference Include="Microsoft.AspNet.DynamicData.EFProvider">
22022219
<Version>6.0.0</Version>
22032220
</PackageReference>
@@ -2331,16 +2348,16 @@
23312348
<Version>5.0.0-preview1.5665</Version>
23322349
</PackageReference>
23332350
<PackageReference Include="NuGet.Services.KeyVault">
2334-
<Version>2.50.0-cmanu-ai23-2746063</Version>
2351+
<Version>2.49.0</Version>
23352352
</PackageReference>
23362353
<PackageReference Include="NuGet.Services.Logging">
2337-
<Version>2.50.0-cmanu-ai23-2746063</Version>
2354+
<Version>2.49.0</Version>
23382355
</PackageReference>
23392356
<PackageReference Include="NuGet.Services.Owin">
2340-
<Version>2.50.0-cmanu-ai23-2746063</Version>
2357+
<Version>2.49.0</Version>
23412358
</PackageReference>
23422359
<PackageReference Include="NuGet.Services.Sql">
2343-
<Version>2.50.0-cmanu-ai23-2746063</Version>
2360+
<Version>2.49.0</Version>
23442361
</PackageReference>
23452362
<PackageReference Include="Owin">
23462363
<Version>1.0.0</Version>
@@ -2360,6 +2377,9 @@
23602377
<PackageReference Include="System.Diagnostics.Debug">
23612378
<Version>4.3.0</Version>
23622379
</PackageReference>
2380+
<PackageReference Include="System.Diagnostics.DiagnosticSource">
2381+
<Version>4.3.0</Version>
2382+
</PackageReference>
23632383
<PackageReference Include="System.Linq.Expressions">
23642384
<Version>4.3.0</Version>
23652385
</PackageReference>

src/NuGetGallery/Telemetry/ClientInformationTelemetryEnricher.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ public void Initialize(ITelemetry telemetry)
2121
{
2222
// ClientVersion is available for NuGet clients starting version 4.1.0-~4.5.0
2323
// Was deprecated and replaced by Protocol version
24-
telemetry.Context.GlobalProperties.Add(
24+
telemetry.Context.Properties.Add(
2525
TelemetryService.ClientVersion,
2626
httpContext.Request.Headers[GalleryConstants.ClientVersionHeaderName]);
2727

28-
telemetry.Context.GlobalProperties.Add(
28+
telemetry.Context.Properties.Add(
2929
TelemetryService.ProtocolVersion,
3030
httpContext.Request.Headers[GalleryConstants.NuGetProtocolHeaderName]);
3131

32-
telemetry.Context.GlobalProperties.Add(TelemetryService.ClientInformation, httpContext.GetClientInformation());
32+
telemetry.Context.Properties.Add(TelemetryService.ClientInformation, httpContext.GetClientInformation());
3333

3434
// Is the user authenticated or this is an anonymous request?
35-
telemetry.Context.GlobalProperties.Add(TelemetryService.IsAuthenticated, httpContext.Request.IsAuthenticated.ToString());
35+
telemetry.Context.Properties.Add(TelemetryService.IsAuthenticated, httpContext.Request.IsAuthenticated.ToString());
3636
}
3737
}
3838
}

src/NuGetGallery/Telemetry/ClientTelemetryPIIProcessor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void Process(ITelemetry item)
2828
private void ModifyItem(ITelemetry item)
2929
{
3030
var requestTelemetryItem = item as RequestTelemetry;
31-
if(requestTelemetryItem != null && requestTelemetryItem.Url != null)
31+
if(requestTelemetryItem != null)
3232
{
3333
var route = GetCurrentRoute();
3434
if(route == null)

src/NuGetGallery/Web.config

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@
319319
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah, Version=1.2.14706.0, Culture=neutral, PublicKeyToken=57eac04b2e0f138e, processorArchitecture=MSIL"/>
320320
<add name="AsyncFileUpload" type="NuGetGallery.AsyncFileUpload.AsyncFileUploadModule, NuGetGallery"/>
321321
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
322-
<add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation"/>
323322
</httpModules>
324323
<httpHandlers>
325324
<!-- Remove Default HTTP Handler -->
@@ -370,8 +369,6 @@
370369
<remove name="RoleManager"/>
371370
<remove name="ApplicationInsightsWebTracking"/>
372371
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler"/>
373-
<remove name="TelemetryCorrelationHttpModule"/>
374-
<add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="managedHandler"/>
375372
</modules>
376373
<validation validateIntegratedModeConfiguration="false"/>
377374
<httpErrors errorMode="DetailedLocalOnly">
@@ -769,7 +766,7 @@
769766
</dependentAssembly>
770767
<dependentAssembly>
771768
<assemblyIdentity name="Microsoft.ApplicationInsights" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
772-
<bindingRedirect oldVersion="0.0.0.0-2.10.0.0" newVersion="2.10.0.0"/>
769+
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0"/>
773770
</dependentAssembly>
774771
<dependentAssembly>
775772
<assemblyIdentity name="System.IO.Compression" publicKeyToken="B77A5C561934E089" culture="neutral"/>

tests/NuGetGallery.Facts/Telemetry/ClientInformationTelemetryEnricherTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void EnrichesOnlyRequestsTelemetry(Type telemetryType)
3737
{
3838
// Arrange
3939
var telemetry = (ITelemetry)telemetryType.GetConstructor(new Type[] { }).Invoke(new object[] { });
40-
telemetry.Context.GlobalProperties.Add("Test", "blala");
40+
telemetry.Context.Properties.Add("Test", "blala");
4141

4242
var headers = new NameValueCollection
4343
{
@@ -54,11 +54,11 @@ public void EnrichesOnlyRequestsTelemetry(Type telemetryType)
5454
// Assert
5555
if (telemetry is RequestTelemetry)
5656
{
57-
Assert.Equal(5, telemetry.Context.GlobalProperties.Count);
57+
Assert.Equal(5, telemetry.Context.Properties.Count);
5858
}
5959
else
6060
{
61-
Assert.Equal(1, telemetry.Context.GlobalProperties.Count);
61+
Assert.Equal(1, telemetry.Context.Properties.Count);
6262
}
6363
}
6464

@@ -79,7 +79,7 @@ public void EnrichesTelemetryWithClientVersion()
7979
enricher.Initialize(telemetry);
8080

8181
// Assert
82-
Assert.Equal("5.0.0", telemetry.Context.GlobalProperties[TelemetryService.ClientVersion]);
82+
Assert.Equal("5.0.0", telemetry.Properties[TelemetryService.ClientVersion]);
8383
}
8484

8585
[Fact]
@@ -99,7 +99,7 @@ public void EnrichesTelemetryWithProtocolVersion()
9999
enricher.Initialize(telemetry);
100100

101101
// Assert
102-
Assert.Equal("5.0.0", telemetry.Context.GlobalProperties[TelemetryService.ProtocolVersion]);
102+
Assert.Equal("5.0.0", telemetry.Properties[TelemetryService.ProtocolVersion]);
103103
}
104104

105105
[Fact]
@@ -119,7 +119,7 @@ public void EnrichesTelemetryWithClientInfo()
119119
enricher.Initialize(telemetry);
120120

121121
// Assert
122-
Assert.NotEmpty(telemetry.Context.GlobalProperties[TelemetryService.ClientInformation]);
122+
Assert.NotEmpty(telemetry.Properties[TelemetryService.ClientInformation]);
123123
}
124124

125125
[Theory]
@@ -135,7 +135,7 @@ public void EnrichesTelemetryWithIsAuthenticated(bool isAuthenticated)
135135
enricher.Initialize(telemetry);
136136

137137
// Assert
138-
Assert.Equal(isAuthenticated, bool.Parse(telemetry.Context.GlobalProperties[TelemetryService.IsAuthenticated]));
138+
Assert.Equal(isAuthenticated, bool.Parse(telemetry.Properties[TelemetryService.IsAuthenticated]));
139139
}
140140

141141
private TestableClientInformationTelemetryEnricher CreateTestEnricher(NameValueCollection headers, bool isAuthenticated = false)

0 commit comments

Comments
 (0)