Skip to content

Commit

Permalink
fix(jmcagent): correct probe insert/remove notification contents
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Apr 19, 2024
1 parent a1e941f commit 4dc8e67
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/java/io/cryostat/jmcagent/JMCAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4dc8e67

Please sign in to comment.