Skip to content

Commit 6d52da0

Browse files
committed
Updating micrometer docs
1 parent 002a565 commit 6d52da0

File tree

1 file changed

+50
-13
lines changed

1 file changed

+50
-13
lines changed

docs/src/main/asciidoc/features.adoc

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -396,42 +396,79 @@ To do so, add the process-aot execution and set `spring.cloud.task.single-step-i
396396

397397
=== Enabling Micrometer Metrics and Observations for Spring Cloud Task
398398

399-
Spring Cloud Task captures the following metrics with the following fields:
399+
==== Timer
400+
The `spring.cloud.task` metric captures the information of a task following the execution of the task.
401+
Spring Cloud Task captures the following information for a Timer:
400402

401403
* spring.cloud.task - Task timer measurements. Records information about task duration and status.
402404
** application - Name assigned by `management.metrics.tags.application` property.
403-
** task.exception - Exception that was thrown during task execution.
404-
** task.exit.code - The exit code of the application.
405+
** exit.code - The exit code of the application.
405406
** service - Service name assigned by the `management.metrics.tags.service` property.
406-
** task.execution.id - The execution id associated with the task execution.
407-
** task.parent.execution.id - The parent execution id associated with the task execution via the `spring.cloud.task.parent-execution-id` proeprty.
407+
** execution.id - The execution id associated with the task execution.
408+
** parent.execution.id - The parent execution id associated with the task execution via the `spring.cloud.task.parent-execution-id` proeprty.
408409
** count - as recorded by the timer.
409-
** total_time - as recorded by the timer.
410-
** max_time - as recorded by the timer.*
410+
** total_time - as recorded by the timer in seconds.
411+
** max - as recorded by the timer in seconds.
412+
* - LongTask timer measurement. Records the run-time status of long-time lasting tasks.
413+
414+
==== Long Task Timer
415+
The `spring.cloud.task.active` metric captures the information of a task during the task execution.
416+
Spring Cloud Task captures the following information for a Long Task Timer (active):
417+
418+
* spring.cloud.task - Task timer measurements. Records information about task duration and status.
419+
** application - Name assigned by `management.metrics.tags.application` property.
420+
** exit.code - The exit code of the application.
421+
** service - Service name assigned by the `management.metrics.tags.service` property.
422+
** execution.id - The execution id associated with the task execution.
423+
** parent.execution.id - The parent execution id associated with the task execution via the `spring.cloud.task.parent-execution-id` proeprty.
424+
** active_tasks - as recorded by the long task timer.
425+
** duration - as recorded by the long task timer.
411426
* spring.cloud.task.active - LongTask timer measurement. Records the run-time status of long-time lasting tasks.
412427

428+
413429
==== Observations
414430
Spring Cloud Task allows user to enable Observations for `CommandLineRunner` and `ApplicationRunner` s.
415431

432+
To Enable Task Observations for `ApplicationRunner` s or `CommandLineRunner` s set `spring.cloud.task.observation.enabled` to true.
433+
434+
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].
435+
436+
===== Runner Timer
437+
The `spring.cloud.task.runner` metric captures the information of a task application/commandline runner following the execution of the application/commandline runner.
438+
Spring Cloud Task captures the following information for a runner's Timer:
439+
416440
Spring Cloud Task establishes the following Observation with the following fields:
417441

418442
* spring.cloud.task.runner - Observed representation of a `CommandLineRunner` or `ApplicationRunner`.
419443
** application - Name assigned by `management.metrics.tags.application` property.
420444
** error - Exception that was thrown during `ApplicationRunner` or `CommandLineRunner` execution.
421445
** spring.cloud.task.runner.bean-name - The name of the bean for the `ApplicationRunner` or `CommandLineRunner`
422-
** task.execution.id - The execution id associated with the task execution.
423-
** task.parent.execution.id - The parent execution id associated with the task execution via the `spring.cloud.task.parent-execution-id` proeprty.
446+
** execution.id - The execution id associated with the task execution.
447+
** parent.execution.id - The parent execution id associated with the task execution via the `spring.cloud.task.parent-execution-id` proeprty.
424448
** count - as recorded by the Observation.
425449
** total_time - as recorded by the Observation.
426-
** max_time - as recorded by the Observation.
450+
** max - as recorded by the Observation.
427451

428-
To Enable Task Observations for `ApplicationRunner` s or `CommandLineRunner` s set `spring.cloud.task.observation.enabled` to true.
452+
===== Long Task Runner Timer
453+
The `spring.cloud.task.runner.active` metric captures the information of a task application/commandline runner during the execution of the application/commandline runner.
454+
Spring Cloud Task captures the following information for a runner's Long Task Timer:
455+
456+
Spring Cloud Task establishes the following Observation with the following fields:
457+
458+
* spring.cloud.task.runner - Observed representation of a `CommandLineRunner` or `ApplicationRunner`.
459+
** application - Name assigned by `management.metrics.tags.application` property.
460+
** error - Exception that was thrown during `ApplicationRunner` or `CommandLineRunner` execution.
461+
** spring.cloud.task.runner.bean-name - The name of the bean for the `ApplicationRunner` or `CommandLineRunner`
462+
** execution.id - The execution id associated with the task execution.
463+
** parent.execution.id - The parent execution id associated with the task execution via the `spring.cloud.task.parent-execution-id` proeprty.
464+
** count - as recorded by the Observation.
465+
** total_time - as recorded by the Observation.
466+
** max - as recorded by the Observation.
429467

430-
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].
431468

432469
=== Disabling Spring Cloud Task Auto Configuration
433470

434-
In cases where Spring Cloud Task should not be auto configured for an implementation, you can disable Task's auto configuration.
471+
In cases where Spring Cloud Task should not be autoconfigured for an implementation, you can disable Task's auto configuration.
435472
This can be done either by adding the following annotation to your Task application:
436473
```
437474
@EnableAutoConfiguration(exclude={SimpleTaskAutoConfiguration.class})

0 commit comments

Comments
 (0)