Class RequestTracingService

  • All Implemented Interfaces:
    fish.payara.monitoring.collect.MonitoringDataSource, fish.payara.monitoring.collect.MonitoringWatchSource, EventListener, ConfigListener

    @Service(name="requesttracing-service")
    @RunLevel(10)
    public class RequestTracingService
    extends Object
    implements EventListener, ConfigListener, fish.payara.monitoring.collect.MonitoringDataSource, fish.payara.monitoring.collect.MonitoringWatchSource
    Main service class that provides methods used by interceptors for tracing requests.
    Since:
    4.1.1.163
    Author:
    mertcaliskan
    • Constructor Detail

      • RequestTracingService

        public RequestTracingService()
    • Method Detail

      • bootstrapRequestTracingService

        public void bootstrapRequestTracingService()
        Starts the request tracing service
        Since:
        4.1.1.171
      • bootstrapNotifierList

        public void bootstrapNotifierList()
        Configures notifiers with request tracing and starts any enabled ones. If no options are set then the log notifier is automatically turned on.
        Since:
        4.1.2.173
      • getConversationID

        public UUID getConversationID()
        Retrieves the current Conversation ID
        Returns:
      • getStartingTraceID

        public UUID getStartingTraceID()
      • setTraceId

        public void setTraceId​(UUID newID)
        Reset the conversation ID This is especially useful for trace propagation across threads when the event tracer can receive the conversation ID propagated to it
        Parameters:
        newID -
      • isTraceInProgress

        public boolean isTraceInProgress()
        Returns true if a trace has started and not yet completed. NOTE: This only applies to traces started using the request tracing service; traces started using OpenTracing *MAY* not be picked up by this (for example, if you're using the OpenTracing MockTracer instead of the in-built one).
        Returns:
      • startTrace

        public RequestTraceSpan startTrace​(String traceName)
        Starts a new request trace
        Returns:
        a unique identifier for the request trace
      • traceSpan

        public void traceSpan​(RequestTraceSpan requestEvent)
        Adds a new event to the request trace currently in progress
        Parameters:
        requestEvent -
      • traceSpan

        public void traceSpan​(RequestTraceSpan requestEvent,
                              long timestampMillis)
      • shouldStartTrace

        public boolean shouldStartTrace()
      • endTrace

        public void endTrace()
      • endTrace

        public void endTrace​(long timestampMillis)
      • getThresholdValueInNanos

        public Long getThresholdValueInNanos()
        Returns:
        Since:
        4.1.1.164
      • isRequestTracingEnabled

        public boolean isRequestTracingEnabled()
      • changed

        public UnprocessedChangeEvents changed​(PropertyChangeEvent[] events)
        Description copied from interface: ConfigListener
        Notification that @Configured objects that were injected have changed
        Specified by:
        changed in interface ConfigListener
        Parameters:
        events - list of changes
        Returns:
        the list of unprocessed events (requiring a restart) or null if all reconfiguration was processed successfully
      • getHistoricRequestTraceStore

        public RequestTraceStoreInterface getHistoricRequestTraceStore()
        Returns the RequestTraceStore used for storing historical traces
        Returns:
      • getRequestTraceStore

        public RequestTraceStoreInterface getRequestTraceStore()
        Returns the RequestTraceStore used for storing traces
        Returns:
      • collect

        public void collect​(fish.payara.monitoring.collect.MonitoringWatchCollector collector)
        Specified by:
        collect in interface fish.payara.monitoring.collect.MonitoringWatchSource
      • collect

        public void collect​(fish.payara.monitoring.collect.MonitoringDataCollector collector)
        Specified by:
        collect in interface fish.payara.monitoring.collect.MonitoringDataSource
      • stripPackageName

        public static String stripPackageName​(String eventName)