Skip to content

Commit 3af3b26

Browse files
committed
Merge branch '2.7.x'
2 parents eabf6cd + 018281f commit 3af3b26

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

Lines changed: 14 additions & 1 deletion
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

Lines changed: 14 additions & 1 deletion
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

Lines changed: 14 additions & 1 deletion
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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,6 @@
433433
"level": "error"
434434
}
435435
},
436-
{
437-
"name": "management.metrics.export.jmx.enabled",
438-
"type": "java.lang.Boolean",
439-
"description": "Whether exporting of metrics to JMX is enabled.",
440-
"defaultValue": true
441-
},
442436
{
443437
"name": "management.metrics.export.kairos.num-threads",
444438
"type": "java.lang.Integer",
@@ -456,12 +450,6 @@
456450
"level": "error"
457451
}
458452
},
459-
{
460-
"name": "management.metrics.export.prometheus.enabled",
461-
"type": "java.lang.Boolean",
462-
"description": "Whether exporting of metrics to Prometheus is enabled.",
463-
"defaultValue": true
464-
},
465453
{
466454
"name": "management.metrics.export.prometheus.histogram-flavor",
467455
"defaultValue": "prometheus"
@@ -479,12 +467,6 @@
479467
"level": "error"
480468
}
481469
},
482-
{
483-
"name": "management.metrics.export.simple.enabled",
484-
"type": "java.lang.Boolean",
485-
"description": "Whether, in the absence of any other exporter, exporting of metrics to an in-memory backend is enabled.",
486-
"defaultValue": true
487-
},
488470
{
489471
"name": "management.metrics.export.simple.mode",
490472
"defaultValue": "cumulative"

0 commit comments

Comments
 (0)