Skip to content

Commit cee5178

Browse files
committed
Merge branch '2.5.x' into 2.6.x
Closes gh-30440
2 parents c003d5b + 24e748d commit cee5178

File tree

4 files changed

+42
-21
lines changed

4 files changed

+42
-21
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/jmx/JmxProperties.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,6 +31,11 @@
3131
@ConfigurationProperties(prefix = "management.metrics.export.jmx")
3232
public class JmxProperties {
3333

34+
/**
35+
* Whether exporting of metrics to this backend is enabled.
36+
*/
37+
private boolean enabled = true;
38+
3439
/**
3540
* Metrics JMX domain name.
3641
*/
@@ -57,4 +62,12 @@ public void setStep(Duration step) {
5762
this.step = step;
5863
}
5964

65+
public boolean isEnabled() {
66+
return this.enabled;
67+
}
68+
69+
public void setEnabled(boolean enabled) {
70+
this.enabled = enabled;
71+
}
72+
6073
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusProperties.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,6 +36,11 @@
3636
@ConfigurationProperties(prefix = "management.metrics.export.prometheus")
3737
public class PrometheusProperties {
3838

39+
/**
40+
* Whether exporting of metrics to this backend is enabled.
41+
*/
42+
private boolean enabled = true;
43+
3944
/**
4045
* Whether to enable publishing descriptions as part of the scrape payload to
4146
* Prometheus. Turn this off to minimize the amount of data sent on each scrape.
@@ -82,6 +87,14 @@ public void setStep(Duration step) {
8287
this.step = step;
8388
}
8489

90+
public boolean isEnabled() {
91+
return this.enabled;
92+
}
93+
94+
public void setEnabled(boolean enabled) {
95+
this.enabled = enabled;
96+
}
97+
8598
public Pushgateway getPushgateway() {
8699
return this.pushgateway;
87100
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleProperties.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,6 +34,11 @@
3434
@ConfigurationProperties(prefix = "management.metrics.export.simple")
3535
public class SimpleProperties {
3636

37+
/**
38+
* Whether exporting of metrics to this backend is enabled.
39+
*/
40+
private boolean enabled = true;
41+
3742
/**
3843
* Step size (i.e. reporting frequency) to use.
3944
*/
@@ -44,6 +49,14 @@ public class SimpleProperties {
4449
*/
4550
private CountingMode mode = CountingMode.CUMULATIVE;
4651

52+
public boolean isEnabled() {
53+
return this.enabled;
54+
}
55+
56+
public void setEnabled(boolean enabled) {
57+
this.enabled = enabled;
58+
}
59+
4760
public Duration getStep() {
4861
return this.step;
4962
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json

-18
Original file line numberDiff line numberDiff line change
@@ -427,12 +427,6 @@
427427
"level": "error"
428428
}
429429
},
430-
{
431-
"name": "management.metrics.export.jmx.enabled",
432-
"type": "java.lang.Boolean",
433-
"description": "Whether exporting of metrics to JMX is enabled.",
434-
"defaultValue": true
435-
},
436430
{
437431
"name": "management.metrics.export.kairos.num-threads",
438432
"type": "java.lang.Integer",
@@ -450,12 +444,6 @@
450444
"level": "error"
451445
}
452446
},
453-
{
454-
"name": "management.metrics.export.prometheus.enabled",
455-
"type": "java.lang.Boolean",
456-
"description": "Whether exporting of metrics to Prometheus is enabled.",
457-
"defaultValue": true
458-
},
459447
{
460448
"name": "management.metrics.export.prometheus.histogram-flavor",
461449
"defaultValue": "prometheus"
@@ -473,12 +461,6 @@
473461
"level": "error"
474462
}
475463
},
476-
{
477-
"name": "management.metrics.export.simple.enabled",
478-
"type": "java.lang.Boolean",
479-
"description": "Whether, in the absence of any other exporter, exporting of metrics to an in-memory backend is enabled.",
480-
"defaultValue": true
481-
},
482464
{
483465
"name": "management.metrics.export.simple.mode",
484466
"defaultValue": "cumulative"

0 commit comments

Comments
 (0)