chore: add Sentry breadcrumbs to subgraph proxy widget operations (#8996)

## Summary

Add Sentry breadcrumbs to subgraph proxy widget operations for better
observability of widget state changes.

## Changes

- **What**: Add `Sentry.addBreadcrumb()` calls with category
`'subgraph'` to `promoteWidget`, `demoteWidget`, and `pruneDisconnected`
in `proxyWidgetUtils.ts`

## Review Focus

Breadcrumbs are info-level and don't affect control flow. They log
widget name/node ID for promote/demote and removed count for prune.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8996-chore-add-Sentry-breadcrumbs-to-subgraph-proxy-widget-operations-30d6d73d365081a5abbccabd39fc7129)
by [Unito](https://www.unito.io)
This commit is contained in:
Christian Byrne
2026-03-12 13:51:29 -07:00
committed by GitHub
parent 8f07468fdd
commit 7206dea2d6

View File

@@ -1,3 +1,4 @@
import * as Sentry from '@sentry/vue'
import { isPromotedWidgetView } from '@/core/graph/subgraph/promotedWidgetTypes'
import { t } from '@/i18n'
import type {
@@ -57,6 +58,11 @@ export function promoteWidget(
for (const parent of parents) {
store.promote(parent.rootGraph.id, parent.id, nodeId, widgetName)
}
Sentry.addBreadcrumb({
category: 'subgraph',
message: `Promoted widget "${widgetName}" on node ${node.id}`,
level: 'info'
})
}
export function demoteWidget(
@@ -72,6 +78,11 @@ export function demoteWidget(
for (const parent of parents) {
store.demote(parent.rootGraph.id, parent.id, nodeId, widgetName)
}
Sentry.addBreadcrumb({
category: 'subgraph',
message: `Demoted widget "${widgetName}" on node ${node.id}`,
level: 'info'
})
}
function getParentNodes(): SubgraphNode[] {
@@ -304,4 +315,9 @@ export function pruneDisconnected(subgraphNode: SubgraphNode) {
}
store.setPromotions(subgraphNode.rootGraph.id, subgraphNode.id, validEntries)
Sentry.addBreadcrumb({
category: 'subgraph',
message: `Pruned ${removedEntries.length} disconnected promotion(s) from subgraph node ${subgraphNode.id}`,
level: 'info'
})
}