From 4dc8e671e1107f0fd4e3cd378ed4a5ae258546cf Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Fri, 19 Apr 2024 17:48:07 -0400 Subject: [PATCH] fix(jmcagent): correct probe insert/remove notification contents --- src/main/java/io/cryostat/jmcagent/JMCAgent.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/cryostat/jmcagent/JMCAgent.java b/src/main/java/io/cryostat/jmcagent/JMCAgent.java index 0a798afb2..82cbc653c 100644 --- a/src/main/java/io/cryostat/jmcagent/JMCAgent.java +++ b/src/main/java/io/cryostat/jmcagent/JMCAgent.java @@ -83,7 +83,13 @@ public Response postProbe(@RestPath long id, @RestPath String probeTemplateName) MessagingServer.class.getName(), new Notification( TEMPLATE_APPLIED_CATEGORY, - Map.of("probeTemplate", template.getFileName()))); + Map.of( + "jvmId", + target.jvmId, + "events", + template.getEvents(), + "probeTemplate", + template.getFileName()))); return Response.status(RestResponse.Status.OK).build(); } catch (ProbeDefinitionException e) { // Cleanup the probes if something went wrong, calling defineEventProbes @@ -125,13 +131,13 @@ public Response deleteProbe(@RestPath long id) { try { AgentJMXHelper helper = new AgentJMXHelper(connection.getHandle()); // The convention for removing probes in the agent controller mbean is - // to - // call defineEventProbes with a null argument. + // to call defineEventProbes with a null argument. helper.defineEventProbes(null); bus.publish( MessagingServer.class.getName(), new Notification( - PROBES_REMOVED_CATEGORY, Map.of("target", target.id))); + PROBES_REMOVED_CATEGORY, + Map.of("jvmId", target.jvmId))); return Response.status(RestResponse.Status.OK).build(); } catch (Exception e) { return Response.status(RestResponse.Status.INTERNAL_SERVER_ERROR)