Class AgentChecker


  • public class AgentChecker
    extends java.lang.Object
    Checker to ensure agent is available and ready to report data
    • Constructor Summary

      Constructors 
      Constructor Description
      AgentChecker()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isAgentAvailable()
      Returns whether the java agent is available via -javaagent.
      static boolean waitUntilAgentReady​(long timeout, java.util.concurrent.TimeUnit unit)
      Blocks until agent is ready (established connection with data collector) or timeout expired.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • REQUIRED_AGENT_VERSION

        public static final java.lang.String REQUIRED_AGENT_VERSION
        See Also:
        Constant Field Values
    • Constructor Detail

      • AgentChecker

        public AgentChecker()
    • Method Detail

      • isAgentAvailable

        public static boolean isAgentAvailable()
        Returns whether the java agent is available via -javaagent. If the agent is not available, api calls will be ignored
        Returns:
      • waitUntilAgentReady

        public static boolean waitUntilAgentReady​(long timeout,
                                                  java.util.concurrent.TimeUnit unit)
        Blocks until agent is ready (established connection with data collector) or timeout expired. Take note that if an agent is not ready, traces and metrics collected will not be processed. Call this method to ensure agent is ready before reporting traces for one-off batch jobs
        Parameters:
        timeout -
        unit -
        Returns:
        whether the agent is ready