Fix breaking changes in micrometer APIs
Related to https://github.com/micrometer-metrics/micrometer/pull/3310
This commit is contained in:
@@ -62,7 +62,7 @@ public enum BatchJobObservation implements DocumentedObservation {
|
||||
*/
|
||||
JOB_NAME {
|
||||
@Override
|
||||
public String getKeyName() {
|
||||
public String asString() {
|
||||
return "spring.batch.job.name";
|
||||
}
|
||||
},
|
||||
@@ -72,7 +72,7 @@ public enum BatchJobObservation implements DocumentedObservation {
|
||||
*/
|
||||
JOB_STATUS {
|
||||
@Override
|
||||
public String getKeyName() {
|
||||
public String asString() {
|
||||
return "spring.batch.job.status";
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public enum BatchJobObservation implements DocumentedObservation {
|
||||
*/
|
||||
JOB_INSTANCE_ID {
|
||||
@Override
|
||||
public String getKeyName() {
|
||||
public String asString() {
|
||||
return "spring.batch.job.instanceId";
|
||||
}
|
||||
},
|
||||
@@ -96,7 +96,7 @@ public enum BatchJobObservation implements DocumentedObservation {
|
||||
*/
|
||||
JOB_EXECUTION_ID {
|
||||
@Override
|
||||
public String getKeyName() {
|
||||
public String asString() {
|
||||
return "spring.batch.job.executionId";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public enum BatchStepObservation implements DocumentedObservation {
|
||||
*/
|
||||
STEP_NAME {
|
||||
@Override
|
||||
public String getKeyName() {
|
||||
public String asString() {
|
||||
return "spring.batch.step.name";
|
||||
}
|
||||
},
|
||||
@@ -72,7 +72,7 @@ public enum BatchStepObservation implements DocumentedObservation {
|
||||
*/
|
||||
STEP_TYPE {
|
||||
@Override
|
||||
public String getKeyName() {
|
||||
public String asString() {
|
||||
return "spring.batch.step.type";
|
||||
}
|
||||
},
|
||||
@@ -82,7 +82,7 @@ public enum BatchStepObservation implements DocumentedObservation {
|
||||
*/
|
||||
JOB_NAME {
|
||||
@Override
|
||||
public String getKeyName() {
|
||||
public String asString() {
|
||||
return "spring.batch.step.job.name";
|
||||
}
|
||||
},
|
||||
@@ -92,7 +92,7 @@ public enum BatchStepObservation implements DocumentedObservation {
|
||||
*/
|
||||
STEP_STATUS {
|
||||
@Override
|
||||
public String getKeyName() {
|
||||
public String asString() {
|
||||
return "spring.batch.step.status";
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public enum BatchStepObservation implements DocumentedObservation {
|
||||
*/
|
||||
STEP_EXECUTION_ID {
|
||||
@Override
|
||||
public String getKeyName() {
|
||||
public String asString() {
|
||||
return "spring.batch.step.executionId";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,9 @@ public class DefaultBatchJobObservationConvention implements BatchJobObservation
|
||||
public KeyValues getLowCardinalityKeyValues(BatchJobContext context) {
|
||||
JobExecution execution = context.getJobExecution();
|
||||
return KeyValues.of(
|
||||
BatchJobObservation.JobLowCardinalityTags.JOB_NAME.of(execution.getJobInstance().getJobName()),
|
||||
BatchJobObservation.JobLowCardinalityTags.JOB_STATUS.of(execution.getExitStatus().getExitCode()));
|
||||
BatchJobObservation.JobLowCardinalityTags.JOB_NAME.withValue(execution.getJobInstance().getJobName()),
|
||||
BatchJobObservation.JobLowCardinalityTags.JOB_STATUS
|
||||
.withValue(execution.getExitStatus().getExitCode()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,8 +42,9 @@ public class DefaultBatchJobObservationConvention implements BatchJobObservation
|
||||
JobExecution execution = context.getJobExecution();
|
||||
return KeyValues.of(
|
||||
BatchJobObservation.JobHighCardinalityTags.JOB_INSTANCE_ID
|
||||
.of(String.valueOf(execution.getJobInstance().getInstanceId())),
|
||||
BatchJobObservation.JobHighCardinalityTags.JOB_EXECUTION_ID.of(String.valueOf(execution.getId())));
|
||||
.withValue(String.valueOf(execution.getJobInstance().getInstanceId())),
|
||||
BatchJobObservation.JobHighCardinalityTags.JOB_EXECUTION_ID
|
||||
.withValue(String.valueOf(execution.getId())));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,17 +31,18 @@ public class DefaultBatchStepObservationConvention implements BatchStepObservati
|
||||
@Override
|
||||
public KeyValues getLowCardinalityKeyValues(BatchStepContext context) {
|
||||
StepExecution execution = context.getStepExecution();
|
||||
return KeyValues.of(BatchStepObservation.StepLowCardinalityTags.STEP_NAME.of(execution.getStepName()),
|
||||
return KeyValues.of(BatchStepObservation.StepLowCardinalityTags.STEP_NAME.withValue(execution.getStepName()),
|
||||
BatchStepObservation.StepLowCardinalityTags.JOB_NAME
|
||||
.of(execution.getJobExecution().getJobInstance().getJobName()),
|
||||
BatchStepObservation.StepLowCardinalityTags.STEP_STATUS.of(execution.getExitStatus().getExitCode()));
|
||||
.withValue(execution.getJobExecution().getJobInstance().getJobName()),
|
||||
BatchStepObservation.StepLowCardinalityTags.STEP_STATUS
|
||||
.withValue(execution.getExitStatus().getExitCode()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public KeyValues getHighCardinalityKeyValues(BatchStepContext context) {
|
||||
StepExecution execution = context.getStepExecution();
|
||||
return KeyValues.of(
|
||||
BatchStepObservation.StepHighCardinalityTags.STEP_EXECUTION_ID.of(String.valueOf(execution.getId())));
|
||||
return KeyValues.of(BatchStepObservation.StepHighCardinalityTags.STEP_EXECUTION_ID
|
||||
.withValue(String.valueOf(execution.getId())));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user