Bump Microsoft.ApplicationInsights from 2.10.0 to 2.11.0 (#10608)

* Bump Microsoft.ApplicationInsights from 2.10.0 to 2.11.0

Bumps [Microsoft.ApplicationInsights](https://github.com/Microsoft/ApplicationInsights-dotnet) from 2.10.0 to 2.11.0.
- [Release notes](https://github.com/Microsoft/ApplicationInsights-dotnet/releases)
- [Changelog](https://github.com/microsoft/ApplicationInsights-dotnet/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/Microsoft/ApplicationInsights-dotnet/compare/2.10.0...2.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Add new style of telemetry client instatiation

This is needed as the singleton TelemetryConfiguration.Active is no longer available
This commit is contained in:
dependabot-preview[bot]
2019-10-16 15:08:34 -07:00
committed by Travis Plunk
parent 48db3de03e
commit 82cafd1b21
2 changed files with 6 additions and 4 deletions
@@ -14,7 +14,7 @@
<!-- the following package(s) are from https://github.com/JamesNK/Newtonsoft.Json -->
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<!-- the Application Insights package -->
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.10.0" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.11.0" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="Microsoft.Win32.Registry.AccessControl" Version="4.6.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0" />
@@ -102,11 +102,13 @@ namespace Microsoft.PowerShell.Telemetry
CanSendTelemetry = !Utils.GetOptOutEnvVariableAsBool(name: _telemetryOptoutEnvVar, defaultValue: false);
if (CanSendTelemetry)
{
s_telemetryClient = new TelemetryClient();
TelemetryConfiguration.Active.InstrumentationKey = _psCoreTelemetryKey;
TelemetryConfiguration configuration = TelemetryConfiguration.CreateDefault();
configuration.InstrumentationKey = _psCoreTelemetryKey;
// Set this to true to reduce latency during development
TelemetryConfiguration.Active.TelemetryChannel.DeveloperMode = false;
configuration.TelemetryChannel.DeveloperMode = false;
s_telemetryClient = new TelemetryClient(configuration);
s_sessionId = Guid.NewGuid().ToString();
// use a hashset when looking for module names, it should be quicker than a string comparison