Skip to content

Commit 55ec228

Browse files
committed
docs(ai-chat): drop the unbounded chatId metric tag from the watchdog example
1 parent 259fb01 commit 55ec228

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

docs/ai-chat/frontend.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,9 @@ const pending = new Map<string, ReturnType<typeof setTimeout>>();
605605
onEvent: (event) => {
606606
if (event.type === "message-sent" && event.source === "submit-message") {
607607
pending.set(event.chatId, setTimeout(() => {
608-
metrics.increment("chat.sent_but_unanswered", { chatId: event.chatId });
608+
// Log the chatId; don't tag the metric with it (unbounded cardinality).
609+
metrics.increment("chat.sent_but_unanswered");
610+
console.warn("sent but unanswered", event.chatId);
609611
}, 30_000));
610612
}
611613
if (event.type === "first-chunk" || event.type === "turn-completed" || event.type === "stream-error") {

0 commit comments

Comments
 (0)