Catch exceptions raised sending telemetry events (#182)

This commit is contained in:
Karl Burtram
2016-12-12 15:50:08 -08:00
committed by GitHub
parent 40c1434745
commit 5c2e6b74cf

View File

@@ -360,19 +360,26 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
if (ServiceHost != null) if (ServiceHost != null)
{ {
// Send a telemetry notification for intellisense performance metrics try
ServiceHost.SendEvent(TelemetryNotification.Type, new TelemetryParams()
{ {
Params = new TelemetryProperties // Send a telemetry notification for intellisense performance metrics
ServiceHost.SendEvent(TelemetryNotification.Type, new TelemetryParams()
{ {
Properties = new Dictionary<string, string> Params = new TelemetryProperties
{ {
{ "IsAzure", info.IsAzure ? "1" : "0" } Properties = new Dictionary<string, string>
}, {
EventName = TelemetryEventNames.IntellisenseQuantile, { "IsAzure", info.IsAzure ? "1" : "0" }
Measures = info.IntellisenseMetrics.Quantile },
} EventName = TelemetryEventNames.IntellisenseQuantile,
}); Measures = info.IntellisenseMetrics.Quantile
}
});
}
catch (Exception ex)
{
Logger.Write(LogLevel.Verbose, "Could not send Connection telemetry event " + ex.ToString());
}
} }
// Close the connection // Close the connection