Skip to content

Commit

Permalink
Add enabled fields in JMX, Prometheus and Simple metrics properties
Browse files Browse the repository at this point in the history
  • Loading branch information
mhalbritter committed Mar 23, 2022
1 parent 9fc649d commit d17c17d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
@ConfigurationProperties(prefix = "management.jmx.metrics.export")
public class JmxProperties {

/**
* Whether exporting of metrics to this backend is enabled.
*/
private boolean enabled = true;

/**
* Metrics JMX domain name.
*/
Expand All @@ -57,4 +62,12 @@ public void setStep(Duration step) {
this.step = step;
}

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
@ConfigurationProperties(prefix = "management.prometheus.metrics.export")
public class PrometheusProperties {

/**
* Whether exporting of metrics to this backend is enabled.
*/
private boolean enabled = true;

/**
* Whether to enable publishing descriptions as part of the scrape payload to
* Prometheus. Turn this off to minimize the amount of data sent on each scrape.
Expand Down Expand Up @@ -86,6 +91,14 @@ public Pushgateway getPushgateway() {
return this.pushgateway;
}

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

/**
* Configuration options for push-based interaction with Prometheus.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
@ConfigurationProperties(prefix = "management.simple.metrics.export")
public class SimpleProperties {

/**
* Whether exporting of metrics to this backend is enabled.
*/
private boolean enabled = true;

/**
* Step size (i.e. reporting frequency) to use.
*/
Expand All @@ -60,4 +65,12 @@ public void setMode(CountingMode mode) {
this.mode = mode;
}

public boolean isEnabled() {
return this.enabled;
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

}

0 comments on commit d17c17d

Please sign in to comment.