Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
54781c73
Commit
54781c73
authored
Aug 29, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move endpoints.metrics.filter to management.metrics.filter
See gh-10007
parent
4c708898
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
11 deletions
+40
-11
MetricFilterAutoConfiguration.java
.../autoconfigure/metrics/MetricFilterAutoConfiguration.java
+1
-1
MetricFilterProperties.java
...actuate/autoconfigure/metrics/MetricFilterProperties.java
+1
-1
additional-spring-configuration-metadata.json
...es/META-INF/additional-spring-configuration-metadata.json
+28
-1
MetricFilterAutoConfigurationTests.java
...configure/metrics/MetricFilterAutoConfigurationTests.java
+5
-5
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+5
-3
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricFilterAutoConfiguration.java
View file @
54781c73
...
...
@@ -48,7 +48,7 @@ import org.springframework.web.servlet.HandlerMapping;
@ConditionalOnClass
({
Servlet
.
class
,
ServletRegistration
.
class
,
OncePerRequestFilter
.
class
,
HandlerMapping
.
class
})
@AutoConfigureAfter
(
MetricRepositoryAutoConfiguration
.
class
)
@ConditionalOnProperty
(
prefix
=
"
endpoints
.metrics.filter"
,
name
=
"enabled"
,
matchIfMissing
=
true
)
@ConditionalOnProperty
(
prefix
=
"
management
.metrics.filter"
,
name
=
"enabled"
,
matchIfMissing
=
true
)
@EnableConfigurationProperties
({
MetricFilterProperties
.
class
})
public
class
MetricFilterAutoConfiguration
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricFilterProperties.java
View file @
54781c73
...
...
@@ -31,7 +31,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @author Phillip Webb
* @since 2.0.0
*/
@ConfigurationProperties
(
prefix
=
"
endpoints
.metrics.filter"
)
@ConfigurationProperties
(
prefix
=
"
management
.metrics.filter"
)
public
class
MetricFilterProperties
{
/**
...
...
spring-boot-actuator/src/main/resources/META-INF/additional-spring-configuration-metadata.json
View file @
54781c73
...
...
@@ -45,11 +45,32 @@
"vcap_services"
]
},
{
"name"
:
"endpoints.metrics.filter.counter-submissions"
,
"type"
:
"java.util.Set<org.springframework.boot.actuate.metrics.web.servlet.MetricsFilterSubmission>"
,
"description"
:
"Submissions that should be made to the counter."
,
"deprecation"
:
{
"replacement"
:
"management.metrics.filter.counter-submissions"
,
"level"
:
"error"
}
},
{
"name"
:
"endpoints.metrics.filter.enabled"
,
"type"
:
"java.lang.Boolean"
,
"description"
:
"Enable the metrics servlet filter."
,
"defaultValue"
:
true
"deprecation"
:
{
"replacement"
:
"management.metrics.filter.enabled"
,
"level"
:
"error"
}
},
{
"name"
:
"endpoints.metrics.filter.gauge-submissions"
,
"type"
:
"java.util.Set<org.springframework.boot.actuate.metrics.web.servlet.MetricsFilterSubmission>"
,
"description"
:
"Submissions that should be made to the gauge."
,
"deprecation"
:
{
"replacement"
:
"management.metrics.filter.gauge-submissions"
,
"level"
:
"error"
}
},
{
"name"
:
"endpoints.trace.filter.enabled"
,
...
...
@@ -186,6 +207,12 @@
"name"
:
"management.info.git.mode"
,
"defaultValue"
:
"simple"
},
{
"name"
:
"management.metrics.filter.enabled"
,
"type"
:
"java.lang.Boolean"
,
"description"
:
"Enable the metrics servlet filter."
,
"defaultValue"
:
true
},
{
"name"
:
"management.security.sessions"
,
"defaultValue"
:
"stateless"
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricFilterAutoConfigurationTests.java
View file @
54781c73
...
...
@@ -236,7 +236,7 @@ public class MetricFilterAutoConfigurationTests {
@Test
public
void
skipsFilterIfPropertyDisabled
()
throws
Exception
{
AnnotationConfigApplicationContext
context
=
new
AnnotationConfigApplicationContext
();
TestPropertyValues
.
of
(
"
endpoints
.metrics.filter.enabled:false"
).
applyTo
(
context
);
TestPropertyValues
.
of
(
"
management
.metrics.filter.enabled:false"
).
applyTo
(
context
);
context
.
register
(
Config
.
class
,
MetricFilterAutoConfiguration
.
class
);
context
.
refresh
();
assertThat
(
context
.
getBeansOfType
(
Filter
.
class
).
size
()).
isEqualTo
(
0
);
...
...
@@ -357,8 +357,8 @@ public class MetricFilterAutoConfigurationTests {
AnnotationConfigApplicationContext
context
=
new
AnnotationConfigApplicationContext
();
context
.
register
(
Config
.
class
,
MetricFilterAutoConfiguration
.
class
);
TestPropertyValues
.
of
(
"
endpoints
.metrics.filter.gauge-submissions=merged,per-http-method"
,
"
endpoints
.metrics.filter.counter-submissions=merged,per-http-method"
)
.
of
(
"
management
.metrics.filter.gauge-submissions=merged,per-http-method"
,
"
management
.metrics.filter.counter-submissions=merged,per-http-method"
)
.
applyTo
(
context
);
context
.
refresh
();
Filter
filter
=
context
.
getBean
(
Filter
.
class
);
...
...
@@ -385,8 +385,8 @@ public class MetricFilterAutoConfigurationTests {
public
void
doesNotRecordRolledUpMetricsIfConfigured
()
throws
Exception
{
AnnotationConfigApplicationContext
context
=
new
AnnotationConfigApplicationContext
();
context
.
register
(
Config
.
class
,
MetricFilterAutoConfiguration
.
class
);
TestPropertyValues
.
of
(
"
endpoints
.metrics.filter.gauge-submissions="
,
"
endpoints
.metrics.filter.counter-submissions="
).
applyTo
(
context
);
TestPropertyValues
.
of
(
"
management
.metrics.filter.gauge-submissions="
,
"
management
.metrics.filter.counter-submissions="
).
applyTo
(
context
);
context
.
refresh
();
Filter
filter
=
context
.
getBean
(
Filter
.
class
);
MockHttpServletRequest
request
=
new
MockHttpServletRequest
(
"PUT"
,
"/test/path"
);
...
...
spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
54781c73
...
...
@@ -1173,9 +1173,6 @@ content into your application; rather pick only the properties that you need.
endpoints.metrics.enabled=true # Enable the metrics endpoint.
endpoints.metrics.jmx.enabled=true # Expose the metrics endpoint as a JMX MBean.
endpoints.metrics.web.enabled=false # Expose the metrics endpoint as a Web endpoint.
endpoints.metrics.filter.counter-submissions= # Submissions that should be made to the counter.
endpoints.metrics.filter.enabled=true # Enable the metrics servlet filter.
endpoints.metrics.filter.gauge-submissions= # Submissions that should be made to the gauge.
# SHUTDOWN ENDPOINT ({sc-spring-boot-actuator}/endpoint/ShutdownEndpoint.{sc-ext}[ShutdownEndpoint])
endpoints.shutdown.cache.time-to-live=0 # Maximum time in milliseconds that a response can be cached.
...
...
@@ -1277,6 +1274,11 @@ content into your application; rather pick only the properties that you need.
management.jolokia.enabled=false # Enable Jolokia.
management.jolokia.path=/jolokia # Path at which Jolokia will be available.
# METRICS FILTER ({sc-spring-boot-actuator}/autoconfigure/metrics/MetricsFilterProperties.{sc-ext}[MetricsFilterProperties])
management.metrics.filter.counter-submissions= # Submissions that should be made to the counter.
management.metrics.filter.enabled=true # Enable the metrics servlet filter.
management.metrics.filter.gauge-submissions= # Submissions that should be made to the gauge.
# TRACING ({sc-spring-boot-actuator}/trace/TraceProperties.{sc-ext}[TraceProperties])
management.trace.include=request-headers,response-headers,cookies,errors # Items to be included in the trace.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment