Skip to content

Commit 73a63b5

Browse files
Add attachments to telemetry (#2025)
Co-authored-by: Chris Mullins <[email protected]>
1 parent a21e186 commit 73a63b5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Diff for: libraries/botbuilder-core/src/telemetryConstants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ export class TelemetryConstants {
1515
public readonly textProperty: string = 'text';
1616
public readonly speakProperty: string = 'speak';
1717
public readonly userIdProperty: string = 'userId';
18+
public readonly attachmentsProperty: string = 'attachments';
1819
}

Diff for: libraries/botbuilder-core/src/telemetryLoggerMiddleware.ts

+4
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ export class TelemetryLoggerMiddleware implements Middleware {
247247
if (activity.speak && activity.speak.trim()) {
248248
properties[this.telemetryConstants.speakProperty] = activity.speak;
249249
}
250+
251+
if (activity.attachments && activity.attachments.length > 0) {
252+
properties[this.telemetryConstants.attachmentsProperty] = JSON.stringify(activity.attachments);
253+
}
250254
}
251255

252256
// Additional Properties can override "stock" properties.

0 commit comments

Comments
 (0)