Polish "Restore behavior of management.metrics.export.simple.enabled"

Closes gh-12106
pull/12066/merge
Stephane Nicoll 7 years ago
parent da759f29d0
commit 1dab83adaa

@ -47,7 +47,7 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnBean(Clock.class) @ConditionalOnBean(Clock.class)
@EnableConfigurationProperties(SimpleProperties.class) @EnableConfigurationProperties(SimpleProperties.class)
@ConditionalOnMissingBean(MeterRegistry.class) @ConditionalOnMissingBean(MeterRegistry.class)
@ConditionalOnProperty(prefix = "management.metrics.export.simple", name = "enabled", havingValue = "true", matchIfMissing = true) @ConditionalOnProperty(name = "management.metrics.export.simple.enabled", havingValue = "true", matchIfMissing = true)
public class SimpleMetricsExportAutoConfiguration { public class SimpleMetricsExportAutoConfiguration {
@Bean @Bean

@ -33,12 +33,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "management.metrics.export.simple") @ConfigurationProperties(prefix = "management.metrics.export.simple")
public class SimpleProperties { public class SimpleProperties {
/**
* Enable in-memory metrics that aren't published anywhere (allows you to see
* what metrics are collected in the metrics actuator endpoint).
*/
private boolean enabled;
/** /**
* Step size (i.e. reporting frequency) to use. * Step size (i.e. reporting frequency) to use.
*/ */
@ -49,14 +43,6 @@ public class SimpleProperties {
*/ */
private CountingMode mode = CountingMode.CUMULATIVE; private CountingMode mode = CountingMode.CUMULATIVE;
public boolean getEnabled() {
return this.enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public Duration getStep() { public Duration getStep() {
return this.step; return this.step;
} }

@ -215,6 +215,12 @@
"description": "Whether to enable uptime metrics.", "description": "Whether to enable uptime metrics.",
"defaultValue": true "defaultValue": true
}, },
{
"name": "management.metrics.export.simple.enabled",
"type": "java.lang.Boolean",
"description": "Whether, in the absence of any other exporter, exporting of metrics to an in-memory backend is enabled.",
"defaultValue": true
},
{ {
"name": "management.trace.http.enabled", "name": "management.trace.http.enabled",
"type": "java.lang.Boolean", "type": "java.lang.Boolean",

@ -1384,7 +1384,7 @@ content into your application. Rather, pick only the properties that you need.
management.metrics.export.signalfx.uri= # Optional custom URI for the SignalFX API. management.metrics.export.signalfx.uri= # Optional custom URI for the SignalFX API.
management.metrics.export.simple.mode=cumulative # Counting mode. management.metrics.export.simple.mode=cumulative # Counting mode.
management.metrics.export.simple.step=10s # Step size (i.e. reporting frequency) to use. management.metrics.export.simple.step=10s # Step size (i.e. reporting frequency) to use.
management.metrics.export.statsd.enabled= # Whether exporting of metrics to this backend is enabled. management.metrics.export.statsd.enabled=true # Whether, in the absence of any other exporter, exporting of metrics to an in-memory backend is enabled.
management.metrics.export.statsd.flavor=datadog # StatsD line protocol to use. management.metrics.export.statsd.flavor=datadog # StatsD line protocol to use.
management.metrics.export.statsd.host=localhost # Host of the StatsD server to receive exported metrics. management.metrics.export.statsd.host=localhost # Host of the StatsD server to receive exported metrics.
management.metrics.export.statsd.max-packet-length=1400 # Total length of a single payload should be kept within your network's MTU. management.metrics.export.statsd.max-packet-length=1400 # Total length of a single payload should be kept within your network's MTU.

@ -1272,6 +1272,22 @@ using:
[[production-ready-metrics-export-simple]]
==== Simple
Micrometer ships with a simple, in-memory backend that is automatically used as a fallback
if no other registry is configured. This allows you to see what metrics are collected in
the <<production-ready-metrics-endpoint,metrics endpoint>>.
The in-memory backend disables itself as soon as you're using any of the other available
backend. You can also disable it explicitly:
[source,properties,indent=0]
----
management.metrics.export.simple.enabled=false
----
[[production-ready-metrics-export-newrelic]] [[production-ready-metrics-export-newrelic]]
==== New Relic ==== New Relic
New Relic registry pushes metrics to New Relic periodically. To export metrics to New Relic registry pushes metrics to New Relic periodically. To export metrics to

Loading…
Cancel
Save