Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Set proper boot actuator endpoint configuration when deploying apps. #4753

Closed
CEDDM opened this issue Nov 10, 2021 · 9 comments · Fixed by #5141
Closed

Set proper boot actuator endpoint configuration when deploying apps. #4753

CEDDM opened this issue Nov 10, 2021 · 9 comments · Fixed by #5141
Assignees
Labels
status/in-progress Something is happening type/bug Is a bug report
Milestone

Comments

@CEDDM
Copy link

CEDDM commented Nov 10, 2021

Description:
The info endpoint is no more enabled by default with Spring Boot 2.5 https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.5-Release-Notes#secure-info-endpoint
This causes the app to be stucked in "Deploying" state in Kubernetes with this error : Readiness probe failed: HTTP Probe failed with statuscode: 404

Release versions:
Tested with SCDF 2.9.1 and Spring Boot 2.5.5 under microk8s 1.18.20

Steps to reproduce:
Create a dummy processor and deploy it in Kubernetes with a simple stream like time | my-processor | log

Additional context:
A simple workaround is to add management.endpoints.web.exposure.include=health,info in application.properties to enable info endpoint.
But wouldn't it be nice if Skipper does that for us ?

@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Nov 10, 2021
@jvalkeal
Copy link
Contributor

We've been trying not to tweak setting too much as we don't know what user is running. On our normal apps we chose to re-enable those endpoints in apps itself.

There is a config setting Common Application Properties where you could do this, would it work for you?

@jvalkeal jvalkeal added status/need-feedback Calling participant to provide feedback and removed status/need-triage Team needs to triage and take a first look labels Nov 10, 2021
@CEDDM
Copy link
Author

CEDDM commented Nov 10, 2021

Yes sure ! That would work.
But I'm afraid it might be complicated for SCDF beginners to understand why their app is not in 'Deployed' status.
I lost a couple of hours to understand why my apps didn't work anymore after upgrading Spring Boot

@github-actions github-actions bot added for/team-attention For team attention and removed status/need-feedback Calling participant to provide feedback labels Nov 10, 2021
@markpollack
Copy link
Contributor

markpollack commented Sep 29, 2022

I agree, we already set many boot properties so that the user doesn't have to, this one sounds quite important. I am a bit surprised to hear about this since, afaik, we don't do anything special regarding command app properties when deploying streams in our acceptance tests. I'll ping the group from input. Thanks for reporting.

@markpollack markpollack added the type/bug Is a bug report label Sep 29, 2022
@markpollack markpollack added this to the 2.10.0-M3 milestone Sep 29, 2022
@corneil corneil assigned corneil and unassigned jvalkeal Sep 29, 2022
@corneil
Copy link
Contributor

corneil commented Oct 3, 2022

My suggestion would be to make sure the samples have these properties added and that we document the need for adding management.endpoints.web.exposure.include=health,info,bindings

@github-actions github-actions bot added status/need-feedback Calling participant to provide feedback and removed for/team-attention For team attention labels Oct 3, 2022
@markpollack markpollack modified the milestones: 2.10.0-M3, 2.10.0-RC1 Oct 7, 2022
@markpollack
Copy link
Contributor

This is a larger more important issue than documentation in my opinion, these are the type of properties that we should be setting automatically when deploying.

@markpollack markpollack changed the title Enable info actuator endpoint with Skipper Set proper boot actuator endpoint configuration when deploying apps. Oct 7, 2022
@onobc onobc modified the milestones: 2.10.0-RC1, 2.10.0-RC2 Oct 21, 2022
@onobc
Copy link
Contributor

onobc commented Nov 10, 2022

All OOTB stream applications have the property set:

management.endpoints.web.exposure.include=health,info,bindings

Custom apps will not have it though. It would be easy enough to add but are there any cases where the user would NOT want these set? I believe in that case an management.endpoints.web.exposure.exclude may work to negate the default.

I will give this approach a try.

@onobc onobc self-assigned this Nov 10, 2022
@onobc onobc added status/need-investigation Oh need to look under a hood and removed status/need-feedback Calling participant to provide feedback labels Nov 10, 2022
@onobc
Copy link
Contributor

onobc commented Nov 10, 2022

I verified that the management.endpoints.web.exposure.exclude does in fact do what it says it does. For example, given an app w/

management.endpoints.web.exposure.include=health,info,bindings

setting the property:

management.endpoints.web.exposure.exclude=bindings

results in only 2 endpoints (as expected): health, info.

onobc added a commit to onobc/spring-cloud-dataflow that referenced this issue Nov 11, 2022
onobc added a commit to onobc/spring-cloud-dataflow that referenced this issue Nov 11, 2022
onobc added a commit to onobc/spring-cloud-dataflow that referenced this issue Nov 11, 2022
onobc added a commit that referenced this issue Nov 11, 2022
* Add actuator props to stream on deployment

Fixes #4753
@nstaeger
Copy link

nstaeger commented Aug 25, 2023

Hi @onobc,

we just updated our SCDF cluster to 2.10.3 and ran into an issue with the new defaults discuessed in this thread.

We do also expose the actuator/prometheus endpoint in our stream apps for monitoring. However, as these new properties override the default stream app configuration and does not include the prometheus endpoint our monitoring is no longer working. This is how the relevant part of our application.properties file of our SCDF stream application looks like:

management.endpoints.web.exposure.include=*
management.endpoints.enabled-by-default=false
management.endpoint.health.show-details=never
management.endpoint.health.enabled=true
management.endpoint.metrics.enabled=true
management.endpoint.info.enabled=true
management.health.binders.enabled=true

We re-created our stream definition trying to override the default by adding the following property to our DSL

mystreamapp --management.endpoints.web.exposure.include=*

While after creating the Stream the setting was correctly displayed, it was resetted to info,health,bindings when the stream was deployed by SCDF.

What is the proposed way to also include the prometheus management endpoint for our stream apps?


Edit: If anyone stumbles accross this as well, we were able to work around this. According to the documentation it is possible to override these defaults which we did using an environment variable on the SCDF server

SPRING_CLOUD_DATAFLOW_APPLICATIONPROPERTIES_STREAM_MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE=*

@onobc
Copy link
Contributor

onobc commented Aug 29, 2023

Hi @nstaeger ,
Thank you for posting the instructions on how to set the property. We will take a look at why setting on the command line did not work and follow up from the results of that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/in-progress Something is happening type/bug Is a bug report
Development

Successfully merging a pull request may close this issue.

6 participants