Skip to content

Commit 41fd1c7

Browse files
committed
Add invocation name to the telemetry
1 parent 8b61bc8 commit 41fd1c7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Common/Commands.Common/MetricHelper.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ private void PopulatePropertiesFromQos(AzurePSQoSEvent qos, IDictionary<string,
271271
eventProperties.Add("PowerShellVersion", PSVersion);
272272
eventProperties.Add("Version", AzurePowerShell.AssemblyVersion);
273273
eventProperties.Add("CommandParameterSetName", qos.ParameterSetName);
274+
if (!string.IsNullOrWhiteSpace(qos.InvocationName))
275+
{
276+
eventProperties.Add("CommandInvocationName", qos.InvocationName);
277+
}
278+
274279
if (qos.InputFromPipeline != null)
275280
{
276281
eventProperties.Add("InputFromPipeline", qos.InputFromPipeline.Value.ToString());
@@ -377,6 +382,7 @@ public class AzurePSQoSEvent
377382
public string ClientRequestId { get; set; }
378383
public string SessionId { get; set; }
379384
public string ParameterSetName { get; set; }
385+
public string InvocationName { get; set; }
380386
public Dictionary<string, string> CustomProperties { get; private set; }
381387

382388
public AzurePSQoSEvent()

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ protected override void InitializeQosEvent()
206206
IsSuccess = true,
207207
};
208208

209+
if (this.MyInvocation != null && !string.IsNullOrWhiteSpace(this.MyInvocation.InvocationName))
210+
{
211+
_qosEvent.InvocationName = this.MyInvocation.InvocationName;
212+
}
213+
209214
if (this.MyInvocation != null && this.MyInvocation.BoundParameters != null
210215
&& this.MyInvocation.BoundParameters.Keys != null)
211216
{

0 commit comments

Comments
 (0)