Class TaskMetrics
java.lang.Object
org.springframework.cloud.task.listener.TaskMetrics
Utility class for publishing Spring Cloud Task specific metrics via Micrometer.
Intended for internal use only.
- Since:
- 2.2
- Author:
- Christian Tzolov
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
LongTask timer measurement.static final String
Task timer measurements.static final String
Failing task execution status indicator.static final String
Successful task execution status indicator.static final String
task exception tag.static final String
task execution id tag.static final String
task exit code tag.static final String
task external execution id tag.static final String
task name measurement tag.static final String
task parent execution id tag.static final String
task status tag. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onTaskEnd
(TaskExecution taskExecution) void
onTaskFailed
(Throwable throwable) void
onTaskStartup
(TaskExecution taskExecution)
-
Field Details
-
SPRING_CLOUD_TASK_METER
Task timer measurements. Records information about task duration and status.- See Also:
-
SPRING_CLOUD_TASK_ACTIVE_METER
LongTask timer measurement. Records the run-time status of long-time lasting tasks.- See Also:
-
STATUS_SUCCESS
Successful task execution status indicator.- See Also:
-
STATUS_FAILURE
Failing task execution status indicator.- See Also:
-
TASK_NAME_TAG
task name measurement tag.- See Also:
-
TASK_EXECUTION_ID_TAG
task execution id tag.- See Also:
-
TASK_PARENT_EXECUTION_ID_TAG
task parent execution id tag.- See Also:
-
TASK_EXTERNAL_EXECUTION_ID_TAG
task external execution id tag.- See Also:
-
TASK_EXIT_CODE_TAG
task exit code tag.- See Also:
-
TASK_STATUS_TAG
task status tag. Can be either STATUS_SUCCESS or STATUS_FAILURE- See Also:
-
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
-
onTaskFailed
-
onTaskEnd
-