Interface TracedMethod


public interface TracedMethod
Represents a single instance of the timing mechanism associated with a method that is instrumented using the Trace annotation.
See Also:
Agent.getTracedMethod()
  • Method Summary

    Modifier and Type Method Description
    void addCustomAttribute​(java.lang.String key, boolean value)
    Adds/Replaces a boolean attribute on the current traced method.
    void addCustomAttribute​(java.lang.String key, java.lang.Number value)
    Adds/Replaces a numerical attribute on the current traced method.
    void addCustomAttribute​(java.lang.String key, java.lang.String value)
    Adds/Replaces a string attribute on the current traced method.
    void addCustomAttributes​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
    Adds/Replaces key/value pairs on the current traced method.
    void addOutboundRequestHeaders​(OutboundHeaders outboundHeaders)
    To be called when performing an outbound external request using HTTP or JMS.
    void addRollupMetricName​(java.lang.String... metricNameParts)
    Metric names added here will be reported as roll-up metrics.
    java.lang.String getMetricName()
    Returns the traced method metric name.
    void reportAsExternal​(ExternalParameters externalParameters)
    Used to report this traced method as an HTTP external call, datastore external call, or general external call.
    void setMetricName​(java.lang.String... metricNameParts)
    Sets the traced method metric name by concatenating all given metricNameParts with a '/' separating each part.
  • Method Details

    • addCustomAttribute

      void addCustomAttribute​(java.lang.String key, java.lang.Number value)
      Adds/Replaces a numerical attribute on the current traced method.
      Since:
      5.13.0
    • addCustomAttribute

      void addCustomAttribute​(java.lang.String key, java.lang.String value)
      Adds/Replaces a string attribute on the current traced method.
      Since:
      5.13.0
    • addCustomAttribute

      void addCustomAttribute​(java.lang.String key, boolean value)
      Adds/Replaces a boolean attribute on the current traced method.
      Since:
      5.13.0
    • addCustomAttributes

      void addCustomAttributes​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
      Adds/Replaces key/value pairs on the current traced method.
      Since:
      5.13.0
    • getMetricName

      java.lang.String getMetricName()
      Returns the traced method metric name.
      Returns:
      The metric named used for this traced method.
      Since:
      3.9.0
    • setMetricName

      void setMetricName​(java.lang.String... metricNameParts)
      Sets the traced method 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.9.0
    • addRollupMetricName

      void addRollupMetricName​(java.lang.String... metricNameParts)
      Metric names added here will be reported as roll-up metrics. A roll-up metric is an extra unscoped metric (a metric which is not scoped to a specific transaction) that is reported in addition to the normal metric recorded for a traced method. An example of how the agent uses a roll-up metric is the OtherTransaction/all metric. Each background transaction records data to its transaction specific metric and to the OtherTransaction/all roll-up metric which represents all background transactions.
      Parameters:
      metricNameParts - The segments of the rollup metric name. These values will be concatenated together separated by a `/` char.
      Since:
      3.9.0
    • reportAsExternal

      void reportAsExternal​(ExternalParameters externalParameters)
      Used to report this traced method as an HTTP external call, datastore external call, or general external call. Depending on the information available to report, use one of the respective builders for the following objects: GenericParameters, HttpParameters, DatastoreParameters, MessageProduceParameters, MessageConsumeParameters. Note: 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. Use one of the respective builders for the following objects: GenericParameters, HttpParameters, DatastoreParameters, MessageProduceParameters, MessageConsumeParameters.
      Since:
      3.36.0
    • addOutboundRequestHeaders

      void addOutboundRequestHeaders​(OutboundHeaders outboundHeaders)
      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.36.0