Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
apollo
Commits
dce5116e
Commit
dce5116e
authored
Aug 12, 2019
by
Jared Tan
Committed by
Jason Song
Aug 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add prometheus integration.
parent
fd231ab1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
5 deletions
+14
-5
apollo-common/pom.xml
apollo-common/pom.xml
+10
-0
apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/WebMvcConfig.java
...trip/framework/apollo/common/controller/WebMvcConfig.java
+1
-4
apollo-common/src/main/resources/application.properties
apollo-common/src/main/resources/application.properties
+2
-0
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java
...rk/apollo/portal/spi/configuration/AuthConfiguration.java
+1
-1
No files found.
apollo-common/pom.xml
View file @
dce5116e
...
@@ -60,5 +60,15 @@
...
@@ -60,5 +60,15 @@
<groupId>
commons-lang
</groupId>
<groupId>
commons-lang
</groupId>
<artifactId>
commons-lang
</artifactId>
<artifactId>
commons-lang
</artifactId>
</dependency>
</dependency>
<!-- Micrometer core dependecy -->
<dependency>
<groupId>
io.micrometer
</groupId>
<artifactId>
micrometer-core
</artifactId>
</dependency>
<dependency>
<groupId>
io.micrometer
</groupId>
<artifactId>
micrometer-registry-prometheus
</artifactId>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/WebMvcConfig.java
View file @
dce5116e
package
com
.
ctrip
.
framework
.
apollo
.
common
.
controller
;
package
com
.
ctrip
.
framework
.
apollo
.
common
.
controller
;
import
java.util.List
;
import
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
;
import
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
;
import
org.springframework.boot.web.server.MimeMappings
;
import
org.springframework.boot.web.server.MimeMappings
;
import
org.springframework.boot.web.server.WebServerFactoryCustomizer
;
import
org.springframework.boot.web.server.WebServerFactoryCustomizer
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.web.PageableHandlerMethodArgumentResolver
;
import
org.springframework.data.web.PageableHandlerMethodArgumentResolver
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.method.support.HandlerMethodArgumentResolver
;
import
org.springframework.web.method.support.HandlerMethodArgumentResolver
;
import
org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer
;
import
org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
java.util.List
;
@Configuration
@Configuration
public
class
WebMvcConfig
implements
WebMvcConfigurer
,
WebServerFactoryCustomizer
<
TomcatServletWebServerFactory
>
{
public
class
WebMvcConfig
implements
WebMvcConfigurer
,
WebServerFactoryCustomizer
<
TomcatServletWebServerFactory
>
{
...
@@ -29,7 +27,6 @@ public class WebMvcConfig implements WebMvcConfigurer, WebServerFactoryCustomize
...
@@ -29,7 +27,6 @@ public class WebMvcConfig implements WebMvcConfigurer, WebServerFactoryCustomize
@Override
@Override
public
void
configureContentNegotiation
(
ContentNegotiationConfigurer
configurer
)
{
public
void
configureContentNegotiation
(
ContentNegotiationConfigurer
configurer
)
{
configurer
.
favorPathExtension
(
false
);
configurer
.
favorPathExtension
(
false
);
configurer
.
ignoreAcceptHeader
(
true
).
defaultContentType
(
MediaType
.
APPLICATION_JSON_UTF8
);
}
}
@Override
@Override
...
...
apollo-common/src/main/resources/application.properties
View file @
dce5116e
...
@@ -17,3 +17,5 @@ server.max-http-header-size=10240
...
@@ -17,3 +17,5 @@ server.max-http-header-size=10240
management.endpoints.web.base-path
=
/
management.endpoints.web.base-path
=
/
logging.file.max-size
=
50MB
logging.file.max-size
=
50MB
logging.file.max-history
=
10
logging.file.max-history
=
10
management.endpoints.web.exposure.include
=
info,health,metrics,prometheus
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/configuration/AuthConfiguration.java
View file @
dce5116e
...
@@ -271,7 +271,7 @@ public class AuthConfiguration {
...
@@ -271,7 +271,7 @@ public class AuthConfiguration {
http
.
csrf
().
disable
();
http
.
csrf
().
disable
();
http
.
headers
().
frameOptions
().
sameOrigin
();
http
.
headers
().
frameOptions
().
sameOrigin
();
http
.
authorizeRequests
()
http
.
authorizeRequests
()
.
antMatchers
(
"/openapi/**"
,
"/vendor/**"
,
"/styles/**"
,
"/scripts/**"
,
"/views/**"
,
"/img/**"
).
permitAll
()
.
antMatchers
(
"/
prometheus/**"
,
"/metrics/**"
,
"/
openapi/**"
,
"/vendor/**"
,
"/styles/**"
,
"/scripts/**"
,
"/views/**"
,
"/img/**"
).
permitAll
()
.
antMatchers
(
"/**"
).
hasAnyRole
(
USER_ROLE
);
.
antMatchers
(
"/**"
).
hasAnyRole
(
USER_ROLE
);
http
.
formLogin
().
loginPage
(
"/signin"
).
permitAll
().
failureUrl
(
"/signin?#/error"
).
and
().
httpBasic
();
http
.
formLogin
().
loginPage
(
"/signin"
).
permitAll
().
failureUrl
(
"/signin?#/error"
).
and
().
httpBasic
();
SimpleUrlLogoutSuccessHandler
urlLogoutHandler
=
new
SimpleUrlLogoutSuccessHandler
();
SimpleUrlLogoutSuccessHandler
urlLogoutHandler
=
new
SimpleUrlLogoutSuccessHandler
();
...
...
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