Stopped collecting command arguments due to PII concerns

This commit is contained in:
Lakshan Fernando 2016-03-30 17:21:31 -07:00 committed by Dan Quirk
parent e9a6c4350a
commit d9e169e77a
2 changed files with 8 additions and 8 deletions

View file

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using Microsoft.ApplicationInsights;
using Microsoft.Extensions.PlatformAbstractions;
using System.Diagnostics;
namespace Microsoft.DotNet.Cli.Utils
{
@ -13,9 +14,7 @@ namespace Microsoft.DotNet.Cli.Utils
private static Dictionary<string, string> _commonProperties = null;
private static Dictionary<string, double> _commonMeasurements = null;
//readonly instead of const to to avoid inlining in case we need to change the instrumentation key
private static readonly string InstrumentationKey = "74cc1c9e-3e6e-4d05-b3fc-dde9101d0254";
private const string InstrumentationKey = "74cc1c9e-3e6e-4d05-b3fc-dde9101d0254";
private const string TelemetryOptout = "DOTNET_CLI_TELEMETRY_OPTOUT";
private const string OSVersion = "OS Version";
private const string OSPlatform = "OS Platform";
@ -50,7 +49,11 @@ namespace Microsoft.DotNet.Cli.Utils
_isInitialized = true;
}
catch (Exception) { }
catch (Exception)
{
// we dont want to fail the tool if telemetry fais. We should be able to detect abnormalities from data
// at the server end
}
}
public void TrackCommand(string command, IDictionary<string, string> properties = null, IDictionary<string, double> measurements = null)
@ -69,6 +72,7 @@ namespace Microsoft.DotNet.Cli.Utils
catch (Exception) { }
}
private Dictionary<string, double> GetEventMeasures(IDictionary<string, double> measurements)
{
Dictionary<string, double> eventMeasurements = new Dictionary<string, double>(_commonMeasurements);

View file

@ -139,10 +139,6 @@ namespace Microsoft.DotNet.Cli
telemetryClient.TrackCommand(
command,
new Dictionary<string, string>
{
["Arguments"] = arguments
},
new Dictionary<string, double>
{
["ExitCode"] = exitCode