Class NoOpTracedMethod

  • All Implemented Interfaces:
    TracedMethod, com.newrelic.api.agent.AttributeHolder, com.newrelic.api.agent.TracedMethod

    public final class NoOpTracedMethod
    extends java.lang.Object
    implements TracedMethod
    • Method Detail

      • setMetricName

        public void setMetricName​(java.lang.String... metricNameParts)
        Specified by:
        setMetricName in interface com.newrelic.api.agent.TracedMethod
      • nameTransaction

        public void nameTransaction​(TransactionNamePriority namePriority)
        Description copied from interface: TracedMethod
        Names the current transaction using this traced method. This is called by code injected as a result of xml instrumentation. This probably shouldn't be invoked directly.
        Specified by:
        nameTransaction in interface TracedMethod
        Parameters:
        namePriority - The priority to be given to the naming call.
      • getParentTracedMethod

        public TracedMethod getParentTracedMethod()
        Description copied from interface: TracedMethod
        Returns the parent of this traced method, or null if this is the root tracer.
        Specified by:
        getParentTracedMethod in interface TracedMethod
        Returns:
        the parent TracedMethod of the current traced method.
      • addCustomAttribute

        public void addCustomAttribute​(java.lang.String key,
                                       java.lang.Number value)
        Specified by:
        addCustomAttribute in interface com.newrelic.api.agent.AttributeHolder
      • addCustomAttribute

        public void addCustomAttribute​(java.lang.String key,
                                       java.lang.String value)
        Specified by:
        addCustomAttribute in interface com.newrelic.api.agent.AttributeHolder
      • addCustomAttribute

        public void addCustomAttribute​(java.lang.String key,
                                       boolean value)
        Specified by:
        addCustomAttribute in interface com.newrelic.api.agent.AttributeHolder
      • addCustomAttributes

        public void addCustomAttributes​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
        Specified by:
        addCustomAttributes in interface com.newrelic.api.agent.AttributeHolder
      • getMetricName

        public java.lang.String getMetricName()
        Specified by:
        getMetricName in interface com.newrelic.api.agent.TracedMethod
      • addRollupMetricName

        public void addRollupMetricName​(java.lang.String... metricNameParts)
        Specified by:
        addRollupMetricName in interface com.newrelic.api.agent.TracedMethod
      • addExclusiveRollupMetricName

        public void addExclusiveRollupMetricName​(java.lang.String... metricNameParts)
        Description copied from interface: TracedMethod
        Add a rollup metric name that reports the exclusive time for both total and exclusive times. The reason for this is that external and database charts on APM show stacked graphs based on total duration of our rollup metrics, when the intent seems to be to show stacked graphs of exclusive durations. Previous tracer implementations like AbstractExternalComponentTracer called ResponseTimeStats.recordResponseTime( getExclusiveDuration(), TimeUnit.NANOSECONDS), presumably to "enable" this "feature". So this method only exists in the bridge API to replicate the old behavior. More investigation is necessary. Use with care.
        Specified by:
        addExclusiveRollupMetricName in interface TracedMethod
        Parameters:
        metricNameParts - The segments of the metric name. These values will be concatenated together separated by a `/` char.
      • setMetricNameFormatInfo

        public void setMetricNameFormatInfo​(java.lang.String metricName,
                                            java.lang.String transactionSegmentName,
                                            java.lang.String transactionSegmentUri)
        Description copied from interface: TracedMethod
        Sets the traced method metric name, transaction segment name, and transaction segment URI.
        Specified by:
        setMetricNameFormatInfo in interface TracedMethod
      • isMetricProducer

        public boolean isMetricProducer()
        Description copied from interface: TracedMethod
        Returns true if this tracer produces a metric.
        Specified by:
        isMetricProducer in interface TracedMethod
        Returns:
      • setCustomMetricPrefix

        public void setCustomMetricPrefix​(java.lang.String prefix)
        Description copied from interface: TracedMethod
        Set the prefix for the metric name.
        Specified by:
        setCustomMetricPrefix in interface TracedMethod
      • setTrackChildThreads

        public void setTrackChildThreads​(boolean shouldTrack)
        Description copied from interface: TracedMethod
        Tell the tracer to track child async jobs which are submitted under its method call. This only applies to the scala instrumentation at the moment.
        Specified by:
        setTrackChildThreads in interface TracedMethod
      • setTrackCallbackRunnable

        public void setTrackCallbackRunnable​(boolean shouldTrack)
        Description copied from interface: TracedMethod
        Tell the tracer to track child CallbackRunnable jobs which are submitted under its method call. This only applies to the Akka-Http instrumentation at the moment.
        Specified by:
        setTrackCallbackRunnable in interface TracedMethod
      • excludeLeaf

        public void excludeLeaf()
        Description copied from interface: TracedMethod
        Mark a leaf tracer as excluded, similar to how excludeFromTransactionTrace works.
        Specified by:
        excludeLeaf in interface TracedMethod
      • addOutboundRequestHeaders

        public void addOutboundRequestHeaders​(com.newrelic.api.agent.OutboundHeaders outboundHeaders)
        Description copied from interface: TracedMethod
        Do not use. Use TracedMethod.addOutboundRequestHeaders(OutboundHeaders) instead. To be called when performing an outbound external request using HTTP or JMS. This method must be called before any headers are written to the output stream. This method is generally used in conjunction with reportAsExternal.
        Specified by:
        addOutboundRequestHeaders in interface TracedMethod
        Specified by:
        addOutboundRequestHeaders in interface com.newrelic.api.agent.TracedMethod
        Parameters:
        outboundHeaders - The headers that will be written to the output stream for the external request. This also determines if the external call is HTTP or JMS.
      • readInboundResponseHeaders

        public void readInboundResponseHeaders​(com.newrelic.api.agent.InboundHeaders inboundResponseHeaders)
        Description copied from interface: TracedMethod
        Do not use. There is no direct replacement. Use the public cross application tracing API if possible or use the bridge method Transaction.provideHeaders(InboundHeaders) if necessary.
        Specified by:
        readInboundResponseHeaders in interface TracedMethod
        Parameters:
        inboundResponseHeaders - do not use.
      • reportAsExternal

        public void reportAsExternal​(com.newrelic.api.agent.ExternalParameters externalParameters)
        Specified by:
        reportAsExternal in interface com.newrelic.api.agent.TracedMethod
      • reportAsExternal

        public void reportAsExternal​(ExternalParameters externalParameters)
        Specified by:
        reportAsExternal in interface TracedMethod
        Parameters:
        externalParameters - The appropriate input parameters depending on the type external. Use the com.newrelic.api.agent.ExternalParametersFactory to create input parameters. For example, com.newrelic.api.agent.ExternalParametersFactory's createForDatastore to report this TracedMethod as a datastore.