2025 May 22 8:37 AM - edited 2025 May 22 8:38 AM
Hi everyone,
I’m using Application Autoscaler on SAP BTP Cloud Foundry to reduce the number of instances of my application when the load drops. This works as expected — I can see that the instance count scales down to 1 based on the defined policy.
What I want to achieve is:
Receive an email notification automatically whenever the application scales down, especially when it reaches 1 instance.
My Questions:
Is it possible to configure this directly within the policy.json file used by the autoscaler?
If not, is there any built-in mechanism in BTP (without writing custom code or external integrations) that can notify us when such a scaling event happens?
Is there a way to connect autoscaler events to an email notification flow, fully within BTP services?
Thanks in advance for any suggestions or examples.
Request clarification before answering.
The SAP Alert Notification service for BTP has some standard events about changes/actions in the Cloud Foundry environment. There is a 'process scale' event which is (I think) what you need: https://help.sap.com/docs/alert-notification/sap-alert-notification-for-sap-btp/audit-application-pr.... Give it a go and let us know if this does the trick?
To set this up, follow the steps here: https://help.sap.com/docs/alert-notification/sap-alert-notification-for-sap-btp/initial-setup and don't forget to activate the 'enableCloudControllerAuditEvents' flag.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Thanks a lot for the helpful suggestion! Following your guidance, I was able to successfully receive notifications when my app scaled down. Here's what I did step by step:
1) I updated the Alert Notification service instance using: cf update-service SERVICE_NAME -c "{\"enableCloudControllerAuditEvents\": true}"
2) In the Alert Notification cockpit, I created a subscription with the following conditions: eventType is equal to audit.app.process.scale resource.resourceName is equal to APP_NAME
3) I then triggered the event manually using: cf scale APP_NAME -i 1
After this setup, I was able to receive the email notification successfully. Thanks again for pointing me in the right direction.
User | Count |
---|---|
30 | |
22 | |
16 | |
8 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.