Class TraceTaskExecutionListener

java.lang.Object
org.springframework.cloud.sleuth.instrument.task.TraceTaskExecutionListener
All Implemented Interfaces:
org.springframework.cloud.task.listener.TaskExecutionListener, org.springframework.core.Ordered

public class TraceTaskExecutionListener extends Object implements org.springframework.cloud.task.listener.TaskExecutionListener, org.springframework.core.Ordered
Sets the span upon starting and closes it upon ending a task.
Since:
3.1.0
Author:
Marcin Grzejszczak
  • Constructor Details

    • TraceTaskExecutionListener

      public TraceTaskExecutionListener(Tracer tracer, String projectName)
  • Method Details

    • onTaskStartup

      public void onTaskStartup(org.springframework.cloud.task.repository.TaskExecution taskExecution)
      Specified by:
      onTaskStartup in interface org.springframework.cloud.task.listener.TaskExecutionListener
    • onTaskEnd

      public void onTaskEnd(org.springframework.cloud.task.repository.TaskExecution taskExecution)
      Specified by:
      onTaskEnd in interface org.springframework.cloud.task.listener.TaskExecutionListener
    • onTaskFailed

      public void onTaskFailed(org.springframework.cloud.task.repository.TaskExecution taskExecution, Throwable throwable)
      Specified by:
      onTaskFailed in interface org.springframework.cloud.task.listener.TaskExecutionListener
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered