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
1 change: 1 addition & 0 deletions libraries/Microsoft.Bot.Builder/TelemetryConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ public static class TelemetryConstants
public static readonly string TextProperty = "text";
public static readonly string SpeakProperty = "speak";
public static readonly string UserIdProperty = "userId";
public static readonly string AttachmentsProperty = "attachments";
}
}
6 changes: 6 additions & 0 deletions libraries/Microsoft.Bot.Builder/TelemetryLoggerMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Threading.Tasks;
using Microsoft.Bot.Schema;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace Microsoft.Bot.Builder
{
Expand Down Expand Up @@ -265,6 +266,11 @@ protected Task<Dictionary<string, string>> FillSendEventPropertiesAsync(Activity
{
properties.Add(TelemetryConstants.SpeakProperty, activity.Speak);
}

if (activity.Attachments != null && activity.Attachments.Any())
{
properties.Add(TelemetryConstants.AttachmentsProperty, JsonConvert.SerializeObject(activity.Attachments));
}
}

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