Interface TracedMethod

  • All Superinterfaces:
    com.newrelic.api.agent.AttributeHolder, com.newrelic.api.agent.TracedMethod
    All Known Subinterfaces:
    ExitTracer
    All Known Implementing Classes:
    NoOpTracedMethod

    public interface TracedMethod
    extends com.newrelic.api.agent.TracedMethod
    The internal bridge version of TracedMethod.
    • Method Detail

      • getParentTracedMethod

        TracedMethod getParentTracedMethod()
        Returns the parent of this traced method, or null if this is the root tracer.
        Returns:
        the parent TracedMethod of the current traced method.
      • setRollupMetricNames

        void setRollupMetricNames​(java.lang.String... metricNames)
      • setMetricNameFormatInfo

        void setMetricNameFormatInfo​(java.lang.String metricName,
                                     java.lang.String transactionSegmentName,
                                     java.lang.String transactionSegmentUri)
        Sets the traced method metric name, transaction segment name, and transaction segment URI.
      • addExclusiveRollupMetricName

        void addExclusiveRollupMetricName​(java.lang.String... metricNameParts)
        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.
        Parameters:
        metricNameParts - The segments of the metric name. These values will be concatenated together separated by a `/` char.
      • nameTransaction

        void nameTransaction​(TransactionNamePriority namePriority)
        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.
        Parameters:
        namePriority - The priority to be given to the naming call.
      • isMetricProducer

        boolean isMetricProducer()
        Returns true if this tracer produces a metric.
        Returns:
      • setCustomMetricPrefix

        void setCustomMetricPrefix​(java.lang.String prefix)
        Set the prefix for the metric name.
      • setTrackChildThreads

        void setTrackChildThreads​(boolean shouldTrack)
        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.
      • trackChildThreads

        boolean trackChildThreads()
      • setTrackCallbackRunnable

        void setTrackCallbackRunnable​(boolean shouldTrack)
        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.
      • isTrackCallbackRunnable

        boolean isTrackCallbackRunnable()
      • excludeLeaf

        void excludeLeaf()
        Mark a leaf tracer as excluded, similar to how excludeFromTransactionTrace works.
      • addOutboundRequestHeaders

        @Deprecated
        void addOutboundRequestHeaders​(com.newrelic.api.agent.OutboundHeaders outboundHeaders)
        Deprecated.
        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 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.
        Since:
        3.26.0
      • readInboundResponseHeaders

        @Deprecated
        void readInboundResponseHeaders​(com.newrelic.api.agent.InboundHeaders inboundResponseHeaders)
        Deprecated.
        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.
        Parameters:
        inboundResponseHeaders - do not use.
        Since:
        3.26.0
      • reportAsExternal

        @Deprecated
        void reportAsExternal​(ExternalParameters externalParameters)
        Deprecated.
        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.
        Since:
        3.26.0