Class NoOpInstrumentation

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int addToObjectCache​(java.lang.Object object)  
      ExitTracer createScalaTxnTracer()  
      ExitTracer createSqlTracer​(java.lang.Object invocationTarget, int signatureId, java.lang.String metricName, int flags)
      Create a sql tracer.
      ExitTracer createTracer​(java.lang.Object invocationTarget, int signatureId, boolean dispatcher, java.lang.String metricName, java.lang.String tracerFactoryName, java.lang.Object[] args)
      Create a tracer.
      ExitTracer createTracer​(java.lang.Object invocationTarget, int signatureId, java.lang.String metricName, int flags)
      Create a tracer.
      java.lang.Object getCachedObject​(int id)  
      Transaction getTransaction()
      Returns the current transaction.
      Transaction getTransactionOrNull()
      Returns the current transaction.
      void instrument()
      Trace with transaction activity enabled (async=true) the first non-New Relic stack element on the current stack.
      void instrument​(java.lang.reflect.Method methodToInstrument, java.lang.String metricPrefix)
      Add instrumentation for a given method of a given class only if no @InstrumentedMethod annotation is present.
      void instrument​(java.lang.String className, java.lang.String metricPrefix)
      Adds instrumentation for all methods of a given class, but does not call retransform.
      java.lang.Class<?> loadClass​(java.lang.ClassLoader classLoader, java.lang.Class<?> theClass)  
      void noticeInstrumentationError​(java.lang.Throwable throwable, java.lang.String libraryName)
      Log an instrumentation error.
      void registerCloseable​(java.lang.String string, java.io.Closeable closeable)  
      void retransformUninstrumentedClass​(java.lang.Class<?> classToRetransform)
      Re-transform a class if it hasn't already been instrumented (Annotated with @InstrumentedClass).
      • Methods inherited from class java.lang.Object

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

      • NoOpInstrumentation

        public NoOpInstrumentation()
    • Method Detail

      • createTracer

        public ExitTracer createTracer​(java.lang.Object invocationTarget,
                                       int signatureId,
                                       java.lang.String metricName,
                                       int flags)
        Description copied from interface: Instrumentation
        Create a tracer. A call to this method is injected into methods that are traced with weaved implementations, trace annotations and custom xml.
        Specified by:
        createTracer in interface Instrumentation
        Parameters:
        invocationTarget - The instance of the object owning the method being invoked, or null for a static method.
        signatureId - The index of the ClassMethodSignature in the ClassMethodSignatures cache.
        Returns:
        the Tracer on which to call finish()
      • noticeInstrumentationError

        public void noticeInstrumentationError​(java.lang.Throwable throwable,
                                               java.lang.String libraryName)
        Description copied from interface: Instrumentation
        Log an instrumentation error.
        Specified by:
        noticeInstrumentationError in interface Instrumentation
      • instrument

        public void instrument​(java.lang.String className,
                               java.lang.String metricPrefix)
        Description copied from interface: Instrumentation
        Adds instrumentation for all methods of a given class, but does not call retransform.
        Specified by:
        instrument in interface Instrumentation
        Parameters:
        className - - exact class name to instrument all methods.
      • instrument

        public void instrument​(java.lang.reflect.Method methodToInstrument,
                               java.lang.String metricPrefix)
        Description copied from interface: Instrumentation
        Add instrumentation for a given method of a given class only if no @InstrumentedMethod annotation is present. Does not instrument native, abstract, or interface methods. Calls retransform if necessary.
        Specified by:
        instrument in interface Instrumentation
        Parameters:
        methodToInstrument - - exact method name along with its associated declared class to instrument.
      • instrument

        public void instrument()
        Description copied from interface: Instrumentation
        Trace with transaction activity enabled (async=true) the first non-New Relic stack element on the current stack. Often customers will call APIs like Token.link(), which need to be called within a transaction, without having instrumented code to start a transaction. We can detect that case and instrument the calling method. This will be rate limited to reduce the overhead, controlled by the config class_transformer:auto_async_link_rate_limit
        Specified by:
        instrument in interface Instrumentation
      • retransformUninstrumentedClass

        public void retransformUninstrumentedClass​(java.lang.Class<?> classToRetransform)
        Description copied from interface: Instrumentation
        Re-transform a class if it hasn't already been instrumented (Annotated with @InstrumentedClass). Classes that have instrumentation added or removed will not be affected.
        Specified by:
        retransformUninstrumentedClass in interface Instrumentation
      • loadClass

        public java.lang.Class<?> loadClass​(java.lang.ClassLoader classLoader,
                                            java.lang.Class<?> theClass)
                                     throws java.lang.ClassNotFoundException
        Specified by:
        loadClass in interface Instrumentation
        Throws:
        java.lang.ClassNotFoundException
      • registerCloseable

        public void registerCloseable​(java.lang.String string,
                                      java.io.Closeable closeable)
        Specified by:
        registerCloseable in interface Instrumentation
      • createTracer

        public ExitTracer createTracer​(java.lang.Object invocationTarget,
                                       int signatureId,
                                       boolean dispatcher,
                                       java.lang.String metricName,
                                       java.lang.String tracerFactoryName,
                                       java.lang.Object[] args)
        Description copied from interface: Instrumentation
        Create a tracer. A call to this method is injected into methods that are traced because of yaml configuration.
        Specified by:
        createTracer in interface Instrumentation
        Parameters:
        invocationTarget - The instance of the object owning the method being invoked, or null for a static method.
        signatureId - The index of the ClassMethodSignature in the ClassMethodSignatures cache.
        dispatcher - If true, this should be treated as the start of a transaction if a transaction is not already in progress.
        args - The arguments passed in the method invocation.
        Returns:
        the Tracer on which to call finish()
      • createSqlTracer

        public ExitTracer createSqlTracer​(java.lang.Object invocationTarget,
                                          int signatureId,
                                          java.lang.String metricName,
                                          int flags)
        Description copied from interface: Instrumentation
        Create a sql tracer. A call to this method is injected into methods that are traced with weaved implementations, trace annotations and custom xml where the com.newrelic.agent.bridge.datastore.DatastoreMetrics#noticeSql(ConnectionFactory, String, Object[]) method is used. The sql tracer properly handles queueing up and managing explain plans for slow sql.
        Specified by:
        createSqlTracer in interface Instrumentation
        Parameters:
        invocationTarget - The instance of the object owning the method being invoked, or null for a static method.
        signatureId - The index of the ClassMethodSignature in the ClassMethodSignatures cache.
        Returns:
        the Tracer on which to call finish()