Skip to content

Commit fdbcfb6

Browse files
committed
Took care of review comments
1 parent 41fd1c7 commit fdbcfb6

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

src/Common/Commands.Common/MetricHelper.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,15 @@ private void LogExceptionEvent(AzurePSQoSEvent qos)
226226
eventProperties.Add("Message", "Message removed due to PII.");
227227
eventProperties.Add("StackTrace", qos.Exception.StackTrace);
228228
eventProperties.Add("ExceptionType", qos.Exception.GetType().ToString());
229-
if (qos.Exception.InnerException != null)
229+
Exception innerEx = qos.Exception.InnerException;
230+
int exceptionCount = 0;
231+
//keep goin till we get to the last inner exception
232+
while (innerEx != null)
230233
{
231-
eventProperties.Add("InnerExceptionType", qos.Exception.InnerException.GetType().ToString());
234+
//Increment the inner exception count so that we can tell which is the outermmost
235+
//n which the innermost
236+
eventProperties.Add("InnerExceptionType-"+exceptionCount++, innerEx.GetType().ToString());
237+
innerEx = innerEx.InnerException;
232238
}
233239
client.TrackException(null, eventProperties, eventMetrics);
234240
}
@@ -271,10 +277,7 @@ private void PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary<string,
271277
eventProperties.Add("PowerShellVersion", PSVersion);
272278
eventProperties.Add("Version", AzurePowerShell.AssemblyVersion);
273279
eventProperties.Add("CommandParameterSetName", qos.ParameterSetName);
274-
if (!string.IsNullOrWhiteSpace(qos.InvocationName))
275-
{
276-
eventProperties.Add("CommandInvocationName", qos.InvocationName);
277-
}
280+
eventProperties.Add("CommandInvocationName", qos.InvocationName);
278281

279282
if (qos.InputFromPipeline != null)
280283
{

src/ResourceManager/Common/Commands.ResourceManager.Common/AzureRMCmdlet.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ protected override void InitializeQosEvent()
204204
ClientRequestId = this._clientRequestId,
205205
SessionId = _sessionId,
206206
IsSuccess = true,
207-
};
207+
ParameterSetName = this.ParameterSetName
208+
};
208209

209210
if (this.MyInvocation != null && !string.IsNullOrWhiteSpace(this.MyInvocation.InvocationName))
210211
{
@@ -219,11 +220,6 @@ protected override void InitializeQosEvent()
219220
s => string.Format(CultureInfo.InvariantCulture, "-{0} ***", s)));
220221
}
221222

222-
if (!string.IsNullOrWhiteSpace(this.ParameterSetName))
223-
{
224-
_qosEvent.ParameterSetName = this.ParameterSetName;
225-
}
226-
227223
IAzureContext context;
228224
if (TryGetDefaultContext(out context)
229225
&& context.Account != null

src/ResourceManager/Profile/ChangeLog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21-
21+
* Added the following three values to the telemetry :
22+
- Inner exception types
23+
- ParameterSetName
24+
- InvocationName
25+
2226
## Version 5.1.0
2327
* Fix issue where running `Clear-AzureRmContext` would keep an empty context with the name of the previous default context, which prevented the user from creating a new context with the old name
2428

0 commit comments

Comments
 (0)