Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libraries/Microsoft.Bot.Builder/TelemetryConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,10 @@ public static class TelemetryConstants
/// The telemetry property value for activity type.
/// </summary>
public static readonly string ActivityTypeProperty = "type";

/// <summary>
/// The telemetry property value for activity id.
/// </summary>
public static readonly string ActivityIdProperty = "activityId";
}
}
6 changes: 6 additions & 0 deletions libraries/Microsoft.Bot.Builder/TelemetryLoggerMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ protected Task<Dictionary<string, string>> FillReceiveEventPropertiesAsync(Activ
{ TelemetryConstants.RecipientIdProperty, activity.Recipient?.Id },
{ TelemetryConstants.RecipientNameProperty, activity.Recipient?.Name },
{ TelemetryConstants.ActivityTypeProperty, activity.Type },
{ TelemetryConstants.ConversationIdProperty, activity.Conversation?.Id },
{ TelemetryConstants.ActivityIdProperty, activity.Id },
};

// Use the LogPersonalInformation flag to toggle logging PII data, text and user name are common examples
Expand Down Expand Up @@ -262,6 +264,8 @@ protected Task<Dictionary<string, string>> FillSendEventPropertiesAsync(Activity
{ TelemetryConstants.ConversationNameProperty, activity.Conversation?.Name },
{ TelemetryConstants.LocaleProperty, activity.Locale },
{ TelemetryConstants.ActivityTypeProperty, activity.Type },
{ TelemetryConstants.ConversationIdProperty, activity.Conversation?.Id },
{ TelemetryConstants.ActivityIdProperty, activity.Id },
};

// Use the LogPersonalInformation flag to toggle logging PII data, text and user name are common examples
Expand Down Expand Up @@ -320,6 +324,7 @@ protected Task<Dictionary<string, string>> FillUpdateEventPropertiesAsync(Activi
{ TelemetryConstants.ConversationNameProperty, activity.Conversation?.Name },
{ TelemetryConstants.LocaleProperty, activity.Locale },
{ TelemetryConstants.ActivityTypeProperty, activity.Type },
{ TelemetryConstants.ActivityIdProperty, activity.Id },
};

// Use the LogPersonalInformation flag to toggle logging PII data, text is a common example
Expand Down Expand Up @@ -360,6 +365,7 @@ protected Task<Dictionary<string, string>> FillDeleteEventPropertiesAsync(IMessa
{ TelemetryConstants.ConversationIdProperty, activity.Conversation?.Id },
{ TelemetryConstants.ConversationNameProperty, activity.Conversation?.Name },
{ TelemetryConstants.ActivityTypeProperty, activity.Type },
{ TelemetryConstants.ActivityIdProperty, activity.Id },
};

// Additional Properties can override "stock" properties.
Expand Down
Loading