Skip to content

Commit

Permalink
Adding Prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
gabcamilo committed May 26, 2021
1 parent 33e4024 commit cc0d6ed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-jose</artifactId>
</dependency>

<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ protected void configure(HttpSecurity http) throws Exception {
authorizeRequests
.antMatchers(HttpMethod.POST, "/api/proposals/*").hasAuthority("SCOPE_customer")
.antMatchers(HttpMethod.GET, "/api/proposals/*").hasAuthority("SCOPE_customer")
.antMatchers(HttpMethod.POST, "/api/credit-cards/+*").hasAuthority("SCOPE_customer")
.antMatchers(HttpMethod.POST, "/api/credit-cards/**").hasAuthority("SCOPE_customer")
.antMatchers(HttpMethod.GET, "/actuator/**").permitAll()
.anyRequest().authenticated()
)
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt);
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ creditCard.associateCardTask.frequency=${ASSOCIATE_CARD_TASK_FREQUENCY:10000}
## spring security resource server configuration
spring.security.oauth2.resourceserver.jwt.issuer-uri=${KEYCLOAK_ISSUER_URI:http://localhost:18080/auth/realms/credit-card-proposals}
spring.security.oauth2.resourceserver.jwt.jwk-set-uri=${KEYCLOAK_JWKS_URI:http://localhost:18080/auth/realms/credit-card-proposals/protocol/openid-connect/certs}

#prometheus
management.endpoints.web.exposure.include=info,health,prometheus
management.endpoints.prometheus.enabled=true

0 comments on commit cc0d6ed

Please sign in to comment.