From 6d52da0cd764de8cc54c29676c26da697cbaedad Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Tue, 11 Oct 2022 18:54:41 -0400 Subject: [PATCH] Updating micrometer docs --- docs/src/main/asciidoc/features.adoc | 63 ++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 13 deletions(-) diff --git a/docs/src/main/asciidoc/features.adoc b/docs/src/main/asciidoc/features.adoc index ce058aef..6a2080ab 100644 --- a/docs/src/main/asciidoc/features.adoc +++ b/docs/src/main/asciidoc/features.adoc @@ -396,42 +396,79 @@ To do so, add the process-aot execution and set `spring.cloud.task.single-step-i === Enabling Micrometer Metrics and Observations for Spring Cloud Task -Spring Cloud Task captures the following metrics with the following fields: +==== Timer +The `spring.cloud.task` metric captures the information of a task following the execution of the task. +Spring Cloud Task captures the following information for a Timer: * spring.cloud.task - Task timer measurements. Records information about task duration and status. ** application - Name assigned by `management.metrics.tags.application` property. -** task.exception - Exception that was thrown during task execution. -** task.exit.code - The exit code of the application. +** exit.code - The exit code of the application. ** service - Service name assigned by the `management.metrics.tags.service` property. -** task.execution.id - The execution id associated with the task execution. -** task.parent.execution.id - The parent execution id associated with the task execution via the `spring.cloud.task.parent-execution-id` proeprty. +** execution.id - The execution id associated with the task execution. +** parent.execution.id - The parent execution id associated with the task execution via the `spring.cloud.task.parent-execution-id` proeprty. ** count - as recorded by the timer. -** total_time - as recorded by the timer. -** max_time - as recorded by the timer.* +** total_time - as recorded by the timer in seconds. +** max - as recorded by the timer in seconds. +* - LongTask timer measurement. Records the run-time status of long-time lasting tasks. + +==== Long Task Timer +The `spring.cloud.task.active` metric captures the information of a task during the task execution. +Spring Cloud Task captures the following information for a Long Task Timer (active): + +* spring.cloud.task - Task timer measurements. Records information about task duration and status. +** application - Name assigned by `management.metrics.tags.application` property. +** exit.code - The exit code of the application. +** service - Service name assigned by the `management.metrics.tags.service` property. +** execution.id - The execution id associated with the task execution. +** parent.execution.id - The parent execution id associated with the task execution via the `spring.cloud.task.parent-execution-id` proeprty. +** active_tasks - as recorded by the long task timer. +** duration - as recorded by the long task timer. * spring.cloud.task.active - LongTask timer measurement. Records the run-time status of long-time lasting tasks. + ==== Observations Spring Cloud Task allows user to enable Observations for `CommandLineRunner` and `ApplicationRunner` s. +To Enable Task Observations for `ApplicationRunner` s or `CommandLineRunner` s set `spring.cloud.task.observation.enabled` to true. + +An example task application with observations enables using the `SimpleMeterRegistry` can be found https://github.com/spring-cloud/spring-cloud-task/tree/main/spring-cloud-task-samples/task-metrics[here]. + +===== Runner Timer +The `spring.cloud.task.runner` metric captures the information of a task application/commandline runner following the execution of the application/commandline runner. +Spring Cloud Task captures the following information for a runner's Timer: + Spring Cloud Task establishes the following Observation with the following fields: * spring.cloud.task.runner - Observed representation of a `CommandLineRunner` or `ApplicationRunner`. ** application - Name assigned by `management.metrics.tags.application` property. ** error - Exception that was thrown during `ApplicationRunner` or `CommandLineRunner` execution. ** spring.cloud.task.runner.bean-name - The name of the bean for the `ApplicationRunner` or `CommandLineRunner` -** task.execution.id - The execution id associated with the task execution. -** task.parent.execution.id - The parent execution id associated with the task execution via the `spring.cloud.task.parent-execution-id` proeprty. +** execution.id - The execution id associated with the task execution. +** parent.execution.id - The parent execution id associated with the task execution via the `spring.cloud.task.parent-execution-id` proeprty. ** count - as recorded by the Observation. ** total_time - as recorded by the Observation. -** max_time - as recorded by the Observation. +** max - as recorded by the Observation. -To Enable Task Observations for `ApplicationRunner` s or `CommandLineRunner` s set `spring.cloud.task.observation.enabled` to true. +===== Long Task Runner Timer +The `spring.cloud.task.runner.active` metric captures the information of a task application/commandline runner during the execution of the application/commandline runner. +Spring Cloud Task captures the following information for a runner's Long Task Timer: + +Spring Cloud Task establishes the following Observation with the following fields: + +* spring.cloud.task.runner - Observed representation of a `CommandLineRunner` or `ApplicationRunner`. +** application - Name assigned by `management.metrics.tags.application` property. +** error - Exception that was thrown during `ApplicationRunner` or `CommandLineRunner` execution. +** spring.cloud.task.runner.bean-name - The name of the bean for the `ApplicationRunner` or `CommandLineRunner` +** execution.id - The execution id associated with the task execution. +** parent.execution.id - The parent execution id associated with the task execution via the `spring.cloud.task.parent-execution-id` proeprty. +** count - as recorded by the Observation. +** total_time - as recorded by the Observation. +** max - as recorded by the Observation. -An example task application with observations enables using the `SimpleMeterRegistry` can be found https://github.com/spring-cloud/spring-cloud-task/tree/main/spring-cloud-task-samples/task-metrics[here]. === Disabling Spring Cloud Task Auto Configuration -In cases where Spring Cloud Task should not be auto configured for an implementation, you can disable Task's auto configuration. +In cases where Spring Cloud Task should not be autoconfigured for an implementation, you can disable Task's auto configuration. This can be done either by adding the following annotation to your Task application: ``` @EnableAutoConfiguration(exclude={SimpleTaskAutoConfiguration.class})