Class TaskMetrics

java.lang.Object
org.springframework.cloud.task.listener.TaskMetrics

public class TaskMetrics extends Object
Utility class for publishing Spring Cloud Task specific metrics via Micrometer. Intended for internal use only.
Since:
2.2
Author:
Christian Tzolov
  • Field Details

    • SPRING_CLOUD_TASK_METER

      public static final String SPRING_CLOUD_TASK_METER
      Task timer measurements. Records information about task duration and status.
      See Also:
    • SPRING_CLOUD_TASK_ACTIVE_METER

      public static final String SPRING_CLOUD_TASK_ACTIVE_METER
      LongTask timer measurement. Records the run-time status of long-time lasting tasks.
      See Also:
    • STATUS_SUCCESS

      public static final String STATUS_SUCCESS
      Successful task execution status indicator.
      See Also:
    • STATUS_FAILURE

      public static final String STATUS_FAILURE
      Failing task execution status indicator.
      See Also:
    • TASK_NAME_TAG

      public static final String TASK_NAME_TAG
      task name measurement tag.
      See Also:
    • TASK_EXECUTION_ID_TAG

      public static final String TASK_EXECUTION_ID_TAG
      task execution id tag.
      See Also:
    • TASK_PARENT_EXECUTION_ID_TAG

      public static final String TASK_PARENT_EXECUTION_ID_TAG
      task parent execution id tag.
      See Also:
    • TASK_EXTERNAL_EXECUTION_ID_TAG

      public static final String TASK_EXTERNAL_EXECUTION_ID_TAG
      task external execution id tag.
      See Also:
    • TASK_EXIT_CODE_TAG

      public static final String TASK_EXIT_CODE_TAG
      task exit code tag.
      See Also:
    • TASK_STATUS_TAG

      public static final String TASK_STATUS_TAG
      task status tag. Can be either STATUS_SUCCESS or STATUS_FAILURE
      See Also:
    • TASK_EXCEPTION_TAG

      public static final String TASK_EXCEPTION_TAG
      task exception tag. Contains the name of the exception class in case of error or none otherwise.
      See Also:
  • Constructor Details

    • TaskMetrics

      public TaskMetrics()
  • Method Details

    • onTaskStartup

      public void onTaskStartup(TaskExecution taskExecution)
    • onTaskFailed

      public void onTaskFailed(Throwable throwable)
    • onTaskEnd

      public void onTaskEnd(TaskExecution taskExecution)