How can Java EE traces be initiated from command line
You can use a Groovy script to collect single traces. In Groovy, request types are specified by a regular expression, so the same set of single trace criteria can be used for a group of request types.
When you have a group of request types for which you want to collect single traces using the same criteria, you set the criteria using a Groovy script called from the command line (for example, using fglcmd). The collected single traces are stored on the Foglight Management Server, and displayed in the Custom Applications Monitor Requests tab for users to review. Use the following function to trigger the collection of requested traces.
JEECollectTraces Function
This function is used to collect traces in Groovy. Set all of the following arguments:
Request type for which to collect a trace defined as regular expression (true/false). | |
Collect in Full Detail (true/false). For details about instrumentation levels, see “Configuring Instrumentation” in the Managing Java EE Systems: Installation and Configuration Guide. | |
Criteria are specified as a list of one or more strings.
Criteria are in milliseconds.
For example:
// Collect 5 traces in full detail for request "GET /samples/test.do" for 15 minutes
// only if response time is over 1 minute for the agent where name contains adtomcat
topSvc = server.get("QueryService");
// appServer is the server topology object
appServer = topSvc.queryTopologyObjects("TomcatServer where name like '%adtomcat%'");
def agentNameIDs = [];
agentNameIDs.add(appServer.monitoringAgent.agentNameID);
def criteria = [];
criteria.add("responseTimeOver:60000");
JEECollectTraces("GET /samples/test.do", false, 900, 5, false,false,false, criteria, agentNameIDs);
© 2021 Quest Software Inc. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy