File tree Expand file tree Collapse file tree 4 files changed +21
-18
lines changed
spring-batch-core/src/main/java/org/springframework/batch/core/observability Expand file tree Collapse file tree 4 files changed +21
-18
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ enum JobLowCardinalityTags implements KeyName {
62
62
*/
63
63
JOB_NAME {
64
64
@ Override
65
- public String getKeyName () {
65
+ public String asString () {
66
66
return "spring.batch.job.name" ;
67
67
}
68
68
},
@@ -72,7 +72,7 @@ public String getKeyName() {
72
72
*/
73
73
JOB_STATUS {
74
74
@ Override
75
- public String getKeyName () {
75
+ public String asString () {
76
76
return "spring.batch.job.status" ;
77
77
}
78
78
}
@@ -86,7 +86,7 @@ enum JobHighCardinalityTags implements KeyName {
86
86
*/
87
87
JOB_INSTANCE_ID {
88
88
@ Override
89
- public String getKeyName () {
89
+ public String asString () {
90
90
return "spring.batch.job.instanceId" ;
91
91
}
92
92
},
@@ -96,7 +96,7 @@ public String getKeyName() {
96
96
*/
97
97
JOB_EXECUTION_ID {
98
98
@ Override
99
- public String getKeyName () {
99
+ public String asString () {
100
100
return "spring.batch.job.executionId" ;
101
101
}
102
102
}
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ enum StepLowCardinalityTags implements KeyName {
62
62
*/
63
63
STEP_NAME {
64
64
@ Override
65
- public String getKeyName () {
65
+ public String asString () {
66
66
return "spring.batch.step.name" ;
67
67
}
68
68
},
@@ -72,7 +72,7 @@ public String getKeyName() {
72
72
*/
73
73
STEP_TYPE {
74
74
@ Override
75
- public String getKeyName () {
75
+ public String asString () {
76
76
return "spring.batch.step.type" ;
77
77
}
78
78
},
@@ -82,7 +82,7 @@ public String getKeyName() {
82
82
*/
83
83
JOB_NAME {
84
84
@ Override
85
- public String getKeyName () {
85
+ public String asString () {
86
86
return "spring.batch.step.job.name" ;
87
87
}
88
88
},
@@ -92,7 +92,7 @@ public String getKeyName() {
92
92
*/
93
93
STEP_STATUS {
94
94
@ Override
95
- public String getKeyName () {
95
+ public String asString () {
96
96
return "spring.batch.step.status" ;
97
97
}
98
98
}
@@ -106,7 +106,7 @@ enum StepHighCardinalityTags implements KeyName {
106
106
*/
107
107
STEP_EXECUTION_ID {
108
108
@ Override
109
- public String getKeyName () {
109
+ public String asString () {
110
110
return "spring.batch.step.executionId" ;
111
111
}
112
112
}
Original file line number Diff line number Diff line change @@ -32,17 +32,19 @@ public class DefaultBatchJobObservationConvention implements BatchJobObservation
32
32
public KeyValues getLowCardinalityKeyValues (BatchJobContext context ) {
33
33
JobExecution execution = context .getJobExecution ();
34
34
return KeyValues .of (
35
- BatchJobObservation .JobLowCardinalityTags .JOB_NAME .of (execution .getJobInstance ().getJobName ()),
36
- BatchJobObservation .JobLowCardinalityTags .JOB_STATUS .of (execution .getExitStatus ().getExitCode ()));
35
+ BatchJobObservation .JobLowCardinalityTags .JOB_NAME .withValue (execution .getJobInstance ().getJobName ()),
36
+ BatchJobObservation .JobLowCardinalityTags .JOB_STATUS
37
+ .withValue (execution .getExitStatus ().getExitCode ()));
37
38
}
38
39
39
40
@ Override
40
41
public KeyValues getHighCardinalityKeyValues (BatchJobContext context ) {
41
42
JobExecution execution = context .getJobExecution ();
42
43
return KeyValues .of (
43
44
BatchJobObservation .JobHighCardinalityTags .JOB_INSTANCE_ID
44
- .of (String .valueOf (execution .getJobInstance ().getInstanceId ())),
45
- BatchJobObservation .JobHighCardinalityTags .JOB_EXECUTION_ID .of (String .valueOf (execution .getId ())));
45
+ .withValue (String .valueOf (execution .getJobInstance ().getInstanceId ())),
46
+ BatchJobObservation .JobHighCardinalityTags .JOB_EXECUTION_ID
47
+ .withValue (String .valueOf (execution .getId ())));
46
48
}
47
49
48
50
}
Original file line number Diff line number Diff line change @@ -31,17 +31,18 @@ public class DefaultBatchStepObservationConvention implements BatchStepObservati
31
31
@ Override
32
32
public KeyValues getLowCardinalityKeyValues (BatchStepContext context ) {
33
33
StepExecution execution = context .getStepExecution ();
34
- return KeyValues .of (BatchStepObservation .StepLowCardinalityTags .STEP_NAME .of (execution .getStepName ()),
34
+ return KeyValues .of (BatchStepObservation .StepLowCardinalityTags .STEP_NAME .withValue (execution .getStepName ()),
35
35
BatchStepObservation .StepLowCardinalityTags .JOB_NAME
36
- .of (execution .getJobExecution ().getJobInstance ().getJobName ()),
37
- BatchStepObservation .StepLowCardinalityTags .STEP_STATUS .of (execution .getExitStatus ().getExitCode ()));
36
+ .withValue (execution .getJobExecution ().getJobInstance ().getJobName ()),
37
+ BatchStepObservation .StepLowCardinalityTags .STEP_STATUS
38
+ .withValue (execution .getExitStatus ().getExitCode ()));
38
39
}
39
40
40
41
@ Override
41
42
public KeyValues getHighCardinalityKeyValues (BatchStepContext context ) {
42
43
StepExecution execution = context .getStepExecution ();
43
- return KeyValues .of (
44
- BatchStepObservation . StepHighCardinalityTags . STEP_EXECUTION_ID . of (String .valueOf (execution .getId ())));
44
+ return KeyValues .of (BatchStepObservation . StepHighCardinalityTags . STEP_EXECUTION_ID
45
+ . withValue (String .valueOf (execution .getId ())));
45
46
}
46
47
47
48
}
You can’t perform that action at this time.
0 commit comments