File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
AwsToolkit.Telemetry.Events.Generator.Core
AwsToolkit.Telemetry.Events/Core Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ public class DefinitionsBuilder
2727 {
2828 "reason" ,
2929 "reasonDesc" ,
30+ "source" ,
3031 "errorCode" ,
3132 "causedBy" ,
3233 "httpStatusCode" ,
@@ -440,6 +441,11 @@ private CodeMemberMethod CreateRecordMetricMethodByDataClass(Metric metric)
440441 tryStatements . Add ( new CodeExpressionStatement ( new CodeMethodInvokeExpression ( datumAddData ,
441442 new CodePrimitiveExpression ( "reasonDesc" ) , payloadReasonDescription ) ) ) ;
442443
444+ // Generate: datum.AddMetadata("source", payload.Source);
445+ var payloadSource = new CodeFieldReferenceExpression ( payload , "Source" ) ;
446+ tryStatements . Add ( new CodeExpressionStatement ( new CodeMethodInvokeExpression ( datumAddData ,
447+ new CodePrimitiveExpression ( "source" ) , payloadSource ) ) ) ;
448+
443449 // Generate: datum.AddMetadata("errorCode", payload.ErrorCode);
444450 var payloadErrorCode = new CodeFieldReferenceExpression ( payload , "ErrorCode" ) ;
445451 tryStatements . Add ( new CodeExpressionStatement ( new CodeMethodInvokeExpression ( datumAddData ,
Original file line number Diff line number Diff line change @@ -38,6 +38,13 @@ public abstract class BaseTelemetryEvent
3838 /// </summary>
3939 public string ReasonDescription ;
4040
41+ /// <summary>
42+ /// The source of the operation. This answers 'who' caused/triggered the operation.
43+ /// Example: did an Auth signout happen because of some expiration or since the user
44+ /// explicitly clicked the signout button.
45+ /// </summary>
46+ public string Source ;
47+
4148 /// <summary>
4249 /// Optional - User-friendly error codes describing a failed operation
4350 /// This is often used in failure scenarios to provide additional details about why something failed.
You can’t perform that action at this time.
0 commit comments