Interface Agent


  • public interface Agent
    The New Relic Java Agent's API.
    • Method Detail

      • getTracedMethod

        TracedMethod getTracedMethod()
        Returns the current traced method. This can only be invoked within methods that are traced.
        Returns:
        The current method being traced.
        Since:
        3.9.0
        See Also:
        Trace
      • getTransaction

        Transaction getTransaction()
        Returns the current transaction.
        Returns:
        The current transaction.
        Since:
        3.9.0
      • getLogger

        Logger getLogger()
        Returns a logger that logs to the New Relic Java agent log file.
        Returns:
        A log where messages can be written to the New Relic Java agent log file.
        Since:
        3.9.0
      • getConfig

        Config getConfig()
        Returns the agent's configuration.
        Returns:
        The configuration of this Java agent.
        Since:
        3.9.0
      • getMetricAggregator

        MetricAggregator getMetricAggregator()
        Returns a metric aggregator that can be used to record metrics that can be viewed through custom dashboards.
        Returns:
        Aggregator used to record metrics for custom dashboards.
        Since:
        3.9.0
      • getInsights

        Insights getInsights()
        Provides access to the Insights custom events API.
        Returns:
        Object used to add custom events.
        Since:
        3.13.0
      • getAiMonitoring

        AiMonitoring getAiMonitoring()
        Provides access to the AI Monitoring custom events API.
        Returns:
        Object for recording custom events.
      • getCloud

        Cloud getCloud()
        Provides access to the Cloud API.
        Since:
        8.15.0
      • getTraceMetadata

        TraceMetadata getTraceMetadata()
        Provides access to the Trace Metadata API for details about the currently executing distributed trace.
        Returns:
        trace metadata API class
        Since:
        5.6.0
      • getLinkingMetadata

        java.util.Map<java.lang.String,​java.lang.String> getLinkingMetadata()
        Returns an opaque map of key/value pairs that can be used to correlate this application in the New Relic backend.
        Returns:
        an opaque map of correlation key/value pairs
        Since:
        5.6.0