fix: match SET_TRACED_PROCESSORS payload to agent protocol
Payload now sends {processors: {id: "BOTH"}} map instead of
{routeId, processorIds[]} array. Tracing state keyed by application
name (global, not per-route) matching agent behavior.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -164,26 +164,26 @@ export default function ExchangeDetail() {
|
||||
const { toast } = useToast()
|
||||
const tracingStore = useTracingStore()
|
||||
const sendCommand = useSendGroupCommand()
|
||||
const appRoute = detail ? `${detail.applicationName}:${detail.routeId}` : ''
|
||||
const app = detail?.applicationName ?? ''
|
||||
|
||||
const handleToggleTracing = useCallback((processorId: string) => {
|
||||
if (!processorId || !detail?.applicationName || !detail?.routeId) return
|
||||
const newSet = tracingStore.toggleProcessor(appRoute, processorId)
|
||||
if (!processorId || !detail?.applicationName) return
|
||||
const newMap = tracingStore.toggleProcessor(app, processorId)
|
||||
sendCommand.mutate({
|
||||
group: detail.applicationName,
|
||||
type: 'set-traced-processors',
|
||||
payload: { routeId: detail.routeId, processorIds: Array.from(newSet) },
|
||||
payload: { processors: newMap },
|
||||
}, {
|
||||
onSuccess: (data) => {
|
||||
const action = newSet.has(processorId) ? 'enabled' : 'disabled'
|
||||
const action = processorId in newMap ? 'enabled' : 'disabled'
|
||||
toast({ title: `Tracing ${action}`, description: `${processorId} — sent to ${data?.targetCount ?? 0} agent(s)`, variant: 'success' })
|
||||
},
|
||||
onError: () => {
|
||||
tracingStore.toggleProcessor(appRoute, processorId)
|
||||
tracingStore.toggleProcessor(app, processorId)
|
||||
toast({ title: 'Command failed', description: 'Could not send tracing command', variant: 'error' })
|
||||
},
|
||||
})
|
||||
}, [detail, appRoute, tracingStore, sendCommand, toast])
|
||||
}, [detail, app, tracingStore, sendCommand, toast])
|
||||
|
||||
// Correlation chain
|
||||
const correlatedExchanges = useMemo(() => {
|
||||
@@ -346,7 +346,7 @@ export default function ExchangeDetail() {
|
||||
const pid = processorIds[index]
|
||||
if (!pid || !detail?.applicationName) return []
|
||||
return [{
|
||||
label: tracingStore.isTraced(appRoute, pid) ? 'Disable Tracing' : 'Enable Tracing',
|
||||
label: tracingStore.isTraced(app, pid) ? 'Disable Tracing' : 'Enable Tracing',
|
||||
onClick: () => handleToggleTracing(pid),
|
||||
disabled: sendCommand.isPending,
|
||||
}]
|
||||
@@ -365,7 +365,7 @@ export default function ExchangeDetail() {
|
||||
const pid = flowProcessorIds[index]
|
||||
if (!pid || !detail?.applicationName) return []
|
||||
return [{
|
||||
label: tracingStore.isTraced(appRoute, pid) ? 'Disable Tracing' : 'Enable Tracing',
|
||||
label: tracingStore.isTraced(app, pid) ? 'Disable Tracing' : 'Enable Tracing',
|
||||
onClick: () => handleToggleTracing(pid),
|
||||
disabled: sendCommand.isPending,
|
||||
}]
|
||||
|
||||
Reference in New Issue
Block a user