Skip to content

Commit aeeeeed

Browse files
add for VisualStudio
Signed-off-by: nkomonen-amazon <[email protected]>
1 parent 0802713 commit aeeeeed

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

telemetry/csharp/AwsToolkit.Telemetry.Events.Generator.Core/DefinitionsBuilder.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

telemetry/csharp/AwsToolkit.Telemetry.Events/Core/BaseTelemetryEvent.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)