Skip to content

Commit 872e05f

Browse files
Fix AI request telemetry (#7599)
1 parent a37e81f commit 872e05f

File tree

2 files changed

+46
-7
lines changed

2 files changed

+46
-7
lines changed

src/NuGetGallery/ApplicationInsights.config

+44-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
77
Note: If not present, please add <InstrumentationKey>Your Key</InstrumentationKey> to the top of this file.
88
-->
9-
<TelemetryProcessors>
10-
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryProcessor, Microsoft.AI.PerfCounterCollector"/>
11-
</TelemetryProcessors>
129
<TelemetryInitializers>
1310
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.HttpDependenciesParsingTelemetryInitializer, Microsoft.AI.DependencyCollector"/>
1411
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer"/>
@@ -50,6 +47,36 @@
5047
-->
5148
</Add>
5249
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryModule, Microsoft.AI.PerfCounterCollector"/>
50+
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AppServicesHeartbeatTelemetryModule, Microsoft.AI.WindowsServer"/>
51+
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureInstanceMetadataTelemetryModule, Microsoft.AI.WindowsServer">
52+
<!--
53+
Remove individual fields collected here by adding them to the ApplicationInsighs.HeartbeatProvider
54+
with the following syntax:
55+
56+
<Add Type="Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnosticsTelemetryModule, Microsoft.ApplicationInsights">
57+
<ExcludedHeartbeatProperties>
58+
<Add>osType</Add>
59+
<Add>location</Add>
60+
<Add>name</Add>
61+
<Add>offer</Add>
62+
<Add>platformFaultDomain</Add>
63+
<Add>platformUpdateDomain</Add>
64+
<Add>publisher</Add>
65+
<Add>sku</Add>
66+
<Add>version</Add>
67+
<Add>vmId</Add>
68+
<Add>vmSize</Add>
69+
<Add>subscriptionId</Add>
70+
<Add>resourceGroupName</Add>
71+
<Add>placementGroupId</Add>
72+
<Add>tags</Add>
73+
<Add>vmScaleSetName</Add>
74+
</ExcludedHeartbeatProperties>
75+
</Add>
76+
77+
NOTE: exclusions will be lost upon upgrade.
78+
-->
79+
</Add>
5380
<Add Type="Microsoft.ApplicationInsights.WindowsServer.DeveloperModeWithDebuggerAttachedTelemetryModule, Microsoft.AI.WindowsServer"/>
5481
<Add Type="Microsoft.ApplicationInsights.WindowsServer.UnhandledExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
5582
<Add Type="Microsoft.ApplicationInsights.WindowsServer.UnobservedExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
@@ -60,7 +87,6 @@
6087
6188
NOTE: handler configuration will be lost upon NuGet upgrade.
6289
-->
63-
<Add>System.Web.Handlers.TransferRequestHandler</Add>
6490
<Add>Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler</Add>
6591
<Add>System.Web.StaticFileHandler</Add>
6692
<Add>System.Web.Handlers.AssemblyResourceLoader</Add>
@@ -72,11 +98,22 @@
7298
</Handlers>
7399
</Add>
74100
<Add Type="Microsoft.ApplicationInsights.Web.ExceptionTrackingTelemetryModule, Microsoft.AI.Web"/>
101+
<Add Type="Microsoft.ApplicationInsights.Web.AspNetDiagnosticTelemetryModule, Microsoft.AI.Web"/>
75102
</TelemetryModules>
76-
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel"/>
77-
<!--
103+
<ApplicationIdProvider Type="Microsoft.ApplicationInsights.Extensibility.Implementation.ApplicationId.ApplicationInsightsApplicationIdProvider, Microsoft.ApplicationInsights"/>
104+
<TelemetrySinks>
105+
<Add Name="default">
106+
<TelemetryProcessors>
107+
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryProcessor, Microsoft.AI.PerfCounterCollector"/>
108+
<Add Type="Microsoft.ApplicationInsights.Extensibility.AutocollectedMetricsExtractor, Microsoft.ApplicationInsights"/>
109+
</TelemetryProcessors>
110+
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel"/>
111+
</Add>
112+
</TelemetrySinks>
113+
<!--
78114
Learn more about Application Insights configuration with ApplicationInsights.config here:
79115
http://go.microsoft.com/fwlink/?LinkID=513840
80116
81117
Note: If not present, please add <InstrumentationKey>Your Key</InstrumentationKey> to the top of this file.
82-
--></ApplicationInsights>
118+
-->
119+
</ApplicationInsights>

src/NuGetGallery/Web.config

+2
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@
373373
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah, Version=1.2.14706.0, Culture=neutral, PublicKeyToken=57eac04b2e0f138e, processorArchitecture=MSIL" preCondition="managedHandler"/>
374374
<add name="AsyncFileUpload" type="NuGetGallery.AsyncFileUpload.AsyncFileUploadModule, NuGetGallery.Services" preCondition="managedHandler"/>
375375
<remove name="RoleManager"/>
376+
<remove name="TelemetryCorrelationHttpModule" />
377+
<add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="integratedMode,managedHandler" />
376378
<remove name="ApplicationInsightsWebTracking"/>
377379
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler"/>
378380
</modules>

0 commit comments

Comments
 (0)