com.newrelic.api.agent

Interface Segment

    • Method Detail

      • setMetricName

        void setMetricName(java.lang.String... metricNameParts)
        Sets the metric name by concatenating all given metricNameParts with a '/' separating each part.
        Parameters:
        metricNameParts - The segments of the metric name. These values will be concatenated together separated by a `/` char.
        Since:
        3.37.0
      • reportAsExternal

        void reportAsExternal(ExternalParameters externalParameters)
        Reports this traced method as an HTTP external call, datastore external call, or generic external call. Use ExternalParameters to create the externalParameters argument. If you are performing an external HTTP call, be sure to call addOutboundRequestHeaders(OutboundHeaders) prior to the request being sent.
        Parameters:
        externalParameters - The appropriate input parameters depending on the type of external call. See available Builders in ExternalParameters for more information.
        Since:
        3.37.0
      • addOutboundRequestHeaders

        void addOutboundRequestHeaders(OutboundHeaders outboundHeaders)
        Adds headers to the external request so that the request can be recognized on the receiving end. 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.
        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.37.0
      • ignore

        void ignore()
        Stops tracking the Segment and does not report it as part of its parent transaction. This method has no effect if the segment has ended. Every Segment instance must be completed by a call to ignore() or to end().
        Since:
        3.37.0
      • end

        void end()
        Stops timing the Segment. Only the first call to this method will have an effect. Every Segment instance must be completed by a call to ignore() or to end().
        Since:
        3.37.0