why pcf is the best platform for spring boot
TRANSCRIPT
![Page 1: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/1.jpg)
1
Why PCF is the best platform for Spring Boot
2017-07-20 Toshiaki Maki (@making)
![Page 2: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/2.jpg)
Who am I ?
2
Toshiaki Maki (@making) https://blog.ik.am Sr. Solutions Architect @Pivotal Japan Spring Framework 💖 Cloud Foundry 💖
![Page 3: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/3.jpg)
Platform Spring Specific Comparison
3
AWS BeanStalk
Azure WebApps
Google AppEngine
Heroku OpenShift/k8s
PCF/ PWS
Spring Cloud Connector
Spring Cloud Connector Heroku
Spring Cloud Connector Cloud Foundry
Spring Boot Integration
* cloud profile * Apps Manager Spring Boot Actuator Support * Metric Forwarder
Spring Cloud Integration
Spring Cloud AWS
Spring Cloud GCP
* Spring Cloud Kubernetes * SCDF
* Spring Cloud Services * Trace Exporter * SCDF
![Page 4: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/4.jpg)
Platform Spring Specific Comparison
3
AWS BeanStalk
Azure WebApps
Google AppEngine
Heroku OpenShift/k8s
PCF/ PWS
Spring Cloud Connector
Spring Cloud Connector Heroku
Spring Cloud Connector Cloud Foundry
Spring Boot Integration
* cloud profile * Apps Manager Spring Boot Actuator Support * Metric Forwarder
Spring Cloud Integration
Spring Cloud AWS
Spring Cloud GCP
* Spring Cloud Kubernetes * SCDF
* Spring Cloud Services * Trace Exporter * SCDF
![Page 5: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/5.jpg)
Why PCF for Spring?
4
![Page 6: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/6.jpg)
Why PCF for Spring?
4
Because Pivotal Cloud Foundry gives us a lot of out-of-the-box features to manage / operate Spring Boot apps
![Page 7: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/7.jpg)
Why PCF for Spring?
4
Because Pivotal Cloud Foundry gives us a lot of out-of-the-box features to manage / operate Spring Boot apps
![Page 8: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/8.jpg)
Why PCF for Spring?
4
Because Pivotal Cloud Foundry gives us a lot of out-of-the-box features to manage / operate Spring Boot apps
12 Factors Apps
Microservices
Security
Tracing
Metrics
![Page 9: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/9.jpg)
Spring Support in PCF
5
• cloud profile • Spring Cloud Connectors • Spring Cloud Services • Trace Exporter • Spring Actuator Support in Apps Manager • Metrics Forwarder Service
![Page 10: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/10.jpg)
Spring Support in PCF
6
• cloud profile • Spring Cloud Connectors • Spring Cloud Services • Trace Exporter • Spring Actuator Support in Apps Manager • Metrics Forwarder Service
![Page 11: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/11.jpg)
"profile" in Spring
7
without PCF/PWS
myapp.foo=I am in local env.message=I am a default property.logging.level.com.example=DEBUG
myapp.foo=I am in AWS.message=I am a production propertylogging.level.com.example=INFO
application.properties
application-prod.properties
java -jar app.jar --spring.profiles.active=prod
![Page 12: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/12.jpg)
cloud profile
8
with PCF/PWS
myapp.foo=I am in local env.message=I am a default property.logging.level.com.example=DEBUG
myapp.foo=I am in cloud foundry.message=I am a cloud property.logging.level.com.example=INFO
application.properties
application-cloud.properties
java -jar app.jar --spring.profiles.active=cloud
![Page 13: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/13.jpg)
cloud profile
8
with PCF/PWS
myapp.foo=I am in local env.message=I am a default property.logging.level.com.example=DEBUG
myapp.foo=I am in cloud foundry.message=I am a cloud property.logging.level.com.example=INFO
application.properties
application-cloud.properties
java -jar app.jar --spring.profiles.active=cloud
cloud profile is set by java-buildpack
![Page 14: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/14.jpg)
Spring Support in PCF
9
• cloud profile • Spring Cloud Connectors • Spring Cloud Services • Trace Exporter • Spring Actuator Support in Apps Manager • Metrics Forwarder Service
![Page 15: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/15.jpg)
Attach backend services
10
without PCF/PWS
spring.datasource.url=real-db.example.comspring.datasource.username=real-db-userspring.datasource.password=readl-db-password
spring.rabbitmq.addresses=real-rabbit.example.comspring.rabbitmq.username=real-rabbit-userspring.rabbitmq.password=real-rabbit-passwordspring.rabbitmq.virtual-host=real-vhost
application-prod.properties
![Page 16: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/16.jpg)
Attach backend services
11
without PCF/PWS
spring.datasource.url=${DB_URL}spring.datasource.username=${DB_USERNAME}spring.datasource.password=${DB_PASSWORD}
spring.rabbitmq.addresses=${RABBIT_URL}spring.rabbitmq.username=${RABBIT_USERNAME}spring.rabbitmq.password=${RABBIT_PASSWORD}spring.rabbitmq.virtual-host=${RABBIT_VHOST}
application-prod.properties
![Page 17: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/17.jpg)
Attach backend services
11
without PCF/PWS
spring.datasource.url=${DB_URL}spring.datasource.username=${DB_USERNAME}spring.datasource.password=${DB_PASSWORD}
spring.rabbitmq.addresses=${RABBIT_URL}spring.rabbitmq.username=${RABBIT_USERNAME}spring.rabbitmq.password=${RABBIT_PASSWORD}spring.rabbitmq.virtual-host=${RABBIT_VHOST}
application-prod.properties
export DB_URL=real-db.example.comexport DB_USERNAME=real-db-userexport DB_PASSWORD=real-db-password...
![Page 18: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/18.jpg)
Spring Cloud Connectors
12
with PCF/PWS
@Profile("cloud")public class CloudConfig extends AbstractCloudConfig { @Bean public DataSource dataSource() { return connectionFactory().dataSource(); } @Bean public ConnectionFactory rabbitConnectionFactory() { return connectionFactory().rabbitConnectionFactory(); }}
![Page 19: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/19.jpg)
Spring Cloud Connectors
12
with PCF/PWS
@Profile("cloud")public class CloudConfig extends AbstractCloudConfig { @Bean public DataSource dataSource() { return connectionFactory().dataSource(); } @Bean public ConnectionFactory rabbitConnectionFactory() { return connectionFactory().rabbitConnectionFactory(); }}
cf bind-service myapp mydbcf bind-service myapp myrabbit
![Page 20: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/20.jpg)
Spring Cloud Connectors
13
with PCF/PWS
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-spring-service-connector</artifactId></dependency><dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-cloudfoundry-connector</artifactId></dependency>
![Page 21: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/21.jpg)
Spring Cloud Connectors
14
• RDB • RabbitMQ • Redis • MongoDB • SMTP • Spring Cloud Services (Config Server, Eureka, Hystrix
Dashboard) [1] • Vault [2] • ....
with PCF/PWS
[1] ... https://github.com/pivotal-cf/spring-cloud-services-connector [2] ... https://github.com/pivotal-cf/spring-cloud-vault-connector
![Page 22: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/22.jpg)
⚠ Do NOT use default datasource
15
with PCF/PWS
https://discuss.pivotal.io/hc/en-us/articles/221898227-Connection-pool-warning-message-maxIdle-is-larger-than-maxActive-setting-maxIdle-to-4-seen-in-PCF-deployed-Spring-app
org.apache.tomcat.jdbc.pool.ConnectionPool WARNING maxIdle is larger than maxActive, setting maxIdle to: 4
![Page 23: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/23.jpg)
⚠ Do NOT use default datasource
15
with PCF/PWS
https://discuss.pivotal.io/hc/en-us/articles/221898227-Connection-pool-warning-message-maxIdle-is-larger-than-maxActive-setting-maxIdle-to-4-seen-in-PCF-deployed-Spring-app
org.apache.tomcat.jdbc.pool.ConnectionPool WARNING maxIdle is larger than maxActive, setting maxIdle to: 4org.apache.tomcat.jdbc.pool.PoolExhaustedException: [...] Timeout: Pool empty. Unable to fetch a connection in 30 seconds, none available[size:4; busy:4; idle:0; lastwait:30000]
😱
![Page 24: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/24.jpg)
⚠ Do NOT use default datasource
16
with PCF/PWS
@Profile("cloud")public class CloudConfig extends AbstractCloudConfig { @Bean public DataSource dataSource() { PooledServiceConnectorConfig.PoolConfig poolConfig = new PooledServiceConnectorConfig.PoolConfig( 5 /* min */, 30 /* max */, 3000 /* wait */); return connectionFactory() .dataSource(new DataSourceConfig(poolConfig, null)); }}
![Page 25: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/25.jpg)
Spring Support in PCF
17
• cloud profile • Spring Cloud Connectors • Spring Cloud Services • Trace Exporter • Spring Actuator Support in Apps Manager • Metrics Forwarder Service
![Page 26: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/26.jpg)
Microservices with Spring Cloud
18
without PCF/PWS
Spring Boot App
Spring Boot App
Service Registry (Eureka) Config ServerCircuit Breaker Dashboard
(Hystrix Dashboard)
You manage (deploy + security)
You manage (deploy + security)
You manage (deploy + security)
![Page 27: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/27.jpg)
Spring Cloud Services
19
with PCF/PWS
Spring Boot App
Spring Boot App
Service Registry (Eureka) Config ServerCircuit Breaker Dashboard
(Hystrix Dashboard)
PCF manage (cf cs & cf bs)
PCF manage (cf cs & cf bs)
PCF manage (cf cs & cf bs)
19
UAA
![Page 28: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/28.jpg)
Spring Support in PCF
20
• cloud profile • Spring Cloud Connectors • Spring Cloud Services • Trace Exporter • Spring Actuator Support in Apps Manager • Metrics Forwarder Service
![Page 29: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/29.jpg)
Distributed Tracing with Zipkin
21
Spring Boot App
Spring Boot App
Spring Boot App
without PCF/PWS
Spring Boot App
Zipkin
You manage (deploy + security)
X-B3-SpaceId X-B3-TraceId
![Page 30: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/30.jpg)
Distributed Tracing with Zipkin
22
spring.zipkin.url=my-zipkin.example.com
without PCF/PWS
![Page 31: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/31.jpg)
Trace Exporter
23
Spring Boot App
Spring Boot App
PCF Metrics
with PCF/PWS
Trace Exporter
GoRouter
Spring Boot App
Spring Boot App
X-B3-SpaceId X-B3-TraceId
![Page 32: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/32.jpg)
Trace Exporter
24
![Page 33: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/33.jpg)
Trace Exporter
25
![Page 34: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/34.jpg)
Spring Support in PCF
26
• cloud profile • Spring Cloud Connectors • Spring Cloud Services • Trace Exporter • Spring Actuator Support in Apps Manager • Metrics Forwarder Service
![Page 35: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/35.jpg)
Spring Boot Actuator
27
Spring Boot Actuator
/health, /info, /loggers, /dump
![Page 36: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/36.jpg)
Spring Boot Actuator
27
Spring Boot Actuator
/health, /info, /loggers, /dump
Secured by default since Spring Boot 1.5.
ROLE_ACTUATOR is required.
![Page 37: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/37.jpg)
Secured by Default (since Spring Boot 1.5)
28
🔒
![Page 38: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/38.jpg)
29
😛management.security.enabled=false
![Page 39: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/39.jpg)
29
😛management.security.enabled=false
🙅
![Page 40: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/40.jpg)
30
management.security.enabled=true
management.security.enabled=falseapplication.properties
application-cloud.properties
![Page 41: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/41.jpg)
Many users say ...
31
![Page 42: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/42.jpg)
Many users say ...
31
"Actuator is actually useful, but
it is not for production, right?"
![Page 43: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/43.jpg)
Nooooooooooooooooo!!!!!
32
![Page 44: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/44.jpg)
Nooooooooooooooooo!!!!!
32 http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready.html
![Page 45: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/45.jpg)
Secure with Spring Security
33
without PCF/PWS
@EnableWebSecurity@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)public class ActuatorSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.antMatcher("/admin/**").authorizedRequests() .anyRequest().hasRole("ACTUATOR") .and().httpBasic() .and().csrf().disable(); } // ...}
management.context-path=/admin
![Page 46: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/46.jpg)
Spring Actuator Support in Apps Manager
34
Spring Boot Actuator
/cloudfoundryapplication/health, /cloudfoundryapplication/info, ...
Apps Manager
UAA
token
token
with PCF/PWS
Cloud Controller
tokenpermission
![Page 47: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/47.jpg)
Spring Actuator Support in Apps Manager
35
Endpoint Description Supported Version/dump Get thread dump 🆕 1.11~/env Get env variables, properties/metrics Get application's metrics/health Get the result of health checks ✅ 1.9~/info Get build information ✅ 1.9~/loggers Change logging level ✅ 1.9~/trace Get request trace log 🆕 1.11~/heapdump Download heap dump 🆕 1.11~
![Page 48: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/48.jpg)
Apps Manager
36
![Page 49: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/49.jpg)
/health
37
![Page 50: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/50.jpg)
/info
38
![Page 51: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/51.jpg)
/loggers
39
![Page 52: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/52.jpg)
/dump
40
![Page 53: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/53.jpg)
/dump
41
![Page 54: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/54.jpg)
/trace
42
![Page 55: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/55.jpg)
/heapdump
43
![Page 56: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/56.jpg)
/heapdump
44
![Page 57: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/57.jpg)
/heapdump
45
![Page 58: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/58.jpg)
/heapdump
46
![Page 59: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/59.jpg)
Spring Support in PCF
47
• cloud profile • Spring Cloud Connectors • Spring Cloud Services • Trace Exporter • Spring Actuator Support in Apps Manager • Metrics Forwarder Service
![Page 60: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/60.jpg)
Spring Actuator Support in Apps Manager
48
Endpoint Description Supported Version/dump Get thread dump 🆕 1.11~/env Get env variables, properties/metrics Get application's metrics/health Get the result of health checks ✅ 1.9~/info Get build information ✅ 1.9~/loggers Change logging level ✅ 1.9~/trace Get request trace log 🆕 1.11~/heapdump Download heap dump 🆕 1.11~
![Page 61: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/61.jpg)
Spring Actuator Support in Apps Manager
48
Endpoint Description Supported Version/dump Get thread dump 🆕 1.11~/env Get env variables, properties/metrics Get application's metrics/health Get the result of health checks ✅ 1.9~/info Get build information ✅ 1.9~/loggers Change logging level ✅ 1.9~/trace Get request trace log 🆕 1.11~/heapdump Download heap dump 🆕 1.11~
![Page 62: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/62.jpg)
Spring Boot Actuator Metrics
49
Spring Boot Actuator
/metrics
![Page 63: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/63.jpg)
Spring Boot Actuator Metrics
49
Spring Boot Actuator
/metrics
Metrics Writer
![Page 64: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/64.jpg)
Spring Boot Actuator Metrics
49
Spring Boot Actuator
/metrics
Metrics Writer TSDB or ...
![Page 65: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/65.jpg)
Spring Boot Actuator Metrics
49
Spring Boot Actuator
/metrics
Redis, OpenTSDB, Statsd, JMX
Metrics Writer TSDB or ...
![Page 66: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/66.jpg)
Spring Boot Actuator Metrics
49
Spring Boot Actuator
/metrics
send
Redis, OpenTSDB, Statsd, JMX
Metrics Writer TSDB or ...
![Page 67: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/67.jpg)
Spring Boot Actuator Metrics
49
Spring Boot Actuator
/metrics
send
Redis, OpenTSDB, Statsd, JMX
Dashboard
Metrics Writer TSDB or ...
![Page 68: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/68.jpg)
Spring Boot Actuator Metrics
49
Spring Boot Actuator
/metrics
send
Redis, OpenTSDB, Statsd, JMX
DashboardYou configure
Metrics Writer TSDB or ...
![Page 69: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/69.jpg)
Metrics Writer
50
@Bean@ExportMetricWriterMetricWriter metricWriter(MetricExportProperties export){ return new RedisMetricRepository(connectionFactory, export.getRedis().getPrefix(), export.getRedis().getKey());}
docs.spring.io/spring-boot/docs/current/reference/html/production-ready-metrics.html#production-ready-metric-writers
without PCF/PWS
![Page 70: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/70.jpg)
Metrics Forwarder Service
51
comes with java buildpack v3.18/4.2+
Enables Actuator's MetricsWriter to Metrics Forwarder Service automatically
https://github.com/cloudfoundry/java-buildpack-metric-writer
https://github.com/cloudfoundry/java-buildpack/blob/master/docs/framework-metric_writer.md
with PCF/PWS
![Page 71: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/71.jpg)
Metrics Forwarder Service
52
Spring Boot Actuator
Metrics WriterJava
build
pac
k Metrics Forwarder
Service
bind TSDB
Dashboard
send
send
with PCF/PWS
![Page 72: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/72.jpg)
Metrics Forwarder Service
53
cf bind-service myapp mf
cf cups mf -p '{"endpoint":"X","access_token":"X"}'
cf create-service metric-forwarder plan mf
OR
THEN
with PCF/PWS
![Page 73: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/73.jpg)
DEMO Scenario
54
Spring Boot Actuator
Metrics WriterJava
build
pac
k Metrics Forwarder
Service
bind
Grafana
Prometheusscrape
send
works as * Metrics Forwarder Service * Service Broker * Prometheus Exporter
PromQL
![Page 74: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/74.jpg)
55
![Page 75: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/75.jpg)
Source code
56
https://github.com/making/prometheus-exporter-metrics-forwarder-service
![Page 76: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/76.jpg)
Integration with PCF (Future)
57
Spring Boot Actuator
Metrics WriterJava
build
pac
k Metrics Forwarder
Service
bindPCF Metrics, Autoscalersend
send
will be provided as a "tile"
![Page 77: Why PCF is the best platform for Spring Boot](https://reader034.vdocuments.mx/reader034/viewer/2022050613/5aad0b637f8b9a003b8b4899/html5/thumbnails/77.jpg)
Recap
58
Why PCF is best platform for Spring ➡ a lot of out-of-the-box features
• cloud profile • Spring Cloud Connectors • Spring Cloud Services • Trace Exporter • Spring Actuator Support in Apps Manager • Metrics Forwarder Service