Updating task metrics to micrometer 1.10

Changes include:
* Use Observable instead of metrics
* Update the setting of lowCardinalityTag to the correct events.
* Update the docs
* Remove EXTERNAL_EXECUTION_ID
* Utilize registry provided by boot instead of globalregistry
* Set the handler until Boot does this as shown on line 80 of TaskLifecycleConfiguration.
* Uses Observability long task timer

Updated to latest changes in Micrometer Observability

Updated based on code review and api change

Finished removing the metrics registry

Updated based on code review

Readded cloud foundry keys to observations

Renamed metrics to observations where applicable

Updated metric sample to be observation sample

Updated to set defaults and migrate tests to infrastructure

Updated based on code review

Remove duplicate keyvalues from task observation

Added DocumentedObservation to create the observation
Migrated code to use the LowerCardinality KeyNames from the DocumentedObservation
Test cleanup
Updated code based on code review

Exception is handled by the error in the observation vs logging it as a task metric key value

Updated to use ObservationConvention

Updated to handle user defined convention vs default

Removed the snapshot versions of observations

Removed unnecessary dependencies

Checkpoint tests fail after re-adding 1.10-SNAPSHOT

Replaced TimeObservationHandler with DefaultMeterObservationHandler

Updated to set micrometer to latest milestone

Updated to rename TaskValuesProvider variables to ObservationConvention
This commit is contained in:
Glenn Renfro
2022-03-03 07:58:29 -05:00
parent ceb504b66c
commit 2f0f78a2c8
38 changed files with 1032 additions and 826 deletions

View File

@@ -448,3 +448,21 @@ In these cases the context is held open because a thread has been allocated
set the `spring.cloud.task.closecontextEnabled` property to `true` when launching your task.
This will close the application's context once the task is complete.
Thus allowing the application to terminate.
[[enable-task-metrics]]
=== Enable Task Metrics
Spring Cloud Task integrates with Micrometer and creates observations for the Tasks it executes.
To enable Task Observability integration, you must add `spring-boot-starter-actuator`, your preferred registry implementation (if you want to publish metrics), and micrometer-tracing (if you want to publish tracing data) to your task application.
An example maven set of dependencies to enable task observability and metrics using Influx would be:
[source,xml]
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-influx</artifactId>
<scope>runtime</scope>
</dependency>